public void streamingWithLockBatchModeOn() { if (supportsBatchMode()) { readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.STREAMING_WITH_LOCK); } else { throw new IllegalStateException(BATCH_MODE_NOT_SUPPORTED); } }
public void normalBatchModeOn() { if (supportsBatchMode()) { readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.NORMAL); } else { throw new IllegalStateException(BATCH_MODE_NOT_SUPPORTED); } }
public BatchManager.BatchModeType getBatchModeType() { Preconditions.checkState(isOpen(), "SqlgTransaction.getBatchModeType() must be called within a transaction."); if (supportsBatchMode()) { return this.threadLocalTx.get().getBatchManager().getBatchModeType(); } else { return BatchManager.BatchModeType.NONE; } }
public void streamingBatchModeOn() { if (supportsBatchMode()) { readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.STREAMING); } else { throw new IllegalStateException(BATCH_MODE_NOT_SUPPORTED); } }
public BatchManager.BatchModeType getBatchModeType() { Preconditions.checkState(isOpen(), "SqlgTransaction.getBatchModeType() must be called within a transaction."); if (supportsBatchMode()) { return this.threadLocalTx.get().getBatchManager().getBatchModeType(); } else { return BatchManager.BatchModeType.NONE; } }
public void normalBatchModeOn() { if (supportsBatchMode()) { readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.NORMAL); } else { throw new IllegalStateException(BATCH_MODE_NOT_SUPPORTED); } }
public void streamingWithLockBatchModeOn() { if (supportsBatchMode()) { readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.STREAMING_WITH_LOCK); } else { throw new IllegalStateException(BATCH_MODE_NOT_SUPPORTED); } }
public void streamingBatchModeOn() { if (supportsBatchMode()) { readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.STREAMING); } else { throw new IllegalStateException(BATCH_MODE_NOT_SUPPORTED); } }
public boolean isInStreamingWithLockBatchMode() { return supportsBatchMode() && isOpen() && this.threadLocalTx.get().getBatchManager().isInStreamingModeWithLock(); }
public boolean isInStreamingBatchMode() { return supportsBatchMode() && isOpen() && this.threadLocalTx.get().getBatchManager().isInStreamingMode(); }
public boolean isInNormalBatchMode() { return supportsBatchMode() && isOpen() && this.threadLocalTx.get().getBatchManager().isInNormalMode(); }
public boolean isInNormalBatchMode() { return supportsBatchMode() && isOpen() && this.threadLocalTx.get().getBatchManager().isInNormalMode(); }
public boolean isInStreamingWithLockBatchMode() { return supportsBatchMode() && isOpen() && this.threadLocalTx.get().getBatchManager().isInStreamingModeWithLock(); }
public boolean isInStreamingBatchMode() { return supportsBatchMode() && isOpen() && this.threadLocalTx.get().getBatchManager().isInStreamingMode(); }
@SuppressWarnings("WeakerAccess") public boolean isInBatchMode() { return supportsBatchMode() && isInNormalBatchMode() || isInStreamingBatchMode() || isInStreamingWithLockBatchMode(); }
@SuppressWarnings("WeakerAccess") public boolean isInBatchMode() { return supportsBatchMode() && isInNormalBatchMode() || isInStreamingBatchMode() || isInStreamingWithLockBatchMode(); }
@Override protected void doOpen() { if (isOpen()) throw Transaction.Exceptions.transactionAlreadyOpen(); else { try { Connection connection = this.sqlgGraph.getConnection(); connection.setAutoCommit(false); if (this.sqlgGraph.getSqlDialect().supportsClientInfo()) { connection.setClientInfo("ApplicationName", Thread.currentThread().getName()); } // read default setting for laziness boolean lazy=this.sqlgGraph.getConfiguration().getBoolean(QUERY_LAZY,true); TransactionCache tc=null; if (supportsBatchMode()) { tc = TransactionCache.of(this.cacheVertices, connection, new BatchManager(this.sqlgGraph, ((SqlBulkDialect)this.sqlgGraph.getSqlDialect())),lazy); } else { tc = TransactionCache.of(this.cacheVertices, connection, lazy); } tc.setFetchSize(getDefaultFetchSize()); this.threadLocalTx.set(tc); } catch (SQLException e) { throw new RuntimeException(e); } } }
public void batchMode(BatchManager.BatchModeType batchModeType) { if (supportsBatchMode()) { switch (batchModeType) { case NONE: readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.NONE); break; case NORMAL: this.normalBatchModeOn(); break; case STREAMING: this.streamingBatchModeOn(); break; case STREAMING_WITH_LOCK: this.streamingWithLockBatchModeOn(); break; default: throw new IllegalStateException("unhandled BatchModeType " + batchModeType.name()); } } }
@Override protected void doOpen() { if (isOpen()) throw Transaction.Exceptions.transactionAlreadyOpen(); else { try { Connection connection = this.sqlgGraph.getConnection(); connection.setAutoCommit(false); if (this.sqlgGraph.getSqlDialect().supportsClientInfo()) { connection.setClientInfo("ApplicationName", Thread.currentThread().getName()); } // read default setting for laziness boolean lazy=this.sqlgGraph.getConfiguration().getBoolean(QUERY_LAZY,true); TransactionCache tc=null; if (supportsBatchMode()) { tc = TransactionCache.of(this.cacheVertices, connection, new BatchManager(this.sqlgGraph, ((SqlBulkDialect)this.sqlgGraph.getSqlDialect())),lazy); } else { tc = TransactionCache.of(this.cacheVertices, connection, lazy); } tc.setFetchSize(getDefaultFetchSize()); this.threadLocalTx.set(tc); } catch (SQLException e) { throw new RuntimeException(e); } } }
public void batchMode(BatchManager.BatchModeType batchModeType) { if (supportsBatchMode()) { switch (batchModeType) { case NONE: readWrite(); this.threadLocalTx.get().getBatchManager().batchModeOn(BatchManager.BatchModeType.NONE); break; case NORMAL: this.normalBatchModeOn(); break; case STREAMING: this.streamingBatchModeOn(); break; case STREAMING_WITH_LOCK: this.streamingWithLockBatchModeOn(); break; default: throw new IllegalStateException("unhandled BatchModeType " + batchModeType.name()); } } }