StateStoreRecordOperationspublic class StateStoreMySQLImpl extends StateStoreSerializableImpl
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
CONNECTION_DRIVER |
|
static java.lang.String |
CONNECTION_PASSWORD |
|
static java.lang.String |
CONNECTION_URL |
|
static java.lang.String |
CONNECTION_USERNAME |
|
static java.lang.String |
SQL_STATE_STORE_CONF_PREFIX |
COLON_MARK, SLASH_MARK| Constructor | Description |
|---|---|
StateStoreMySQLImpl() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Close the State Store driver connection.
|
<T extends BaseRecord> |
get(java.lang.Class<T> clazz) |
Get all records of the requested record class from the data store.
|
boolean |
initDriver() |
Prepare the driver to access data storage.
|
<T extends BaseRecord> |
initRecordStorage(java.lang.String className,
java.lang.Class<T> clazz) |
Initialize storage for a single record class.
|
protected boolean |
insertRecord(java.lang.String tableName,
java.lang.String key,
java.lang.String data) |
Insert a record with a given key into the specified table.
|
boolean |
isDriverReady() |
Check if the driver is currently running and the data store connection is
valid.
|
<T extends BaseRecord> |
putAll(java.util.List<T> records,
boolean allowUpdate,
boolean errorIfExists) |
Creates multiple records.
|
protected boolean |
recordExists(java.lang.String tableName,
java.lang.String key) |
Checks if a record with a given key existing in the specified table.
|
<T extends BaseRecord> |
remove(java.lang.Class<T> clazz,
Query<T> query) |
Remove multiple records of a specific class that match a query.
|
<T extends BaseRecord> |
removeAll(java.lang.Class<T> clazz) |
Remove all records of this class from the store.
|
protected boolean |
removeRecord(java.lang.String tableName,
java.lang.String key) |
Removes the record with a given key from the specified table.
|
protected boolean |
updateRecord(java.lang.String tableName,
java.lang.String key,
java.lang.String data) |
Updates the record with a given key from the specified table.
|
getOriginalPrimaryKey, getPrimaryKey, init, newRecord, serialize, serializeStringget, getMultiple, put, removegetConf, getIdentifier, getMetrics, getTime, verifyDriverReadypublic static final java.lang.String SQL_STATE_STORE_CONF_PREFIX
public static final java.lang.String CONNECTION_URL
public static final java.lang.String CONNECTION_USERNAME
public static final java.lang.String CONNECTION_PASSWORD
public static final java.lang.String CONNECTION_DRIVER
public boolean initDriver()
StateStoreDriverinitDriver in class StateStoreDriverpublic <T extends BaseRecord> boolean initRecordStorage(java.lang.String className, java.lang.Class<T> clazz)
StateStoreDriverinitRecordStorage in class StateStoreDriverT - Type of the state store record.className - String reference of the record class to initialize,
used to construct paths and file names for the record.
Determined by configuration settings for the specific driver.clazz - Record type corresponding to the provided name.public boolean isDriverReady()
StateStoreDriverisDriverReady in class StateStoreDriverpublic void close()
throws java.lang.Exception
StateStoreDriverclose in class StateStoreDriverjava.lang.Exception - if something goes wrong while closing the state store driver connection.public <T extends BaseRecord> QueryResult<T> get(java.lang.Class<T> clazz) throws java.io.IOException
StateStoreRecordOperationsT - Record class of the records.clazz - Class of record to fetch.java.io.IOException - Throws exception if unable to query the data store.public <T extends BaseRecord> StateStoreOperationResult putAll(java.util.List<T> records, boolean allowUpdate, boolean errorIfExists) throws java.io.IOException
StateStoreRecordOperationsT - Record class of the records.records - List of data records to update or create. All records must
be of class clazz.allowUpdate - True if update of exiting record is allowed.errorIfExists - True if an error should be returned when inserting
an existing record. Only used if allowUpdate = false.java.io.IOException - Throws exception if unable to query the data store.public <T extends BaseRecord> boolean removeAll(java.lang.Class<T> clazz) throws java.io.IOException
StateStoreRecordOperationsT - Record class of the records.clazz - Class of records to remove.java.io.IOException - Throws exception if unable to query the data store.public <T extends BaseRecord> int remove(java.lang.Class<T> clazz, Query<T> query) throws java.io.IOException
StateStoreRecordOperationsT - Record class of the records.clazz - The class to match the records with.query - Query to filter what to remove.java.io.IOException - Throws exception if unable to query the data store.protected boolean insertRecord(java.lang.String tableName,
java.lang.String key,
java.lang.String data)
tableName - Name of table to modifykey - Primary key for the record.data - The record value for the given record key.protected boolean updateRecord(java.lang.String tableName,
java.lang.String key,
java.lang.String data)
tableName - Name of table to modifykey - Primary key for the record.data - The record value for the given record key.protected boolean recordExists(java.lang.String tableName,
java.lang.String key)
tableName - Name of table to modifykey - Primary key for the record.protected boolean removeRecord(java.lang.String tableName,
java.lang.String key)
tableName - Name of table to modifykey - Primary key for the record.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.