Date
1 - 4 of 4
Problem with index never becoming ENABLED.
Augusto Will <pw...@...>
About the index that never becomes ENABLED and can't reindex the
existent data, is because an example in documentation
(http://docs.janusgraph.org/latest/indexes.html) that create a index,
wait for index to become available and try to reindex, wich cause an
error, because the created index is not enabled never. I think it's missing these line (in bold) inside documentation before the reindex. This is why I see other users had the same problem. graph.tx().rollback() //Never create new indexes while a transaction is active mgmt = graph.openManagement() name = mgmt.getPropertyKey('name') age = mgmt.getPropertyKey('age') mgmt.buildIndex('byNameComposite', Vertex.class).addKey(name).buildCompositeIndex() mgmt.buildIndex('byNameAndAgeComposite', Vertex.class).addKey(name).addKey(age).buildCompositeIndex() mgmt.commit() //Wait for the index to become available mgmt.awaitGraphIndexStatus(graph, 'byNameComposite').call() mgmt.awaitGraphIndexStatus(graph, 'byNameAndAgeComposite').call() //Reindex the existing data mgmt = graph.openManagement() |
|
Robert Dale <rob...@...>
This example works on a clean database. Can you share what you are seeing? See also https://github.com/JanusGraph/janusgraph/wiki/Indexing janusgraph-0.1.1-hadoop2]$ ./bin/gremlin.sh \,,,/ (o o) -----oOOo-(3)-oOOo----- plugin activated: janusgraph.imports plugin activated: tinkerpop.server plugin activated: tinkerpop.utilities SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/data/janusgraph-0. SLF4J: Found binding in [jar:file:/data/janusgraph-0. SLF4J: See http://www.slf4j.org/codes. SLF4J: Actual binding is of type [org.slf4j.impl. 06:53:32 WARN org.apache.hadoop.util. plugin activated: tinkerpop.hadoop plugin activated: tinkerpop.spark plugin activated: tinkerpop.tinkergraph gremlin> // Example assumes this exists ==>true gremlin> graph = JanusGraphFactory.open(' ==>standardjanusgraph[ gremlin> mgmt = graph.openManagement() ==>org.janusgraph.graphdb. gremlin> mgmt.makePropertyKey('name'). ==>name gremlin> mgmt.makePropertyKey('age'). ==>age gremlin> mgmt.commit() ==>null gremlin> gremlin> // Start example ==>true gremlin> graph.tx().rollback() //Never create new indexes while a transaction is active ==>null gremlin> mgmt = graph.openManagement() ==>org.janusgraph.graphdb. gremlin> name = mgmt.getPropertyKey('name') ==>name gremlin> age = mgmt.getPropertyKey('age') ==>age gremlin> mgmt.buildIndex(' ==>byNameComposite gremlin> mgmt.buildIndex(' ==>byNameAndAgeComposite gremlin> mgmt.commit() ==>null gremlin> gremlin> //Wait for the index to become REGISTERED ==>true gremlin> mgmt.awaitGraphIndexStatus( ==>GraphIndexStatusReport[ gremlin> mgmt.awaitGraphIndexStatus( ==>GraphIndexStatusReport[ gremlin> gremlin> //Reindex the existing data ==>true gremlin> mgmt = graph.openManagement() ==>org.janusgraph.graphdb. gremlin> mgmt.updateIndex(mgmt. ==>org.janusgraph.diskstorage. gremlin> mgmt.updateIndex(mgmt. ==>org.janusgraph.diskstorage. gremlin> mgmt.commit() ==>null gremlin> gremlin> mgmt.awaitGraphIndexStatus( ==>GraphIndexStatusReport[ gremlin> mgmt.awaitGraphIndexStatus( ==>GraphIndexStatusReport[ Robert Dale On Wed, Oct 18, 2017 at 5:57 AM, Augusto Will <pw...@...> wrote:
|
|
Augusto Will <pw...@...>
I Think I can get the index enabled, wow! After the good eraseall.sh #!/bin/bash sed -i 's/HttpChannelizer/WebSocketChannelizer/gi' ~/janusgraph-0.2.0-hadoop2/conf/gremlin-server/gremlin-server.yaml ./janusgraph.sh stop ./janusgraph.sh clean ./janusgraph.sh start All clean.... Janus in websocket mode. gremlin> :remote console ==>All scripts will now be sent to Gremlin Server - * - type ':remote console' to return to local mode gremlin> graph.getOpenTransactions() gremlin> mgmt = graph.openManagement() ==>org.janusgraph.graphdb.database.management.ManagementSystem@3d85c395 gremlin> mgmt.makeVertexLabel('person').make() ==>person gremlin> mgmt.makePropertyKey('usuarioId').dataType(Integer.class).cardinality(Cardinality.SINGLE).make() ==>usuarioId gremlin> mgmt.makePropertyKey('usuarioNome').dataType(String.class).cardinality(Cardinality.SET).make() ==>usuarioNome gremlin> mgmt.makePropertyKey('usuarioEmail').dataType(String.class).cardinality(Cardinality.SET).make() ==>usuarioEmail gremlin> mgmt.makePropertyKey('usuarioBloqueado').dataType(Boolean.class).cardinality(Cardinality.SET).make() ==>usuarioBloqueado gremlin> mgmt.commit() ==>null gremlin> gremlin> gremlin> gremlin> graph.tx().rollback() //Never create new indexes while a transaction is active ==>null gremlin> gremlin> mgmt = graph.openManagement() ==>org.janusgraph.graphdb.database.management.ManagementSystem@4e8ef582 gremlin> name = mgmt.getPropertyKey('usuarioId') ==>usuarioId gremlin> mgmt.buildIndex('byUsuarioIdComposite', Vertex.class).addKey(name).buildCompositeIndex() ==>byUsuarioIdComposite gremlin> mgmt.commit() ==>null gremlin> gremlin> mgmt.awaitGraphIndexStatus(graph, 'byUsuarioIdComposite').call() ==>GraphIndexStatusReport[success=true, indexName='byUsuarioIdComposite', targetStatus=[REGISTERED], notConverged={}, converged={usuarioId=REGISTERED}, elapsed=PT7.03S] gremlin> gremlin> mgmt = graph.openManagement() ==>org.janusgraph.graphdb.database.management.ManagementSystem@7cddeeba gremlin> //mgmt.updateIndex(mgmt.getGraphIndex("byUsuarioIdComposite"), SchemaAction.REINDEX).get() ==>null gremlin> //mgmt.commit() ==>null gremlin> mgmt.awaitGraphIndexStatus(graph, 'byUsuarioIdComposite').status(SchemaStatus.ENABLED).call() ==>GraphIndexStatusReport[success=false, indexName='byUsuarioIdComposite', targetStatus=[ENABLED], notConverged={usuarioId=REGISTERED}, converged={}, elapsed=PT1M0.183S] gremlin> gremlin> mgmt.awaitGraphIndexStatus(graph, 'byUsuarioIdComposite').status(SchemaStatus.ENABLED).call() ==>GraphIndexStatusReport[success=false, indexName='byUsuarioIdComposite', targetStatus=[ENABLED], notConverged={usuarioId=REGISTERED}, converged={}, elapsed=PT1M0.209S] gremlin> mgmt = graph.openManagement() ==>org.janusgraph.graphdb.database.management.ManagementSystem@7d1154c4 gremlin> mgmt.updateIndex(mgmt.getGraphIndex("byIdUsuarioComposite"), SchemaAction.ENABLE_INDEX).get() Need to provide an index Type ':help' or ':h' for help. Display stack trace? [yN] gremlin> mgmt.updateIndex(mgmt.getGraphIndex("byUsuarioIdComposite"), SchemaAction.ENABLE_INDEX).get() ==>null gremlin> mgmt = graph.openManagement() ==>org.janusgraph.graphdb.database.management.ManagementSystem@3d3de507 gremlin> name = mgmt.getPropertyKey('usuarioId') ==>usuarioId gremlin> nameIndex = mgmt.getGraphIndex('byUsuarioIdComposite') ==>byUsuarioIdComposite gremlin> nameIndexStatus = nameIndex.getIndexStatus(name) ==>REGISTERED gremlin> graph.getOpenTransactions() ==>standardjanusgraphtx[0x12300940] ==>standardjanusgraphtx[0x5ed65562] ==>standardjanusgraphtx[0x132c3710] gremlin> graph.tx().rollback() ==>null gremlin> graph.tx().rollback() ==>null gremlin> graph.tx().rollback() ==>null gremlin> graph.tx().rollback() ==>null gremlin> graph.getOpenTransactions() ==>standardjanusgraphtx[0x12300940] ==>standardjanusgraphtx[0x5ed65562] ==>standardjanusgraphtx[0x132c3710] gremlin> graph.tx().rollback() ==>null gremlin> graph.tx().rollback() ==>null gremlin> graph.tx().rollback() ==>null gremlin> graph.getOpenTransactions() ==>standardjanusgraphtx[0x12300940] ==>standardjanusgraphtx[0x5ed65562] ==>standardjanusgraphtx[0x132c3710] gremlin> graph.getOpenTransactions().getAt(0).rollback() ==>null gremlin> graph.getOpenTransactions().getAt(0).rollback() ==>null gremlin> graph.getOpenTransactions().getAt(0).rollback() ==>null gremlin> graph.getOpenTransactions().getAt(0).rollback() Cannot invoke method rollback() on null object Type ':help' or ':h' for help. Display stack trace? [yN]graph.getOpenTransactions().getAt(0).rollback() gremlin> graph.getOpenTransactions() gremlin> mgmt = graph.openManagement() ==>org.janusgraph.graphdb.database.management.ManagementSystem@366ed168 gremlin> name = mgmt.getPropertyKey('usuarioId') ==>usuarioId gremlin> nameIndex = mgmt.getGraphIndex('byUsuarioIdComposite') ==>byUsuarioIdComposite gremlin> nameIndexStatus = nameIndex.getIndexStatus(name) ==>REGISTERED gremlin> graph.getOpenTransactions() ==>standardjanusgraphtx[0x3d42dabb] gremlin> graph.getOpenTransactions().getAt(0).rollback() ==>null gremlin> graph.getOpenTransactions().getAt(0).rollback() Cannot invoke method rollback() on null object Type ':help' or ':h' for help. Display stack trace? [yN] gremlin> mgmt.updateIndex(mgmt.getGraphIndex("byUsuarioIdComposite"), SchemaAction.ENABLE_INDEX).get() Cannot access element because its enclosing transaction is closed and unbound Type ':help' or ':h' for help. Display stack trace? [yN] gremlin> mgmt = graph.openManagement() ==>org.janusgraph.graphdb.database.management.ManagementSystem@508a3f2c gremlin> mgmt.updateIndex(mgmt.getGraphIndex("byUsuarioIdComposite"), SchemaAction.ENABLE_INDEX).get() ==>null gremlin> name = mgmt.getPropertyKey('usuarioId') ==>usuarioId gremlin> nameIndex = mgmt.getGraphIndex('byUsuarioIdComposite') ==>byUsuarioIdComposite gremlin> nameIndexStatus = nameIndex.getIndexStatus(name) ==>ENABLED gremlin> What a battle hah? But I could find what the problem. WOW Nice!!!! |
|
vamsi.lingala@...
Register index before you enable it
|
|