Class SqlClientContext
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.SqlClientContext
-
- All Implemented Interfaces:
AutoCloseable
public class SqlClientContext extends Object implements AutoCloseable
Container for connection properties passed by various drivers (JDBC, ODBC drivers) having notion of an SQL connection - Ignite basically does not have one.Also contains anything that a driver may need to share between threads processing queries of logically same client - see JDBC thin driver
-
-
Constructor Summary
Constructors Constructor Description SqlClientContext(GridKernalContext ctx, javax.cache.configuration.Factory<GridWorker> orderedBatchWorkerFactory, boolean distributedJoins, boolean enforceJoinOrder, boolean collocated, boolean replicatedOnly, boolean lazy, boolean skipReducerOnUpdate, @Nullable Boolean dataPageScanEnabled, @Nullable Integer updateBatchSize, @Nullable String qryEngine, @Nullable TransactionConcurrency concurrency, @Nullable TransactionIsolation isolation, long timeout, @Nullable String lb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()TransactionConcurrencyconcurrency()@Nullable BooleandataPageScanEnabled()voiddisableStreaming()Turn off streaming on this client context - with closing all open streamers, if any.voidenableStreaming(boolean allowOverwrite, long flushFreq, int perNodeBufSize, int perNodeParOps, boolean ordered)Turn on streaming on this client context.booleanisCollocated()booleanisDistributedJoins()booleanisEnforceJoinOrder()booleanisLazy()@Nullable TransactionIsolationisolation()booleanisReplicatedOnly()booleanisSkipReducerOnUpdate()booleanisStream()booleanisStreamOrdered()voidorderedRequestProcessed()@Nullable StringqueryEngine()IgniteDataStreamer<?,?>streamerForCache(String cacheName)StringtransactionLabel()longtransactionTimeout()voidtxParameters(TransactionConcurrency concurrency, @Nullable TransactionIsolation isolation, long timeout, String lb)Sets transaction parameters.@Nullable IntegerupdateBatchSize()voidwaitTotalProcessedOrderedRequests(long total)Waits when total processed ordered requests count to be equal to specified value.
-
-
-
Constructor Detail
-
SqlClientContext
public SqlClientContext(GridKernalContext ctx, javax.cache.configuration.Factory<GridWorker> orderedBatchWorkerFactory, boolean distributedJoins, boolean enforceJoinOrder, boolean collocated, boolean replicatedOnly, boolean lazy, boolean skipReducerOnUpdate, @Nullable @Nullable Boolean dataPageScanEnabled, @Nullable @Nullable Integer updateBatchSize, @Nullable @Nullable String qryEngine, @Nullable @Nullable TransactionConcurrency concurrency, @Nullable @Nullable TransactionIsolation isolation, long timeout, @Nullable @Nullable String lb)
- Parameters:
ctx- Kernal context.orderedBatchWorkerFactory- Ordered batch worker factory.distributedJoins- Distributed joins flag.enforceJoinOrder- Enforce join order flag.collocated- Collocated flag.replicatedOnly- Replicated caches only flag.lazy- Lazy query execution flag.skipReducerOnUpdate- Skip reducer on update flag.dataPageScanEnabled- Enable scan data page mode.updateBatchSize- Size of internal batch for DML queries.qryEngine- Name of the SQL engine to use.concurrency- Transaction concurrency.isolation- Transaction isolation.timeout- Transaction timeout.lb- Transaction label.
-
-
Method Detail
-
enableStreaming
public void enableStreaming(boolean allowOverwrite, long flushFreq, int perNodeBufSize, int perNodeParOps, boolean ordered)Turn on streaming on this client context.- Parameters:
allowOverwrite- Whether streaming should overwrite existing values.flushFreq- Flush frequency for streamers.perNodeBufSize- Per node streaming buffer size.perNodeParOps- Per node streaming parallel operations number.ordered- Ordered stream flag.
-
disableStreaming
public void disableStreaming()
Turn off streaming on this client context - with closing all open streamers, if any.
-
isCollocated
public boolean isCollocated()
- Returns:
- Collocated flag.
-
isDistributedJoins
public boolean isDistributedJoins()
- Returns:
- Distributed joins flag.
-
isEnforceJoinOrder
public boolean isEnforceJoinOrder()
- Returns:
- Enforce join order flag.
-
isReplicatedOnly
public boolean isReplicatedOnly()
- Returns:
- Replicated caches only flag.
-
isLazy
public boolean isLazy()
- Returns:
- Lazy query execution flag.
-
isSkipReducerOnUpdate
public boolean isSkipReducerOnUpdate()
- Returns:
- Skip reducer on update flag,
-
dataPageScanEnabled
@Nullable public @Nullable Boolean dataPageScanEnabled()
- Returns:
- Data page scan flag or
nullif not set.
-
updateBatchSize
@Nullable public @Nullable Integer updateBatchSize()
- Returns:
- Update internal batch size.
-
queryEngine
@Nullable public @Nullable String queryEngine()
- Returns:
- Name of the SQL query engine to use.
-
isStream
public boolean isStream()
- Returns:
- Streaming state flag (on or off).
-
isStreamOrdered
public boolean isStreamOrdered()
- Returns:
- Stream ordered flag.
-
streamerForCache
public IgniteDataStreamer<?,?> streamerForCache(String cacheName)
- Parameters:
cacheName- Cache name.- Returns:
- Streamer for given cache.
-
waitTotalProcessedOrderedRequests
public void waitTotalProcessedOrderedRequests(long total)
Waits when total processed ordered requests count to be equal to specified value.- Parameters:
total- Expected total processed request.
-
orderedRequestProcessed
public void orderedRequestProcessed()
-
txParameters
public void txParameters(TransactionConcurrency concurrency, @Nullable @Nullable TransactionIsolation isolation, long timeout, String lb)
Sets transaction parameters.- Parameters:
concurrency- Transaction concurrency.isolation- Transaction isolation.timeout- Transaction timeout.lb- Transaction label.
-
concurrency
public TransactionConcurrency concurrency()
-
isolation
@Nullable public @Nullable TransactionIsolation isolation()
-
transactionTimeout
public long transactionTimeout()
-
transactionLabel
public String transactionLabel()
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-