Whitespace being stripped from vertex properties

12 views
Skip to first unread message

Steven McCraw

unread,
May 22, 2013, 11:54:26 AM5/22/13
to pacer...@googlegroups.com
Hi All!  I'm seeing an unusual thing which I bet is configurable somehow.  I'm creating a vertex that has a property named expression, and I'm feeding it data that looks like this:

expression = "   Foo Bar   ".

If I then find that vertex and message it to get its properties, I get back "expression"=>"Foo Bar".  The surrounding whitespace characters are gone!  At first, I thought it might be my graph database implementation (Titan) or the underlying data store for that (Cassandra), but then I dumped out a GraphML representation of things, and the whitespace characters *are* preserved.  So my best guess now is that pacer is chomping off the whitespace, and I'd rather it didn't in this particular scenario.  Is this something that is configurable?  Am I on the right track?

Thanks!
Mark

Darrick Wiebe

unread,
May 22, 2013, 12:00:32 PM5/22/13
to Pacer Group
That functionality is defined in the encoder. By default string properties do get trimmed, but if you provide your own encoder implementation when starting the graph you can have other behaviour as needed.

One thing to note however is that the default encoder does some serialization for types that aren't natively supported, and it "flags" that a field value needs to be deserialized by prepending a space (since that would otherwise be trimmed out), so you will have to either remove or adjust that functionality if you decide to subclass the default encoder.

Cheers,
Darrick


--
You received this message because you are subscribed to the Google Groups "pacer-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pacer-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages