Class RemoteMeta
- java.lang.Object
-
- org.apache.calcite.avatica.MetaImpl
-
- org.apache.calcite.avatica.remote.RemoteMeta
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.calcite.avatica.MetaImpl
MetaImpl.ColumnNoNulls, MetaImpl.ColumnNullable, MetaImpl.ColumnNullableUnknown, MetaImpl.MetaAttribute, MetaImpl.MetaBestRowIdentifier, MetaImpl.MetaCatalog, MetaImpl.MetaClientInfoProperty, MetaImpl.MetaColumn, MetaImpl.MetaColumnPrivilege, MetaImpl.MetaCrossReference, MetaImpl.MetaExportedKey, MetaImpl.MetaFunction, MetaImpl.MetaFunctionColumn, MetaImpl.MetaImportedKey, MetaImpl.MetaIndexInfo, MetaImpl.MetaPrimaryKey, MetaImpl.MetaProcedure, MetaImpl.MetaProcedureColumn, MetaImpl.MetaPseudoColumn, MetaImpl.MetaSchema, MetaImpl.MetaSuperTable, MetaImpl.MetaSuperType, MetaImpl.MetaTable, MetaImpl.MetaTablePrivilege, MetaImpl.MetaTableType, MetaImpl.MetaTypeInfo, MetaImpl.MetaUdt, MetaImpl.MetaVersionColumn, MetaImpl.Named
-
Nested classes/interfaces inherited from interface org.apache.calcite.avatica.Meta
Meta.ConnectionHandle, Meta.ConnectionProperties, Meta.CursorFactory, Meta.DatabaseProperty, Meta.ExecuteBatchResult, Meta.ExecuteResult, Meta.Factory, Meta.Frame, Meta.MetaResultSet, Meta.Pat, Meta.PrepareCallback, Meta.Signature, Meta.StatementHandle, Meta.StatementType, Meta.Style
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Meta.DatabaseProperty,java.lang.Object>databaseProperties(package private) java.util.Map<java.lang.String,ConnectionPropertiesImpl>propsMap(package private) Serviceservice-
Fields inherited from class org.apache.calcite.avatica.MetaImpl
connection, connProps
-
-
Constructor Summary
Constructors Constructor Description RemoteMeta(AvaticaConnection connection, Service service)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseConnection(Meta.ConnectionHandle ch)Closes a connectionvoidcloseStatement(Meta.StatementHandle h)Closes a statement.voidcommit(Meta.ConnectionHandle ch)Makes all changes since the last commit/rollback permanent.Meta.ConnectionPropertiesconnectionSync(Meta.ConnectionHandle ch, Meta.ConnectionProperties connProps)Synchronizes client and server view of connection properties.Meta.StatementHandlecreateStatement(Meta.ConnectionHandle ch)Called during the creation of a statement to allocate a new handle.Meta.ExecuteResultexecute(Meta.StatementHandle h, java.util.List<TypedValue> parameterValues, int maxRowsInFirstFrame)Executes a prepared statement.Meta.ExecuteResultexecute(Meta.StatementHandle h, java.util.List<TypedValue> parameterValues, long maxRowCount)Executes a prepared statement.Meta.ExecuteBatchResultexecuteBatch(Meta.StatementHandle h, java.util.List<java.util.List<TypedValue>> parameterValues)Executes a collection of bound parameter values on a prepared statement.Meta.Framefetch(Meta.StatementHandle h, long offset, int fetchMaxRowCount)Returns a frame of rows.Meta.MetaResultSetgetCatalogs(Meta.ConnectionHandle ch)PerDatabaseMetaData.getCatalogs().Meta.MetaResultSetgetColumns(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern)PerDatabaseMetaData.getColumns(String, String, String, String).java.util.Map<Meta.DatabaseProperty,java.lang.Object>getDatabaseProperties(Meta.ConnectionHandle ch)Returns a map of static database properties.Meta.MetaResultSetgetSchemas(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern)Meta.MetaResultSetgetTables(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, java.util.List<java.lang.String> typeList)PerDatabaseMetaData.getTables(String, String, String, String[]).Meta.MetaResultSetgetTableTypes(Meta.ConnectionHandle ch)PerDatabaseMetaData.getTableTypes().Meta.MetaResultSetgetTypeInfo(Meta.ConnectionHandle ch)PerDatabaseMetaData.getTypeInfo().voidopenConnection(Meta.ConnectionHandle ch, java.util.Map<java.lang.String,java.lang.String> info)Opens (creates) a connection.Meta.StatementHandleprepare(Meta.ConnectionHandle ch, java.lang.String sql, long maxRowCount)Prepares a statement.Meta.ExecuteResultprepareAndExecute(Meta.StatementHandle h, java.lang.String sql, long maxRowCount, int maxRowsInFirstFrame, Meta.PrepareCallback callback)Prepares and executes a statement.Meta.ExecuteResultprepareAndExecute(Meta.StatementHandle h, java.lang.String sql, long maxRowCount, Meta.PrepareCallback callback)Prepares and executes a statement.Meta.ExecuteBatchResultprepareAndExecuteBatch(Meta.StatementHandle h, java.util.List<java.lang.String> sqlCommands)Prepares a statement and then executes a number of SQL commands in one pass.voidrollback(Meta.ConnectionHandle ch)Undoes all changes since the last commit/rollback.booleansyncResults(Meta.StatementHandle h, QueryState state, long offset)Re-sets theResultSeton a Statement.private Meta.MetaResultSettoResultSet(java.lang.Class clazz, Service.ResultSetResponse response)-
Methods inherited from class org.apache.calcite.avatica.MetaImpl
checkParameterValueHasNull, collect, collect, columnMetaData, columnMetaData, columnMetaData, columnMetaData, createCursor, createEmptyResultSet, createIterable, createResultSet, fetch, fieldMetaData, getAttributes, getBestRowIdentifier, getClientInfoProperties, getColumnNullability, getColumnPrivileges, getCrossReference, getExportedKeys, getFunctionColumns, getFunctions, getImportedKeys, getIndexInfo, getPrimaryKeys, getProcedureColumns, getProcedures, getPseudoColumns, getSuperTables, getSuperTypes, getTablePrivileges, getUDTs, getVersionColumns
-
-
-
-
Field Detail
-
service
final Service service
-
propsMap
final java.util.Map<java.lang.String,ConnectionPropertiesImpl> propsMap
-
databaseProperties
private java.util.Map<Meta.DatabaseProperty,java.lang.Object> databaseProperties
-
-
Constructor Detail
-
RemoteMeta
RemoteMeta(AvaticaConnection connection, Service service)
-
-
Method Detail
-
toResultSet
private Meta.MetaResultSet toResultSet(java.lang.Class clazz, Service.ResultSetResponse response)
-
getDatabaseProperties
public java.util.Map<Meta.DatabaseProperty,java.lang.Object> getDatabaseProperties(Meta.ConnectionHandle ch)
Description copied from interface:MetaReturns a map of static database properties.The provider can omit properties whose value is the same as the default.
- Specified by:
getDatabasePropertiesin interfaceMeta- Overrides:
getDatabasePropertiesin classMetaImpl
-
createStatement
public Meta.StatementHandle createStatement(Meta.ConnectionHandle ch)
Description copied from interface:MetaCalled during the creation of a statement to allocate a new handle.- Specified by:
createStatementin interfaceMeta- Overrides:
createStatementin classMetaImpl- Parameters:
ch- Connection handle
-
closeStatement
public void closeStatement(Meta.StatementHandle h)
Description copied from interface:MetaCloses a statement.If the statement handle is not known, or is already closed, does nothing.
- Parameters:
h- Statement handle
-
openConnection
public void openConnection(Meta.ConnectionHandle ch, java.util.Map<java.lang.String,java.lang.String> info)
Description copied from interface:MetaOpens (creates) a connection. The client allocates its own connection ID which the server is then made aware of through theMeta.ConnectionHandle. The Mapinfoargument is analogous to thePropertiestypically passed to a "normal" JDBC Driver. Avatica specific properties should not be included -- only properties for the underlying driver.- Specified by:
openConnectionin interfaceMeta- Overrides:
openConnectionin classMetaImpl- Parameters:
ch- A ConnectionHandle encapsulates information about the connection to be opened as provided by the client.info- A Map corresponding to the Properties typically passed to a JDBC Driver.
-
closeConnection
public void closeConnection(Meta.ConnectionHandle ch)
Description copied from interface:MetaCloses a connection- Specified by:
closeConnectionin interfaceMeta- Overrides:
closeConnectionin classMetaImpl
-
connectionSync
public Meta.ConnectionProperties connectionSync(Meta.ConnectionHandle ch, Meta.ConnectionProperties connProps)
Description copied from interface:MetaSynchronizes client and server view of connection properties.Note: this interface is considered "experimental" and may undergo further changes as this functionality is extended to other aspects of state management for
Connection,Statement, andResultSet.- Specified by:
connectionSyncin interfaceMeta- Overrides:
connectionSyncin classMetaImpl
-
getCatalogs
public Meta.MetaResultSet getCatalogs(Meta.ConnectionHandle ch)
Description copied from interface:MetaPerDatabaseMetaData.getCatalogs().- Specified by:
getCatalogsin interfaceMeta- Overrides:
getCatalogsin classMetaImpl
-
getSchemas
public Meta.MetaResultSet getSchemas(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern)
- Specified by:
getSchemasin interfaceMeta- Overrides:
getSchemasin classMetaImpl
-
getTables
public Meta.MetaResultSet getTables(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, java.util.List<java.lang.String> typeList)
Description copied from interface:MetaPerDatabaseMetaData.getTables(String, String, String, String[]).
-
getTableTypes
public Meta.MetaResultSet getTableTypes(Meta.ConnectionHandle ch)
Description copied from interface:MetaPerDatabaseMetaData.getTableTypes().- Specified by:
getTableTypesin interfaceMeta- Overrides:
getTableTypesin classMetaImpl
-
getTypeInfo
public Meta.MetaResultSet getTypeInfo(Meta.ConnectionHandle ch)
Description copied from interface:MetaPerDatabaseMetaData.getTypeInfo().- Specified by:
getTypeInfoin interfaceMeta- Overrides:
getTypeInfoin classMetaImpl
-
getColumns
public Meta.MetaResultSet getColumns(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern)
Description copied from interface:MetaPerDatabaseMetaData.getColumns(String, String, String, String).- Specified by:
getColumnsin interfaceMeta- Overrides:
getColumnsin classMetaImpl
-
prepare
public Meta.StatementHandle prepare(Meta.ConnectionHandle ch, java.lang.String sql, long maxRowCount)
Description copied from interface:MetaPrepares a statement.- Parameters:
ch- Connection handlesql- SQL querymaxRowCount- Negative for no limit (different meaning than JDBC)- Returns:
- Signature of prepared statement
-
prepareAndExecute
public Meta.ExecuteResult prepareAndExecute(Meta.StatementHandle h, java.lang.String sql, long maxRowCount, Meta.PrepareCallback callback) throws NoSuchStatementException
Description copied from interface:MetaPrepares and executes a statement.- Parameters:
h- Statement handlesql- SQL querymaxRowCount- Negative for no limit (different meaning than JDBC)callback- Callback to lock, clear and assign cursor- Returns:
- Result containing statement ID, and if a query, a result set and first frame of data
- Throws:
NoSuchStatementException
-
prepareAndExecute
public Meta.ExecuteResult prepareAndExecute(Meta.StatementHandle h, java.lang.String sql, long maxRowCount, int maxRowsInFirstFrame, Meta.PrepareCallback callback) throws NoSuchStatementException
Description copied from interface:MetaPrepares and executes a statement.- Parameters:
h- Statement handlesql- SQL querymaxRowCount- Maximum number of rows for the entire query. Negative for no limit (different meaning than JDBC).maxRowsInFirstFrame- Maximum number of rows for the first frame. This value should always be less than or equal tomaxRowCountas the number of results are guaranteed to be restricted bymaxRowCountand the underlying database.callback- Callback to lock, clear and assign cursor- Returns:
- Result containing statement ID, and if a query, a result set and first frame of data
- Throws:
NoSuchStatementException
-
fetch
public Meta.Frame fetch(Meta.StatementHandle h, long offset, int fetchMaxRowCount) throws NoSuchStatementException, MissingResultsException
Description copied from interface:MetaReturns a frame of rows.The frame describes whether there may be another frame. If there is not another frame, the current iteration is done when we have finished the rows in the this frame.
The default implementation always returns null.
- Parameters:
h- Statement handleoffset- Zero-based offset of first row in the requested framefetchMaxRowCount- Maximum number of rows to return; negative means no limit- Returns:
- Frame, or null if there are no more
- Throws:
NoSuchStatementExceptionMissingResultsException
-
execute
public Meta.ExecuteResult execute(Meta.StatementHandle h, java.util.List<TypedValue> parameterValues, long maxRowCount) throws NoSuchStatementException
Description copied from interface:MetaExecutes a prepared statement.- Parameters:
h- Statement handleparameterValues- A list of parameter values; may be empty, not nullmaxRowCount- Maximum number of rows to return; negative means no limit- Returns:
- Execute result
- Throws:
NoSuchStatementException
-
execute
public Meta.ExecuteResult execute(Meta.StatementHandle h, java.util.List<TypedValue> parameterValues, int maxRowsInFirstFrame) throws NoSuchStatementException
Description copied from interface:MetaExecutes a prepared statement.- Parameters:
h- Statement handleparameterValues- A list of parameter values; may be empty, not nullmaxRowsInFirstFrame- Maximum number of rows to return in the Frame.- Returns:
- Execute result
- Throws:
NoSuchStatementException
-
syncResults
public boolean syncResults(Meta.StatementHandle h, QueryState state, long offset) throws NoSuchStatementException
Description copied from interface:MetaRe-sets theResultSeton a Statement. Not a JDBC method.- Returns:
- True if there are results to fetch after resetting to the given offset. False otherwise
- Throws:
NoSuchStatementException
-
commit
public void commit(Meta.ConnectionHandle ch)
Description copied from interface:MetaMakes all changes since the last commit/rollback permanent. Analogous toConnection.commit().- Parameters:
ch- A reference to the real JDBC Connection
-
rollback
public void rollback(Meta.ConnectionHandle ch)
Description copied from interface:MetaUndoes all changes since the last commit/rollback. Analogous toConnection.rollback();- Parameters:
ch- A reference to the real JDBC Connection
-
prepareAndExecuteBatch
public Meta.ExecuteBatchResult prepareAndExecuteBatch(Meta.StatementHandle h, java.util.List<java.lang.String> sqlCommands) throws NoSuchStatementException
Description copied from interface:MetaPrepares a statement and then executes a number of SQL commands in one pass.- Parameters:
h- Statement handlesqlCommands- SQL commands to run- Returns:
- An array of update counts containing one element for each command in the batch.
- Throws:
NoSuchStatementException
-
executeBatch
public Meta.ExecuteBatchResult executeBatch(Meta.StatementHandle h, java.util.List<java.util.List<TypedValue>> parameterValues) throws NoSuchStatementException
Description copied from interface:MetaExecutes a collection of bound parameter values on a prepared statement.- Parameters:
h- Statement handleparameterValues- A collection of list of typed values, one list per batch- Returns:
- An array of update counts containing one element for each command in the batch.
- Throws:
NoSuchStatementException
-
-