我有一個圖形,它有一些具有數百萬條入射邊緣的節點,在Cassandra DB上使用Titan 0.5.2。例如。該再現這樣的圖表:從具有數百萬條邊的節點遍歷的超時
mgmt = g.getManagementSystem()
vidp = mgmt.makePropertyKey('vid').dataType(Integer.class).make()
mgmt.buildIndex('by_vid',Vertex.class).addKey(vidp).buildCompositeIndex()
mgmt.commit()
def v0 = g.addVertex([vid: 0, type: 'start'])
def random = new Random()
for(i in 1..10000000) {
def v = g.addVertex([vid: i, type: 'claim'])
v.addEdge('is-a', v0)
def n = random.nextInt(i)
def vr = g.V('vid', n).next()
v.addEdge('test', vr)
if (i%10000 == 0) { g.commit(); }
}
因此,我們有10M的頂點,所有鏈接到V0和與頂點之間的一些隨機的聯繫。此查詢:g.V('vid', 0).in('is-a')[0]
- 正常工作,g.V('vid', 0).in('is-a')[100]
或g.V('vid', 0).in('is-a')[1000]
也是如此。但是,如果我嘗試再經過 - 即g.V('vid', 0).in('is-a').out('test')[0]
- 然後查找卡住和卡桑德拉最終我得到讀超時異常:
com.thinkaurelius.titan.core.TitanException: Could not execute operation due to backend exception
Caused by: com.thinkaurelius.titan.diskstorage.TemporaryBackendException: Could not successfully complete backend operation due to repeated temporary exceptions after Duration[4000 ms]
at com.thinkaurelius.titan.diskstorage.util.BackendOperation.executeDirect(BackendOperation.java:86)
at com.thinkaurelius.titan.diskstorage.util.BackendOperation.execute(BackendOperation.java:42)
Caused by: com.netflix.astyanax.connectionpool.exceptions.TimeoutException: TimeoutException: [host=127.0.0.1(127.0.0.1):9160, latency=10000(10001), attempts=1]org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
at com.netflix.astyanax.thrift.ThriftConverter.ToConnectionPoolException(ThriftConverter.java:188)
at com.netflix.astyanax.thrift.ThriftSyncConnectionFactoryImpl$ThriftConnection.execute(ThriftSyncConnectionFactoryImpl.java:
我也得到卡桑德拉處理高負荷,它變得沒有反應(即,試圖連接到它返回超時)。所以,我的問題是,爲什麼不可能從這個節點進一步遍歷,即使實際上有很多節點的步驟很好 - 我怎樣才能使它工作?