final TimestampProvider times = graph.getConfiguration().getTimestampProvider(); final Instant startTime = times.getTime(); clopen(option(SYSTEM_LOG_TRANSACTIONS), true , option(KCVSLog.LOG_READ_LAG_TIME, TRANSACTION_LOG), Duration.ofMillis(50) , option(LOG_READ_INTERVAL, TRANSACTION_LOG), Duration.ofMillis(250) , option(MAX_COMMIT_TIME), Duration.ofSeconds(1) , option(STORAGE_WRITE_WAITTIME), Duration.ofMillis(300) , option(TestMockIndexProvider.INDEX_BACKEND_PROXY, INDEX), readConfig.get(INDEX_BACKEND, INDEX) , option(INDEX_BACKEND, INDEX), TestMockIndexProvider.class.getName() , option(TestMockIndexProvider.INDEX_MOCK_FAILADD, INDEX), true );
private void setupChainGraph(int numV, String[] strs, boolean sameNameMapping) { clopen(option(INDEX_NAME_MAPPING, INDEX), sameNameMapping); TitanGraphIndex vindex = getExternalIndex(Vertex.class, INDEX); TitanGraphIndex eindex = getExternalIndex(Edge.class, INDEX); TitanGraphIndex pindex = getExternalIndex(TitanVertexProperty.class, INDEX); PropertyKey name = makeKey("name", String.class); mgmt.addIndexKey(vindex, name, getStringMapping()); mgmt.addIndexKey(eindex, name, getStringMapping()); mgmt.addIndexKey(pindex, name, getStringMapping(), Parameter.of("mapped-name", "xstr")); PropertyKey text = makeKey("text", String.class); mgmt.addIndexKey(vindex, text, getTextMapping(), Parameter.of("mapped-name", "xtext")); mgmt.addIndexKey(eindex, text, getTextMapping()); mgmt.addIndexKey(pindex, text, getTextMapping()); mgmt.makeEdgeLabel("knows").signature(name).make(); mgmt.makePropertyKey("uid").dataType(String.class).signature(text).make(); finishSchema(); TitanVertex previous = null; for (int i = 0; i < numV; i++) { TitanVertex v = graph.addVertex("name", strs[i % strs.length], "text", strs[i % strs.length]); Edge e = v.addEdge("knows", previous == null ? v : previous, "name", strs[i % strs.length], "text", strs[i % strs.length]); VertexProperty p = v.property("uid", "v" + i, "name", strs[i % strs.length], "text", strs[i % strs.length]); previous = v; } }
@Test public void testIndexUpdatesWithoutReindex() throws InterruptedException, ExecutionException { Object[] settings = new Object[]{option(LOG_SEND_DELAY, MANAGEMENT_LOG), Duration.ofMillis(0), option(KCVSLog.LOG_READ_LAG_TIME, MANAGEMENT_LOG), Duration.ofMillis(50), option(LOG_READ_INTERVAL, MANAGEMENT_LOG), Duration.ofMillis(250) };
final TimestampProvider times = graph.getConfiguration().getTimestampProvider(); final long startTime = times.getTime().getTimestamp(TimeUnit.MILLISECONDS); clopen( option(SYSTEM_LOG_TRANSACTIONS), true ,option(KCVSLog.LOG_READ_LAG_TIME,TRANSACTION_LOG),new StandardDuration(50,TimeUnit.MILLISECONDS) ,option(LOG_READ_INTERVAL,TRANSACTION_LOG),new StandardDuration(250,TimeUnit.MILLISECONDS) ,option(MAX_COMMIT_TIME),new StandardDuration(1,TimeUnit.SECONDS) ,option(STORAGE_WRITE_WAITTIME), new StandardDuration(300, TimeUnit.MILLISECONDS) ,option(TestMockIndexProvider.INDEX_BACKEND_PROXY,INDEX), adjustedConfig.get(INDEX_BACKEND,INDEX) ,option(INDEX_BACKEND,INDEX), TestMockIndexProvider.class.getName() ,option(TestMockIndexProvider.INDEX_MOCK_FAILADD,INDEX), true );
private void setupChainGraph(int numV, String[] strs, boolean sameNameMapping) { clopen(option(INDEX_NAME_MAPPING,INDEX),sameNameMapping); TitanGraphIndex vindex = getExternalIndex(Vertex.class,INDEX); TitanGraphIndex eindex = getExternalIndex(Edge.class,INDEX); TitanGraphIndex pindex = getExternalIndex(TitanProperty.class,INDEX); PropertyKey name = makeKey("name",String.class); mgmt.addIndexKey(vindex, name, getStringMapping()); mgmt.addIndexKey(eindex, name, getStringMapping()); mgmt.addIndexKey(pindex, name, getStringMapping(), Parameter.of("mapped-name", "xstr")); PropertyKey text = makeKey("text",String.class); mgmt.addIndexKey(vindex, text, getTextMapping(), Parameter.of("mapped-name","xtext")); mgmt.addIndexKey(eindex, text, getTextMapping()); mgmt.addIndexKey(pindex, text, getTextMapping()); mgmt.makeEdgeLabel("knows").signature(name).make(); mgmt.makePropertyKey("uid").dataType(String.class).signature(text).make(); finishSchema(); TitanVertex previous = null; for (int i=0;i<numV;i++) { TitanVertex v = graph.addVertex(null); v.setProperty("name",strs[i%strs.length]); v.setProperty("text",strs[i%strs.length]); TitanEdge e = v.addEdge("knows",previous==null?v:previous); e.setProperty("name",strs[i%strs.length]); e.setProperty("text",strs[i%strs.length]); TitanProperty p = v.addProperty("uid","v"+i); p.setProperty("name", strs[i % strs.length]); p.setProperty("text", strs[i % strs.length]); previous=v; } }
@Test public void testIndexUpdatesWithoutReindex() throws InterruptedException { Object[] settings = new Object[]{option(LOG_SEND_DELAY,MANAGEMENT_LOG),new StandardDuration(0, TimeUnit.MILLISECONDS), option(KCVSLog.LOG_READ_LAG_TIME,MANAGEMENT_LOG),new StandardDuration(50,TimeUnit.MILLISECONDS), option(LOG_READ_INTERVAL,MANAGEMENT_LOG),new StandardDuration(250,TimeUnit.MILLISECONDS) };