Gremlin console and Titan custom attribute serializers - possible?

108 views
Skip to first unread message

sheshadr...@getfreebird.com

unread,
Apr 22, 2016, 4:10:53 PM4/22/16
to Aurelius
Is there a trick to making gremlin console load custom attribute serializers ?  I'm using the 
attributes.custom.attribute1.attribute-class = java.util.HashMap
attributes.custom.attribute1.serializer-class = com.freebird.titan.serializer.MapSerializerScala


in properties file and when I open using TitanFactory, in gremlin console, I keep getting the error: 
Need to set configuration value: root.attributes.custom.attribute-class

When I try same properties file via Gremlin Server, I don't get any errors.

What am I doing wrong?

Thanks,
S-

Jason Plurad

unread,
Apr 23, 2016, 11:15:39 AM4/23/16
to Aurelius
This example works fine https://github.com/pluradj/titan-attribute-serializer

Could you post the full configuration file?

sheshadr...@getfreebird.com

unread,
Apr 29, 2016, 1:23:11 PM4/29/16
to Aurelius
Hi Jason,
Thanks for reply -- got consumed with other stuff... Here is the file contents (comments stripped out):

storage.backend=cassandra
storage.hostname=192.168.41.185,192.168.41.18
attributes.custom.attribute1.attribute-class = java.util.HashMap
attributes.custom.attribute1.serializer-class = com.freebird.titan.serializer.MapSerializerScala
attributes.custom.attribute2.attribute-class = org.joda.time.DateTime
attributes.custom.attribute2.serializer-class = com.freebird.titan.serializer.DateTimeSerializer
attributes.custom.attribute3.attribute-class = org.joda.time.LocalDate
attributes.custom.attribute3.serializer-class = com.freebird.titan.serializer.LocalDateSerializer

cache.db-cache = true
cache.db-cache-size = 0.25
index.search.backend=elasticsearch
index.search.hostname=192.168.41.18
index.search.elasticsearch.client-only=true

Was it clear that this exact configuration works with gremlin-server but doesn't work with gremlin-console (gremlin.sh). ?

Thanks,
S-

sheshadr...@getfreebird.com

unread,
Apr 29, 2016, 1:25:44 PM4/29/16
to Aurelius
oops -- forgot to mention that this is from titan-titan11 branch which I believe is Titan-1.0-SNAPSHOT (we have to use this 'cause that is the version that works with gremlin-scala).


On Friday, April 22, 2016 at 4:10:53 PM UTC-4, sheshadr...@getfreebird.com wrote:

sheshadr...@getfreebird.com

unread,
May 11, 2016, 4:25:08 PM5/11/16
to Aurelius
Bump -- anyone ?

Jason Plurad

unread,
May 12, 2016, 1:40:59 AM5/12/16
to Aurelius
Did you put all of your serializer classes into $TITAN_HOME/lib/ directory? If you didn't package your classes as an uber jar, maybe you're missing some dependencies (like for joda or scala).

-- Jason

Sheshadri Mantha

unread,
May 12, 2016, 7:34:49 AM5/12/16
to aureliu...@googlegroups.com
@location - yup
@package - yes i think so... it does work with the gremlin-server.  And gremlin console isn't complaining about any other missing classes except for the serializer - can't imagine that jvm would report an incorrect class loader error.

As far as you know if it should work in the gremlin console if it is working in gremlin server - correct?

BTW: Thanks for the reply.

--
You received this message because you are subscribed to a topic in the Google Groups "Aurelius" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/aureliusgraphs/FNa_sYfzQt4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to aureliusgraph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/5f6d6cb1-43cf-42e3-bd8c-dbe04cd723d4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jason Plurad

unread,
May 12, 2016, 5:38:29 PM5/12/16
to Aurelius
Right, as I mentioned before, my example on GitHub works fine on both Gremlin Console and Gremlin Server.

Are you using the same properties file for both?

-- Jason

Vijay S

unread,
Sep 6, 2017, 3:10:32 AM9/6/17
to Aurelius
Hi Jason

Just wanted to thank you for the GitHub project illustrating the use of custom attributes. I created my own Serializer for ArrayList and LinkedHashMap using your example and got things working on JanusGraph as well.

-- Vijay
Reply all
Reply to author
Forward
0 new messages