Class AbstractTableManager<K,V>
- java.lang.Object
-
- org.infinispan.persistence.jdbc.common.sql.BaseTableOperations<K,V>
-
- org.infinispan.persistence.jdbc.impl.table.AbstractTableManager<K,V>
-
- All Implemented Interfaces:
org.infinispan.persistence.jdbc.common.TableOperations<K,V>,TableManager<K,V>
public abstract class AbstractTableManager<K,V> extends org.infinispan.persistence.jdbc.common.sql.BaseTableOperations<K,V> implements TableManager<K,V>
- Author:
- Ryan Emerson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractTableManager.MetadataImpl-
Nested classes/interfaces inherited from class org.infinispan.persistence.jdbc.common.sql.BaseTableOperations
org.infinispan.persistence.jdbc.common.sql.BaseTableOperations.FlowableConnection, org.infinispan.persistence.jdbc.common.sql.BaseTableOperations.ResultSetEntryIterator
-
Nested classes/interfaces inherited from interface org.infinispan.persistence.jdbc.impl.table.TableManager
TableManager.Metadata
-
-
Field Summary
Fields Modifier and Type Field Description protected TableManipulationConfigurationconfigprotected org.infinispan.persistence.jdbc.common.connectionfactory.ConnectionFactoryconnectionFactoryprotected org.infinispan.persistence.spi.InitializationContextctxprotected TableNamedataTableNameprotected DbMetaDatadbMetadataprotected StringidentifierQuoteStringprotected JdbcStringBasedStoreConfigurationjdbcConfigprotected org.infinispan.persistence.keymappers.Key2StringMapperkey2StringMapperprotected org.infinispan.persistence.spi.MarshallableEntryFactory<K,V>marshallableEntryFactoryprotected org.infinispan.marshall.persistence.PersistenceMarshallermarshallerprotected AbstractTableManager.MetadataImplmetadataprotected TableNamemetaTableNameprotected StringsegmentIndexExtprotected StringtimestampIndexExt-
Fields inherited from class org.infinispan.persistence.jdbc.common.sql.BaseTableOperations
fetchSize, readQueryTimeout, writeQueryTimeout
-
Fields inherited from interface org.infinispan.persistence.jdbc.impl.table.TableManager
DEFAULT_FETCH_SIZE
-
-
Method Summary
-
Methods inherited from class org.infinispan.persistence.jdbc.common.sql.BaseTableOperations
batchUpdates, deleteAllRows, deleteEntry, loadEntry, publishEntries, size
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.persistence.jdbc.impl.table.TableManager
dropTables, metaTableExists
-
-
-
-
Field Detail
-
ctx
protected final org.infinispan.persistence.spi.InitializationContext ctx
-
connectionFactory
protected final org.infinispan.persistence.jdbc.common.connectionfactory.ConnectionFactory connectionFactory
-
jdbcConfig
protected final JdbcStringBasedStoreConfiguration jdbcConfig
-
config
protected final TableManipulationConfiguration config
-
marshaller
protected final org.infinispan.marshall.persistence.PersistenceMarshaller marshaller
-
marshallableEntryFactory
protected final org.infinispan.persistence.spi.MarshallableEntryFactory<K,V> marshallableEntryFactory
-
timestampIndexExt
protected final String timestampIndexExt
- See Also:
- Constant Field Values
-
segmentIndexExt
protected final String segmentIndexExt
- See Also:
- Constant Field Values
-
identifierQuoteString
protected final String identifierQuoteString
-
dbMetadata
protected final DbMetaData dbMetadata
-
dataTableName
protected final TableName dataTableName
-
metaTableName
protected final TableName metaTableName
-
metadata
protected AbstractTableManager.MetadataImpl metadata
-
key2StringMapper
protected org.infinispan.persistence.keymappers.Key2StringMapper key2StringMapper
-
-
Method Detail
-
start
public void start() throws org.infinispan.persistence.spi.PersistenceException- Specified by:
startin interfaceTableManager<K,V>- Throws:
org.infinispan.persistence.spi.PersistenceException
-
stop
public void stop() throws org.infinispan.persistence.spi.PersistenceException- Specified by:
stopin interfaceTableManager<K,V>- Throws:
org.infinispan.persistence.spi.PersistenceException
-
tableExists
public boolean tableExists(Connection connection, TableName tableName)
- Specified by:
tableExistsin interfaceTableManager<K,V>
-
createMetaTable
public void createMetaTable(Connection conn) throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
createMetaTablein interfaceTableManager<K,V>- Throws:
org.infinispan.persistence.spi.PersistenceException
-
updateMetaTable
public void updateMetaTable(Connection conn) throws org.infinispan.persistence.spi.PersistenceException
Description copied from interface:TableManagerWrite the latest metadata to the meta table.- Specified by:
updateMetaTablein interfaceTableManager<K,V>- Throws:
org.infinispan.persistence.spi.PersistenceException
-
getMetadata
public TableManager.Metadata getMetadata(Connection connection) throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
getMetadatain interfaceTableManager<K,V>- Throws:
org.infinispan.persistence.spi.PersistenceException
-
createDataTable
public void createDataTable(Connection conn) throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
createDataTablein interfaceTableManager<K,V>- Throws:
org.infinispan.persistence.spi.PersistenceException
-
indexExists
protected boolean indexExists(String indexName, Connection conn) throws org.infinispan.persistence.spi.PersistenceException
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
executeUpdateSql
public void executeUpdateSql(Connection conn, String sql) throws org.infinispan.persistence.spi.PersistenceException
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
dropDataTable
public void dropDataTable(Connection conn) throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
dropDataTablein interfaceTableManager<K,V>- Throws:
org.infinispan.persistence.spi.PersistenceException
-
dropMetaTable
public void dropMetaTable(Connection conn) throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
dropMetaTablein interfaceTableManager<K,V>- Throws:
org.infinispan.persistence.spi.PersistenceException
-
dropIndex
protected void dropIndex(Connection conn, String indexName) throws org.infinispan.persistence.spi.PersistenceException
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
getFetchSize
public int getFetchSize()
- Specified by:
getFetchSizein interfaceTableManager<K,V>
-
getBatchSize
public int getBatchSize()
-
isUpsertSupported
public boolean isUpsertSupported()
- Specified by:
isUpsertSupportedin interfaceTableManager<K,V>
-
getIdentifierQuoteString
public String getIdentifierQuoteString()
- Specified by:
getIdentifierQuoteStringin interfaceTableManager<K,V>
-
getDataTableName
public TableName getDataTableName()
- Specified by:
getDataTableNamein interfaceTableManager<K,V>
-
getMetaTableName
public TableName getMetaTableName()
- Specified by:
getMetaTableNamein interfaceTableManager<K,V>
-
initInsertRowSql
protected String initInsertRowSql()
-
getInsertRowSql
public String getInsertRowSql()
-
initUpdateRowSql
protected String initUpdateRowSql()
-
getUpdateRowSql
public String getUpdateRowSql()
- Specified by:
getUpdateRowSqlin interfaceTableManager<K,V>
-
initSelectRowSql
protected String initSelectRowSql()
-
getSelectRowSql
public String getSelectRowSql()
- Specified by:
getSelectRowSqlin interfaceTableManager<K,V>- Specified by:
getSelectRowSqlin classorg.infinispan.persistence.jdbc.common.sql.BaseTableOperations<K,V>
-
initSelectIdRowSql
protected String initSelectIdRowSql()
-
initCountNonExpiredRowsSql
protected String initCountNonExpiredRowsSql()
-
initDeleteRowSql
protected String initDeleteRowSql()
-
initDeleteRowWithExpirationSql
protected String initDeleteRowWithExpirationSql()
-
getDeleteRowSql
public String getDeleteRowSql()
-
getDeleteRowWithExpirationSql
public String getDeleteRowWithExpirationSql()
- Specified by:
getDeleteRowWithExpirationSqlin interfaceTableManager<K,V>
-
initLoadNonExpiredAllRowsSql
protected String initLoadNonExpiredAllRowsSql()
-
getLoadNonExpiredAllRowsSql
public String getLoadNonExpiredAllRowsSql()
- Specified by:
getLoadNonExpiredAllRowsSqlin interfaceTableManager<K,V>
-
getLoadNonExpiredRowsSqlForSegments
public String getLoadNonExpiredRowsSqlForSegments(int numSegments)
-
initLoadAllRowsSql
protected String initLoadAllRowsSql()
-
getLoadAllRowsSql
public String getLoadAllRowsSql()
- Specified by:
getLoadAllRowsSqlin interfaceTableManager<K,V>
-
initDeleteAllRowsSql
protected String initDeleteAllRowsSql()
-
initSelectOnlyExpiredRowsSql
protected String initSelectOnlyExpiredRowsSql()
-
getSelectOnlyExpiredRowsSql
public String getSelectOnlyExpiredRowsSql()
- Specified by:
getSelectOnlyExpiredRowsSqlin interfaceTableManager<K,V>
-
initUpsertRowSql
protected String initUpsertRowSql()
-
isStringEncodingRequired
public boolean isStringEncodingRequired()
- Specified by:
isStringEncodingRequiredin interfaceTableManager<K,V>
-
encodeString
public String encodeString(String string)
- Specified by:
encodeStringin interfaceTableManager<K,V>
-
prepareUpdateStatement
public void prepareUpdateStatement(PreparedStatement ps, String key, long timestamp, int segment, org.infinispan.commons.io.ByteBuffer byteBuffer) throws SQLException
- Specified by:
prepareUpdateStatementin interfaceTableManager<K,V>- Throws:
SQLException
-
preparePublishStatement
protected void preparePublishStatement(PreparedStatement ps, org.infinispan.commons.util.IntSet segments) throws SQLException
- Overrides:
preparePublishStatementin classorg.infinispan.persistence.jdbc.common.sql.BaseTableOperations<K,V>- Throws:
SQLException
-
key2Str
protected String key2Str(Object key) throws org.infinispan.persistence.spi.PersistenceException
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
getSelectAllSql
public String getSelectAllSql(org.infinispan.commons.util.IntSet segments)
-
prepareKeyStatement
protected void prepareKeyStatement(PreparedStatement ps, Object key) throws SQLException
- Specified by:
prepareKeyStatementin classorg.infinispan.persistence.jdbc.common.sql.BaseTableOperations<K,V>- Throws:
SQLException
-
entryFromResultSet
protected org.infinispan.persistence.spi.MarshallableEntry<K,V> entryFromResultSet(ResultSet rs, Object keyIfPresent, boolean fetchValue, Predicate<? super K> keyPredicate) throws SQLException
- Specified by:
entryFromResultSetin classorg.infinispan.persistence.jdbc.common.sql.BaseTableOperations<K,V>- Throws:
SQLException
-
getDeleteAllSql
public String getDeleteAllSql()
- Specified by:
getDeleteAllSqlin interfaceTableManager<K,V>- Specified by:
getDeleteAllSqlin classorg.infinispan.persistence.jdbc.common.sql.BaseTableOperations<K,V>
-
getUpsertRowSql
public String getUpsertRowSql()
-
getSizeSql
public String getSizeSql()
-
upsertEntry
public void upsertEntry(Connection connection, int segment, org.infinispan.persistence.spi.MarshallableEntry<? extends K,? extends V> entry) throws SQLException
- Specified by:
upsertEntryin interfaceorg.infinispan.persistence.jdbc.common.TableOperations<K,V>- Overrides:
upsertEntryin classorg.infinispan.persistence.jdbc.common.sql.BaseTableOperations<K,V>- Throws:
SQLException
-
prepareValueStatement
protected final void prepareValueStatement(PreparedStatement ps, int segment, org.infinispan.persistence.spi.MarshallableEntry<? extends K,? extends V> entry) throws SQLException
- Specified by:
prepareValueStatementin classorg.infinispan.persistence.jdbc.common.sql.BaseTableOperations<K,V>- Throws:
SQLException
-
prepareValueStatement
protected void prepareValueStatement(PreparedStatement ps, int segment, String keyStr, org.infinispan.commons.io.ByteBuffer valueBytes, long expiryTime) throws SQLException
- Throws:
SQLException
-
prepareSizeStatement
protected void prepareSizeStatement(PreparedStatement ps) throws SQLException
- Overrides:
prepareSizeStatementin classorg.infinispan.persistence.jdbc.common.sql.BaseTableOperations<K,V>- Throws:
SQLException
-
-