Commit eff6c6ef by Suma Shivaprasad

Removed individual index commits

parent 74726668
...@@ -40,10 +40,12 @@ public class GraphTransactionInterceptor implements MethodInterceptor { ...@@ -40,10 +40,12 @@ public class GraphTransactionInterceptor implements MethodInterceptor {
try { try {
Object response = invocation.proceed(); Object response = invocation.proceed();
titanGraph.commit(); titanGraph.commit();
titanGraph.getManagementSystem().commit();
LOG.debug("graph commit"); LOG.debug("graph commit");
return response; return response;
} catch (Throwable t){ } catch (Throwable t){
titanGraph.rollback(); titanGraph.rollback();
titanGraph.getManagementSystem().rollback();
LOG.debug("graph rollback"); LOG.debug("graph rollback");
throw t; throw t;
} }
......
...@@ -83,7 +83,6 @@ public class GraphBackedSearchIndexer implements SearchIndexer { ...@@ -83,7 +83,6 @@ public class GraphBackedSearchIndexer implements SearchIndexer {
.buildMixedIndex(Constants.BACKING_INDEX); .buildMixedIndex(Constants.BACKING_INDEX);
management.buildIndex(Constants.EDGE_INDEX, Edge.class) management.buildIndex(Constants.EDGE_INDEX, Edge.class)
.buildMixedIndex(Constants.BACKING_INDEX); .buildMixedIndex(Constants.BACKING_INDEX);
management.commit();
// create a composite index for guid as its unique // create a composite index for guid as its unique
createCompositeIndex(Constants.GUID_INDEX, createCompositeIndex(Constants.GUID_INDEX,
...@@ -119,7 +118,6 @@ public class GraphBackedSearchIndexer implements SearchIndexer { ...@@ -119,7 +118,6 @@ public class GraphBackedSearchIndexer implements SearchIndexer {
management.buildIndex(Constants.FULLTEXT_INDEX, Vertex.class) management.buildIndex(Constants.FULLTEXT_INDEX, Vertex.class)
.addKey(fullText, com.thinkaurelius.titan.core.schema.Parameter.of("mapping", Mapping.TEXT)) .addKey(fullText, com.thinkaurelius.titan.core.schema.Parameter.of("mapping", Mapping.TEXT))
.buildMixedIndex(Constants.BACKING_INDEX); .buildMixedIndex(Constants.BACKING_INDEX);
management.commit();
LOG.info("Created mixed index for {}", Constants.ENTITY_TEXT_PROPERTY_KEY); LOG.info("Created mixed index for {}", Constants.ENTITY_TEXT_PROPERTY_KEY);
} }
...@@ -302,8 +300,6 @@ public class GraphBackedSearchIndexer implements SearchIndexer { ...@@ -302,8 +300,6 @@ public class GraphBackedSearchIndexer implements SearchIndexer {
} }
indexBuilder.buildCompositeIndex(); indexBuilder.buildCompositeIndex();
management.commit();
LOG.info("Created index for property {} in composite index {}", propertyName, indexName); LOG.info("Created index for property {} in composite index {}", propertyName, indexName);
} }
...@@ -323,12 +319,10 @@ public class GraphBackedSearchIndexer implements SearchIndexer { ...@@ -323,12 +319,10 @@ public class GraphBackedSearchIndexer implements SearchIndexer {
if (propertyClass == Boolean.class) { if (propertyClass == Boolean.class) {
//Use standard index as backing index only supports string, int and geo types //Use standard index as backing index only supports string, int and geo types
management.buildIndex(propertyName, Vertex.class).addKey(propertyKey).buildCompositeIndex(); management.buildIndex(propertyName, Vertex.class).addKey(propertyKey).buildCompositeIndex();
management.commit();
} else { } else {
//Use backing index //Use backing index
TitanGraphIndex vertexIndex = management.getGraphIndex(Constants.VERTEX_INDEX); TitanGraphIndex vertexIndex = management.getGraphIndex(Constants.VERTEX_INDEX);
management.addIndexKey(vertexIndex, propertyKey); management.addIndexKey(vertexIndex, propertyKey);
management.commit();
} }
LOG.info("Created mixed vertex index for property {}", propertyName); LOG.info("Created mixed vertex index for property {}", propertyName);
} }
...@@ -343,7 +337,6 @@ public class GraphBackedSearchIndexer implements SearchIndexer { ...@@ -343,7 +337,6 @@ public class GraphBackedSearchIndexer implements SearchIndexer {
if (edgeLabel == null) { if (edgeLabel == null) {
edgeLabel = management.makeEdgeLabel(propertyName).make(); edgeLabel = management.makeEdgeLabel(propertyName).make();
management.buildEdgeIndex(edgeLabel, propertyName, Direction.BOTH, Order.DEFAULT); management.buildEdgeIndex(edgeLabel, propertyName, Direction.BOTH, Order.DEFAULT);
management.commit();
LOG.info("Created index for edge label {}", propertyName); LOG.info("Created index for edge label {}", propertyName);
} }
} */ } */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment