StateStoreRecordOperationspublic class StateStoreZooKeeperImpl extends StateStoreSerializableImpl
StateStoreDriver driver implementation that uses ZooKeeper as a
backend.
The structure of the znodes in the ensemble is: PARENT_PATH |--- MOUNT |--- MEMBERSHIP |--- REBALANCER |--- ROUTERS |--- DISABLE_NAMESERVICE
COLON_MARK, SLASH_MARK| Constructor | Description |
|---|---|
StateStoreZooKeeperImpl() |
| 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.
|
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 update,
boolean error) |
Creates multiple records.
|
<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.
|
void |
setEnableConcurrent(boolean enableConcurrent) |
getOriginalPrimaryKey, getPrimaryKey, init, newRecord, serialize, serializeStringget, getMultiple, put, removegetConf, getIdentifier, getMetrics, getTime, verifyDriverReadypublic 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.@VisibleForTesting public void setEnableConcurrent(boolean enableConcurrent)
public void close()
throws java.lang.Exception
StateStoreDriverclose in class StateStoreDriverjava.lang.Exception - if something goes wrong while closing the state store driver connection.public boolean isDriverReady()
StateStoreDriverisDriverReady in class StateStoreDriverpublic <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 update, boolean error) 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.update - True if update of exiting record is allowed.error - 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> 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.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.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.