标签:ado glob options 两种 actor common 原因 ide tar
graph = JanusGraphFactory.open(...) mgmt = graph.openManagement() mr = new MapReduceIndexManagement(graph) mr.updateIndex(mgmt.getRelationIndex(mgmt.getRelationType("battled"), "battlesByTime"), SchemaAction.REINDEX).get() mgmt.commit()
// Open a graph graph = JanusGraphFactory.open("conf/janusgraph-cassandra-es.properties") g = graph.traversal() // Define a property mgmt = graph.openManagement() desc = mgmt.makePropertyKey("desc").dataType(String.class).make() mgmt.commit() // Insert some data graph.addVertex("desc", "foo bar") graph.addVertex("desc", "foo baz") graph.tx().commit() // Run a query -- note the planner warning recommending the use of an index g.V().has("desc", containsText("baz")) // Create an index mgmt = graph.openManagement() desc = mgmt.getPropertyKey("desc") mixedIndex = mgmt.buildIndex("mixedExample", Vertex.class).addKey(desc).buildMixedIndex("search") mgmt.commit() // Rollback or commit transactions on the graph which predate the index definition graph.tx().rollback() // Block until the SchemaStatus transitions from INSTALLED to REGISTERED report = mgmt.awaitGraphIndexStatus(graph, "mixedExample").call() // Run a JanusGraph-Hadoop job to reindex mgmt = graph.openManagement() mr = new MapReduceIndexManagement(graph) mr.updateIndex(mgmt.getGraphIndex("mixedExample"), SchemaAction.REINDEX).get() // Enable the index mgmt = graph.openManagement() mgmt.updateIndex(mgmt.getGraphIndex("mixedExample"), SchemaAction.ENABLE_INDEX).get() mgmt.commit() // Block until the SchemaStatus is ENABLED mgmt = graph.openManagement() report = mgmt.awaitGraphIndexStatus(graph, "mixedExample").status(SchemaStatus.ENABLED).call() mgmt.rollback() // Run a query -- JanusGraph will use the new index, no planner warning g.V().has("desc", containsText("baz")) // Concerned that JanusGraph could have read cache in that last query, instead of relying on the index? // Start a new instance to rule out cache hits. Now we‘re definitely using the index. graph.close() graph = JanusGraphFactory.open("conf/janusgraph-cassandra-es.properties") g.V().has("desc", containsText("baz"))
m = graph.openManagement() i = m.getGraphIndex(‘indexName‘) m.updateIndex(i, SchemaAction.REINDEX).get() m.commit()
import org.janusgraph.graphdb.database.management.ManagementSystem // Load some data from a file without any predefined schema graph = JanusGraphFactory.open(‘conf/janusgraph-berkeleyje.properties‘) g = graph.traversal() m = graph.openManagement() m.makePropertyKey(‘name‘).dataType(String.class).cardinality(Cardinality.LIST).make() m.makePropertyKey(‘lang‘).dataType(String.class).cardinality(Cardinality.LIST).make() m.makePropertyKey(‘age‘).dataType(Integer.class).cardinality(Cardinality.LIST).make() m.commit() graph.io(IoCore.gryo()).readGraph(‘data/tinkerpop-modern.gio‘) graph.tx().commit() // Run a query -- note the planner warning recommending the use of an index g.V().has(‘name‘, ‘lop‘) graph.tx().rollback() // Create an index m = graph.openManagement() m.buildIndex(‘names‘, Vertex.class).addKey(m.getPropertyKey(‘name‘)).buildCompositeIndex() m.commit() graph.tx().commit() // Block until the SchemaStatus transitions from INSTALLED to REGISTERED ManagementSystem.awaitGraphIndexStatus(graph, ‘names‘).status(SchemaStatus.REGISTERED).call() // Reindex using JanusGraphManagement m = graph.openManagement() i = m.getGraphIndex(‘names‘) m.updateIndex(i, SchemaAction.REINDEX) m.commit() // Enable the index ManagementSystem.awaitGraphIndexStatus(graph, ‘names‘).status(SchemaStatus.ENABLED).call() // Run a query -- JanusGraph will use the new index, no planner warning g.V().has(‘name‘, ‘lop‘) graph.tx().rollback() // Concerned that JanusGraph could have read cache in that last query, instead of relying on the index? // Start a new instance to rule out cache hits. Now we‘re definitely using the index. graph.close() graph = JanusGraphFactory.open("conf/janusgraph-berkeleyje.properties") g = graph.traversal() g.V().has(‘name‘, ‘lop‘)
mgmt = graph.openManagement() rindex = mgmt.getRelationIndex(mgmt.getRelationType("battled"), "battlesByTime") mgmt.updateIndex(rindex, SchemaAction.DISABLE_INDEX).get() gindex = mgmt.getGraphIndex("byName") mgmt.updateIndex(gindex, SchemaAction.DISABLE_INDEX).get() mgmt.commit()
ManagementSystem.awaitGraphIndexStatus(graph, ‘byName‘).status(SchemaStatus.DISABLED).call()
import org.janusgraph.graphdb.database.management.ManagementSystem // Load the "Graph of the Gods" sample data graph = JanusGraphFactory.open(‘conf/janusgraph-cassandra-es.properties‘) g = graph.traversal() GraphOfTheGodsFactory.load(graph) g.V().has(‘name‘, ‘jupiter‘) // Disable the "name" composite index m = graph.openManagement() nameIndex = m.getGraphIndex(‘name‘) m.updateIndex(nameIndex, SchemaAction.DISABLE_INDEX).get() m.commit() graph.tx().commit() // Block until the SchemaStatus transitions from INSTALLED to REGISTERED ManagementSystem.awaitGraphIndexStatus(graph, ‘name‘).status(SchemaStatus.DISABLED).call() // Delete the index using MapReduceIndexJobs m = graph.openManagement() mr = new MapReduceIndexManagement(graph) future = mr.updateIndex(m.getGraphIndex(‘name‘), SchemaAction.REMOVE_INDEX) m.commit() graph.tx().commit() future.get() // Index still shows up in management interface as DISABLED -- this is normal m = graph.openManagement() idx = m.getGraphIndex(‘name‘) idx.getIndexStatus(m.getPropertyKey(‘name‘)) m.rollback() // JanusGraph should issue a warning about this query requiring a full scan g.V().has(‘name‘, ‘jupiter‘)
m = graph.openManagement() i = m.getGraphIndex(‘indexName‘) m.updateIndex(i, SchemaAction.REMOVE_INDEX).get() m.commit()
import org.janusgraph.graphdb.database.management.ManagementSystem // Load the "Graph of the Gods" sample data graph = JanusGraphFactory.open(‘conf/janusgraph-cassandra-es.properties‘) g = graph.traversal() GraphOfTheGodsFactory.load(graph) g.V().has(‘name‘, ‘jupiter‘) // Disable the "name" composite index m = graph.openManagement() nameIndex = m.getGraphIndex(‘name‘) m.updateIndex(nameIndex, SchemaAction.DISABLE_INDEX).get() m.commit() graph.tx().commit() // Block until the SchemaStatus transitions from INSTALLED to REGISTERED ManagementSystem.awaitGraphIndexStatus(graph, ‘name‘).status(SchemaStatus.DISABLED).call() // Delete the index using JanusGraphManagement m = graph.openManagement() nameIndex = m.getGraphIndex(‘name‘) future = m.updateIndex(nameIndex, SchemaAction.REMOVE_INDEX) m.commit() graph.tx().commit() future.get() m = graph.openManagement() nameIndex = m.getGraphIndex(‘name‘) g.V().has(‘name‘, ‘jupiter‘)
The index mixedExample is in an invalid state and cannot be indexed.
The following index keys have invalid status: desc has status INSTALLED
(status must be one of [REGISTERED, ENABLED])
The index mixedExample is in an invalid state and cannot be indexed.
The index has status INSTALLED, but one of [REGISTERED, ENABLED] is required
mgmt = graph.openManagement() rindex = mgmt.getRelationIndex(mgmt.getRelationType("battled"),"battlesByTime") mgmt.updateIndex(rindex, SchemaAction.REGISTER_INDEX).get() gindex = mgmt.getGraphIndex("byName") mgmt.updateIndex(gindex, SchemaAction.REGISTER_INDEX).get() mgmt.commit()
java.net.SocketException: Too many open files at java.net.Socket.createImpl(Socket.java:447) at java.net.Socket.getImpl(Socket.java:510) at java.net.Socket.setSoLinger(Socket.java:988) at org.apache.thrift.transport.TSocket.initSocket(TSocket.java:118) at org.apache.thrift.transport.TSocket.<init>(TSocket.java:109)
max-active
andmax-idle
options to 1 each, and settingmax-total
to -1. SeeChapter 12,Configuration Referencefor full listings of connection pool settings on the Cassandra storage backends.nofile
ulimit. The ideal value depends on the size of the Cassandra dataset and the throughput of the reindex mappers; if starting at 1024, try an order of magnitude larger: 10000. This is just necessary to sustain lingering TIME_WAIT sockets. The reindex job won’t try to open nearly that many sockets at once.<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">
标签:ado glob options 两种 actor common 原因 ide tar
原文地址:http://www.cnblogs.com/jiyuqi/p/7466263.html