Edge keyindex...

128 views
Skip to first unread message

Fernand Galiana

unread,
Feb 4, 2014, 1:30:13 PM2/4/14
to aureliu...@googlegroups.com
All,

   I am using Titan + Rexster + Cassandra V 0.4.2.

   Using Rexster I can specify keyindices on vertices but not edges.

   http://localhost:8182/graphs/test_graph/keyindices => {'edge': [], 'vertex', ['prop_x']}

   BUT...


   There is no info I could find in the logs for the reason of the failure ??

   What am I missing?

Thanks!

Fernand Galiana

unread,
Feb 5, 2014, 6:10:02 PM2/5/14
to aureliu...@googlegroups.com
Also noticed that a second request to add a different keyindex on a vertex now also fails.

Kind of stuck here. Please advise...

Thanks!

Daniel Kuppitz

unread,
Feb 5, 2014, 6:51:17 PM2/5/14
to aureliu...@googlegroups.com
Hi Fernand,

please read the Type Definition Overview to learn how to create/use indices in Titan.

Cheers,
Daniel



2014-02-06 Fernand Galiana <fernand...@gmail.com>:

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

Fernand Galiana

unread,
Feb 6, 2014, 12:52:17 AM2/6/14
to aureliu...@googlegroups.com
Thanks Daniel! Yes I've read these docs, but I am trying to use the rexster api to create my key indices and that 
does not seems to work at all in my current titan+rexster+cassandra instance.

void/graphs/<graph>/keyindices/vertex/<key>create a new key index for a vertex
void/graphs/<graph>/keyindices/edge/<key>create a new key index for an edge
Are these API's not supported in the current titan-server 0.4.2?
These calls fails but I see nothing on the server logs that point to the root cause??

Any help on that would be much appreciated as I am currently stuck in my quest to use rexster with titan.

Thanks!

Stephen Mallette

unread,
Feb 6, 2014, 7:50:59 AM2/6/14
to aureliu...@googlegroups.com
I'm not able to recreate the problem.  I'm using the Titan Server 0.4.2 distribution and can properly create a key index as follows:

* About to connect() to localhost port 8182 (#0)
*   Trying 127.0.0.1... connected
> POST /graphs/graph/keyindices/edge/test HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:8182
> Accept: */*
< HTTP/1.1 200 OK
< Content-Type: application/json;charset=UTF-8
< server: grizzly/2.2.16
< Access-Control-Allow-Origin: *
< Date: Thu, 06 Feb 2014 12:45:57 GMT
< Transfer-Encoding: chunked
* Connection #0 to host localhost left intact
* Closing connection #0
{"version":"2.4.0","queryTime":825.529753}

* About to connect() to localhost port 8182 (#0)
*   Trying 127.0.0.1... connected
> GET /graphs/graph/keyindices HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:8182
> Accept: */*
< HTTP/1.1 200 OK
< Content-Type: application/json;charset=UTF-8
< server: grizzly/2.2.16
< Access-Control-Allow-Origin: *
< Date: Thu, 06 Feb 2014 12:47:13 GMT
< Transfer-Encoding: chunked
* Connection #0 to host localhost left intact
* Closing connection #0
{"version":"2.4.0","results":{"edge":["reason","test","place"],"vertex":["age","name"]},"queryTime":95.769981}

That said, I don't think it's good to do this.  When creating indices, use the native graph APIs to do so.  Titan supports the Blueprints notion of key indices, but does not create them in an optimal way.  You are far better off creating them yourself with a script and the Gremlin REPL.

Stephen

Fernand Galiana

unread,
Feb 6, 2014, 7:28:32 PM2/6/14
to aureliu...@googlegroups.com
Hi Stephen,

   Thanks for looking into it and helping me out!

   I think things are looking a bit better now. I am surprised to hear that going thru the rexster rest interface yields different results.
   I went ahead and created the indexes in the console directly and I am no longer seeing the log messages complaining about no indices.
   One thing worth mentioning is not to forget to commit after creating the index keys ;-(

   Could you explain here why going thru the rest api yields to different results?

Stephen Mallette

unread,
Feb 6, 2014, 9:45:57 PM2/6/14
to aureliu...@googlegroups.com
I'm not quite sure I understand what you mean by "different results".  The "keyindex" resource of the REST API utilizes the Blueprints createKeyIndex() method to construct the index.  The Titan implementation of that creates a very basic index as compared to the full Titan API:


It's part of the cost of generalizing features to Blueprints.  From the TinkerPop side, we've seen that so much so, that for TinkerPop3, we will rely completely on vendor APIs to create indices and not attempt to generalize index creation.  Hope that helps make things clear.

Stephen
Reply all
Reply to author
Forward
0 new messages