if (sqlgGraph.features().supportsBatchMode() && sqlgGraph.tx().isInNormalBatchMode()) { sqlgGraph.tx().flush();
if (sqlgGraph.features().supportsBatchMode() && sqlgGraph.tx().isInNormalBatchMode()) { sqlgGraph.tx().flush();
if (sqlgGraph.features().supportsBatchMode() && sqlgGraph.tx().isInNormalBatchMode()) { sqlgGraph.tx().flush();
if (sqlgGraph.features().supportsBatchMode() && sqlgGraph.tx().isInNormalBatchMode()) { sqlgGraph.tx().flush();
void apply() { final Step<?, ?> startStep = traversal.getStartStep(); if (!(startStep instanceof GraphStep)) { return; } final GraphStep originalGraphStep = (GraphStep) startStep; if (this.sqlgGraph.features().supportsBatchMode() && this.sqlgGraph.tx().isInNormalBatchMode()) { this.sqlgGraph.tx().flush(); } if (originalGraphStep.getIds().length > 0) { Object id = originalGraphStep.getIds()[0]; if (id != null) { Class clazz = id.getClass(); //noinspection unchecked if (!Stream.of(originalGraphStep.getIds()).allMatch(i -> clazz.isAssignableFrom(i.getClass()))) throw Graph.Exceptions.idArgsMustBeEitherIdOrElement(); } } if (this.canNotBeOptimized()) { logger.debug("gremlin not optimized due to path or tree step. " + this.traversal.toString() + "\nPath to gremlin:\n" + ExceptionUtils.getStackTrace(new Throwable())); return; } combineSteps(); }
void apply() { final Step<?, ?> startStep = traversal.getStartStep(); if (!(startStep instanceof GraphStep)) { return; } final GraphStep originalGraphStep = (GraphStep) startStep; if (this.sqlgGraph.features().supportsBatchMode() && this.sqlgGraph.tx().isInNormalBatchMode()) { this.sqlgGraph.tx().flush(); } if (originalGraphStep.getIds().length > 0) { Object id = originalGraphStep.getIds()[0]; if (id != null) { Class clazz = id.getClass(); //noinspection unchecked if (!Stream.of(originalGraphStep.getIds()).allMatch(i -> clazz.isAssignableFrom(i.getClass()))) throw Graph.Exceptions.idArgsMustBeEitherIdOrElement(); } } if (this.canNotBeOptimized()) { logger.debug("gremlin not optimized due to path or tree step. " + this.traversal.toString() + "\nPath to gremlin:\n" + ExceptionUtils.getStackTrace(new Throwable())); return; } combineSteps(); }
public void apply() { //Only optimize graph step. if (!(traversal.getGraph().orElseThrow(IllegalStateException::new) instanceof SqlgGraph)) { return; } if (!SqlgTraversalUtil.mayOptimize(traversal)) { return; } if (this.sqlgGraph.features().supportsBatchMode() && this.sqlgGraph.tx().isInNormalBatchMode()) { this.sqlgGraph.tx().flush(); } if (this.canNotBeOptimized()) { logger.debug("gremlin not optimized due to path or tree step. " + this.traversal.toString() + "\nPath to gremlin:\n" + ExceptionUtils.getStackTrace(new Throwable())); return; } combineSteps(); }
public void apply() { //Only optimize graph step. if (!(traversal.getGraph().orElseThrow(IllegalStateException::new) instanceof SqlgGraph)) { return; } if (!SqlgTraversalUtil.mayOptimize(traversal)) { return; } if (this.sqlgGraph.features().supportsBatchMode() && this.sqlgGraph.tx().isInNormalBatchMode()) { this.sqlgGraph.tx().flush(); } if (this.canNotBeOptimized()) { logger.debug("gremlin not optimized due to path or tree step. " + this.traversal.toString() + "\nPath to gremlin:\n" + ExceptionUtils.getStackTrace(new Throwable())); return; } combineSteps(); }
@Override public boolean supportsBatchMode() { return this.sqlG.features().supportsBatchMode(); }
@Override public boolean equals(final Object object) { this.sqlgGraph.tx().readWrite(); if (this.sqlgGraph.features().supportsBatchMode() && this.sqlgGraph.tx().isInBatchMode()) { if (this.id() != null && (object instanceof SqlgElement) && ((SqlgElement) object).id() != null) { return ElementHelper.areEqual(this, object); } else { return super.equals(object); } } else { return ElementHelper.areEqual(this, object); } }
@Override public boolean equals(final Object object) { this.sqlgGraph.tx().readWrite(); if (this.sqlgGraph.features().supportsBatchMode() && this.sqlgGraph.tx().isInBatchMode()) { if (this.id() != null && (object instanceof SqlgElement) && ((SqlgElement) object).id() != null) { return ElementHelper.areEqual(this, object); } else { return super.equals(object); } } else { return ElementHelper.areEqual(this, object); } }
private void insertEdge(boolean complete, Pair<Map<String, Object>, Map<String, Object>> keyValueMapPair) throws SQLException { Map<String, Object> allKeyValueMap = keyValueMapPair.getLeft(); Map<String, Object> notNullKeyValueMap = keyValueMapPair.getRight(); if (this.sqlgGraph.features().supportsBatchMode() && this.sqlgGraph.tx().isInBatchMode()) { internalBatchAddEdge(complete, allKeyValueMap); } else { internalAddEdge(notNullKeyValueMap); } //Cache the properties this.properties.putAll(notNullKeyValueMap); }
@Override public int hashCode() { if (this.id() != null) { return id().hashCode(); } if (this.sqlgGraph.features().supportsBatchMode() && this.sqlgGraph.tx().isInBatchMode()) { return super.hashCode(); } else { return id().hashCode(); } }
private void insertEdge(boolean complete, Pair<Map<String, Object>, Map<String, Object>> keyValueMapPair) throws SQLException { Map<String, Object> allKeyValueMap = keyValueMapPair.getLeft(); Map<String, Object> notNullKeyValueMap = keyValueMapPair.getRight(); if (this.sqlgGraph.features().supportsBatchMode() && this.sqlgGraph.tx().isInBatchMode()) { internalBatchAddEdge(complete, allKeyValueMap); } else { internalAddEdge(notNullKeyValueMap); } //Cache the properties this.properties.putAll(notNullKeyValueMap); }
@Override public int hashCode() { if (this.id() != null) { return id().hashCode(); } if (this.sqlgGraph.features().supportsBatchMode() && this.sqlgGraph.tx().isInBatchMode()) { return super.hashCode(); } else { return id().hashCode(); } }