public final class ClientService extends ReentrantLock
GFXDService.Client
thrift transport to add exception handling, connection pooling, failover and
single-hop.
This class is NOT THREAD-SAFE and only one thread should be using an instance of this class at a time (or use synchronization at higher layers).
| Constructor and Description |
|---|
ClientService(String host,
int port,
com.pivotal.gemfirexd.thrift.OpenConnectionArgs connArgs) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginTransaction(int jdbcIsolationLevel,
Map<com.pivotal.gemfirexd.thrift.TransactionAttribute,Boolean> flags) |
boolean |
bulkClose(HostConnection thisSource,
List<com.pivotal.gemfirexd.thrift.EntityId> entities,
List<ClientService> closeServices,
long lockTimeoutMillis) |
void |
cancelStatement(HostConnection source,
int stmtId) |
boolean |
closeConnection(long lockTimeoutMillis) |
boolean |
closeResultSet(HostConnection source,
int cursorId,
long lockTimeoutMillis) |
boolean |
closeStatement(HostConnection source,
int stmtId,
long lockTimeoutMillis) |
void |
commitTransaction(HostConnection source,
boolean startNewTransaction,
Map<com.pivotal.gemfirexd.thrift.TransactionAttribute,Boolean> flags) |
com.pivotal.gemfirexd.thrift.StatementResult |
execute(String sql,
Map<Integer,com.pivotal.gemfirexd.thrift.OutputParameter> outputParams,
com.pivotal.gemfirexd.thrift.StatementAttrs attrs) |
void |
executeCursorUpdate(HostConnection source,
int cursorId,
byte operation,
com.pivotal.gemfirexd.thrift.Row changedRow,
List<Integer> changedColumns,
int changedRowIndex) |
void |
executeCursorUpdate(HostConnection source,
int cursorId,
List<Byte> operations,
List<com.pivotal.gemfirexd.thrift.Row> changedRows,
List<List<Integer>> changedColumnsList,
List<Integer> changedRowIndexes) |
com.pivotal.gemfirexd.thrift.StatementResult |
executePrepared(HostConnection source,
int stmtId,
com.pivotal.gemfirexd.thrift.Row params,
Map<Integer,com.pivotal.gemfirexd.thrift.OutputParameter> outputParams,
com.pivotal.gemfirexd.thrift.common.PrepareResultHolder prh) |
com.pivotal.gemfirexd.thrift.UpdateResult |
executePreparedBatch(HostConnection source,
int stmtId,
List<com.pivotal.gemfirexd.thrift.Row> paramsBatch,
com.pivotal.gemfirexd.thrift.common.PrepareResultHolder prh) |
com.pivotal.gemfirexd.thrift.RowSet |
executePreparedQuery(HostConnection source,
int stmtId,
com.pivotal.gemfirexd.thrift.Row params,
com.pivotal.gemfirexd.thrift.common.PrepareResultHolder prh) |
com.pivotal.gemfirexd.thrift.UpdateResult |
executePreparedUpdate(HostConnection source,
int stmtId,
com.pivotal.gemfirexd.thrift.Row params,
com.pivotal.gemfirexd.thrift.common.PrepareResultHolder prh) |
com.pivotal.gemfirexd.thrift.RowSet |
executeQuery(String sql,
com.pivotal.gemfirexd.thrift.StatementAttrs attrs) |
com.pivotal.gemfirexd.thrift.UpdateResult |
executeUpdate(List<String> sqls,
com.pivotal.gemfirexd.thrift.StatementAttrs attrs) |
List<com.pivotal.gemfirexd.thrift.ConnectionProperties> |
fetchActiveConnections() |
Map<Integer,String> |
fetchActiveStatements() |
boolean |
freeLob(HostConnection source,
int lobId,
long lockTimeoutMillis) |
com.pivotal.gemfirexd.thrift.RowSet |
getBestRowIdentifier(com.pivotal.gemfirexd.thrift.ServiceMetaDataArgs metadataArgs,
int scope,
boolean nullable) |
com.pivotal.gemfirexd.thrift.BlobChunk |
getBlobChunk(HostConnection source,
int lobId,
long offset,
int chunkSize,
boolean freeLobAtEnd) |
com.pivotal.gemfirexd.thrift.ClobChunk |
getClobChunk(HostConnection source,
int lobId,
long offset,
int chunkSize,
boolean freeLobAtEnd) |
com.pivotal.gemfirexd.thrift.RowSet |
getIndexInfo(com.pivotal.gemfirexd.thrift.ServiceMetaDataArgs metadataArgs,
boolean unique,
boolean approximate) |
static org.slf4j.Logger |
getLogger() |
com.pivotal.gemfirexd.thrift.RowSet |
getNextResultSet(HostConnection source,
int cursorId,
byte otherResultSetBehaviour) |
com.pivotal.gemfirexd.thrift.RowSet |
getSchemaMetaData(com.pivotal.gemfirexd.thrift.ServiceMetaDataCall schemaCall,
com.pivotal.gemfirexd.thrift.ServiceMetaDataArgs metadataArgs) |
com.pivotal.gemfirexd.thrift.ServiceMetaData |
getServiceMetaData() |
com.pivotal.gemfirexd.thrift.RowSet |
getUDTs(com.pivotal.gemfirexd.thrift.ServiceMetaDataArgs metadataArgs,
List<com.pivotal.gemfirexd.thrift.GFXDType> types) |
protected Set<com.pivotal.gemfirexd.thrift.HostAddress> |
handleException(Throwable t,
Set<com.pivotal.gemfirexd.thrift.HostAddress> failedServers,
boolean tryFailover,
boolean createNewConnection,
String op) |
com.pivotal.gemfirexd.thrift.StatementResult |
prepareAndExecute(String sql,
List<com.pivotal.gemfirexd.thrift.Row> paramsBatch,
Map<Integer,com.pivotal.gemfirexd.thrift.OutputParameter> outputParams,
com.pivotal.gemfirexd.thrift.StatementAttrs attrs) |
boolean |
prepareCommitTransaction(HostConnection source,
Map<com.pivotal.gemfirexd.thrift.TransactionAttribute,Boolean> flags) |
com.pivotal.gemfirexd.thrift.PrepareResult |
prepareStatement(String sql,
Map<Integer,com.pivotal.gemfirexd.thrift.OutputParameter> outputParams,
com.pivotal.gemfirexd.thrift.StatementAttrs attrs) |
void |
rollbackTransaction(HostConnection source,
boolean startNewTransaction,
Map<com.pivotal.gemfirexd.thrift.TransactionAttribute,Boolean> flags) |
com.pivotal.gemfirexd.thrift.RowSet |
scrollCursor(HostConnection source,
int cursorId,
int offset,
boolean offsetIsAbsolute,
boolean fetchReverseForAbsolute,
int fetchSize) |
int |
sendBlobChunk(HostConnection source,
com.pivotal.gemfirexd.thrift.BlobChunk chunk) |
int |
sendClobChunk(HostConnection source,
com.pivotal.gemfirexd.thrift.ClobChunk chunk) |
static void |
setLogger(org.slf4j.Logger log) |
void |
setTransactionAttributes(Map<com.pivotal.gemfirexd.thrift.TransactionAttribute,Boolean> flags) |
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlockpublic ClientService(String host, int port, com.pivotal.gemfirexd.thrift.OpenConnectionArgs connArgs) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic static org.slf4j.Logger getLogger()
public static void setLogger(org.slf4j.Logger log)
protected Set<com.pivotal.gemfirexd.thrift.HostAddress> handleException(Throwable t, Set<com.pivotal.gemfirexd.thrift.HostAddress> failedServers, boolean tryFailover, boolean createNewConnection, String op) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.StatementResult execute(String sql, Map<Integer,com.pivotal.gemfirexd.thrift.OutputParameter> outputParams, com.pivotal.gemfirexd.thrift.StatementAttrs attrs) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.UpdateResult executeUpdate(List<String> sqls, com.pivotal.gemfirexd.thrift.StatementAttrs attrs) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.RowSet executeQuery(String sql, com.pivotal.gemfirexd.thrift.StatementAttrs attrs) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.PrepareResult prepareStatement(String sql, Map<Integer,com.pivotal.gemfirexd.thrift.OutputParameter> outputParams, com.pivotal.gemfirexd.thrift.StatementAttrs attrs) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.StatementResult executePrepared(HostConnection source, int stmtId, com.pivotal.gemfirexd.thrift.Row params, Map<Integer,com.pivotal.gemfirexd.thrift.OutputParameter> outputParams, com.pivotal.gemfirexd.thrift.common.PrepareResultHolder prh) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.UpdateResult executePreparedUpdate(HostConnection source, int stmtId, com.pivotal.gemfirexd.thrift.Row params, com.pivotal.gemfirexd.thrift.common.PrepareResultHolder prh) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.RowSet executePreparedQuery(HostConnection source, int stmtId, com.pivotal.gemfirexd.thrift.Row params, com.pivotal.gemfirexd.thrift.common.PrepareResultHolder prh) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.UpdateResult executePreparedBatch(HostConnection source, int stmtId, List<com.pivotal.gemfirexd.thrift.Row> paramsBatch, com.pivotal.gemfirexd.thrift.common.PrepareResultHolder prh) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.StatementResult prepareAndExecute(String sql, List<com.pivotal.gemfirexd.thrift.Row> paramsBatch, Map<Integer,com.pivotal.gemfirexd.thrift.OutputParameter> outputParams, com.pivotal.gemfirexd.thrift.StatementAttrs attrs) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic void beginTransaction(int jdbcIsolationLevel,
Map<com.pivotal.gemfirexd.thrift.TransactionAttribute,Boolean> flags)
throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic void setTransactionAttributes(Map<com.pivotal.gemfirexd.thrift.TransactionAttribute,Boolean> flags) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic void commitTransaction(HostConnection source, boolean startNewTransaction, Map<com.pivotal.gemfirexd.thrift.TransactionAttribute,Boolean> flags) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic void rollbackTransaction(HostConnection source, boolean startNewTransaction, Map<com.pivotal.gemfirexd.thrift.TransactionAttribute,Boolean> flags) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic boolean prepareCommitTransaction(HostConnection source, Map<com.pivotal.gemfirexd.thrift.TransactionAttribute,Boolean> flags) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.RowSet getNextResultSet(HostConnection source, int cursorId, byte otherResultSetBehaviour) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.BlobChunk getBlobChunk(HostConnection source, int lobId, long offset, int chunkSize, boolean freeLobAtEnd) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.ClobChunk getClobChunk(HostConnection source, int lobId, long offset, int chunkSize, boolean freeLobAtEnd) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic int sendBlobChunk(HostConnection source, com.pivotal.gemfirexd.thrift.BlobChunk chunk) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic int sendClobChunk(HostConnection source, com.pivotal.gemfirexd.thrift.ClobChunk chunk) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic boolean freeLob(HostConnection source, int lobId, long lockTimeoutMillis) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.RowSet scrollCursor(HostConnection source, int cursorId, int offset, boolean offsetIsAbsolute, boolean fetchReverseForAbsolute, int fetchSize) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic void executeCursorUpdate(HostConnection source, int cursorId, List<Byte> operations, List<com.pivotal.gemfirexd.thrift.Row> changedRows, List<List<Integer>> changedColumnsList, List<Integer> changedRowIndexes) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic void executeCursorUpdate(HostConnection source, int cursorId, byte operation, com.pivotal.gemfirexd.thrift.Row changedRow, List<Integer> changedColumns, int changedRowIndex) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.ServiceMetaData getServiceMetaData()
throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.RowSet getSchemaMetaData(com.pivotal.gemfirexd.thrift.ServiceMetaDataCall schemaCall,
com.pivotal.gemfirexd.thrift.ServiceMetaDataArgs metadataArgs)
throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.RowSet getIndexInfo(com.pivotal.gemfirexd.thrift.ServiceMetaDataArgs metadataArgs,
boolean unique,
boolean approximate)
throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.RowSet getUDTs(com.pivotal.gemfirexd.thrift.ServiceMetaDataArgs metadataArgs,
List<com.pivotal.gemfirexd.thrift.GFXDType> types)
throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic com.pivotal.gemfirexd.thrift.RowSet getBestRowIdentifier(com.pivotal.gemfirexd.thrift.ServiceMetaDataArgs metadataArgs,
int scope,
boolean nullable)
throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic List<com.pivotal.gemfirexd.thrift.ConnectionProperties> fetchActiveConnections() throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic Map<Integer,String> fetchActiveStatements() throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic void cancelStatement(HostConnection source, int stmtId) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic boolean closeResultSet(HostConnection source, int cursorId, long lockTimeoutMillis) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic boolean closeStatement(HostConnection source, int stmtId, long lockTimeoutMillis) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic boolean closeConnection(long lockTimeoutMillis)
throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionpublic boolean bulkClose(HostConnection thisSource, List<com.pivotal.gemfirexd.thrift.EntityId> entities, List<ClientService> closeServices, long lockTimeoutMillis) throws com.pivotal.gemfirexd.thrift.GFXDException
com.pivotal.gemfirexd.thrift.GFXDExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.