Class AbstractDatanodeStore
java.lang.Object
org.apache.hadoop.ozone.container.metadata.AbstractRDBStore<AbstractDatanodeDBDefinition>
org.apache.hadoop.ozone.container.metadata.AbstractDatanodeStore
- All Implemented Interfaces:
AutoCloseable,DatanodeStore,DBStoreManager,org.apache.ratis.util.UncheckedAutoCloseable
- Direct Known Subclasses:
DatanodeStoreSchemaOneImpl,DatanodeStoreWithIncrementalChunkList
public class AbstractDatanodeStore
extends AbstractRDBStore<AbstractDatanodeDBDefinition>
implements DatanodeStore
Implementation of the
DatanodeStore interface that contains
functionality common to all more derived datanode store implementations.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBlock Iterator for KeyValue Container.static classBlock localId Iterator for KeyValue Container. -
Field Summary
FieldsFields inherited from interface org.apache.hadoop.ozone.container.metadata.DatanodeStore
NO_SUCH_BLOCK_ERR_MSG -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDatanodeStore(org.apache.hadoop.hdds.conf.ConfigurationSource config, AbstractDatanodeDBDefinition dbDef, boolean openReadOnly) Constructs the metadata store and starts the DB services. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.hdds.utils.db.Table<String, org.apache.hadoop.ozone.container.common.helpers.BlockData> A Table that keeps the block data.protected org.apache.hadoop.hdds.utils.db.Table<String, org.apache.hadoop.ozone.container.common.helpers.BlockData> BlockIterator<org.apache.hadoop.ozone.container.common.helpers.BlockData> getBlockIterator(long containerID) BlockIterator<org.apache.hadoop.ozone.container.common.helpers.BlockData> getBlockIterator(long containerID, org.apache.hadoop.hdds.utils.MetadataKeyFilters.KeyPrefixFilter filter) org.apache.hadoop.hdds.utils.db.Table<String, org.apache.hadoop.ozone.container.common.helpers.ChunkInfoList> A Table that keeps IDs of blocks deleted from the block data table.getFinalizeBlockIterator(long containerID, org.apache.hadoop.hdds.utils.MetadataKeyFilters.KeyPrefixFilter filter) A Table that keeps finalize blocks requested from client.org.apache.hadoop.hdds.utils.db.Table<String, org.apache.hadoop.ozone.container.common.helpers.BlockData> A Table that keeps the metadata of the last chunk of blocks.A Table that keeps the metadata.protected org.apache.hadoop.hdds.utils.db.DBStoreinitDBStore(org.apache.hadoop.hdds.utils.db.DBStoreBuilder dbStoreBuilder, org.apache.hadoop.hdds.utils.db.managed.ManagedDBOptions options, org.apache.hadoop.hdds.conf.ConfigurationSource config) Methods inherited from class org.apache.hadoop.ozone.container.metadata.AbstractRDBStore
close, compactDB, flushDB, flushLog, getBatchHandler, getDbDef, getDbProfile, getStore, isClosed, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.ozone.container.metadata.DatanodeStore
getBlockByID, getCompleteBlockData, putBlockByIDMethods inherited from interface org.apache.hadoop.ozone.container.metadata.DBStoreManager
compactDB, compactionIfNeeded, flushDB, flushLog, getBatchHandler, getStore, isClosed, stopMethods inherited from interface org.apache.ratis.util.UncheckedAutoCloseable
close
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
AbstractDatanodeStore
protected AbstractDatanodeStore(org.apache.hadoop.hdds.conf.ConfigurationSource config, AbstractDatanodeDBDefinition dbDef, boolean openReadOnly) throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException, org.apache.hadoop.hdds.utils.db.CodecException Constructs the metadata store and starts the DB services.- Parameters:
config- - Ozone Configuration.- Throws:
org.apache.hadoop.hdds.utils.db.RocksDatabaseExceptionorg.apache.hadoop.hdds.utils.db.CodecException
-
-
Method Details
-
initDBStore
protected org.apache.hadoop.hdds.utils.db.DBStore initDBStore(org.apache.hadoop.hdds.utils.db.DBStoreBuilder dbStoreBuilder, org.apache.hadoop.hdds.utils.db.managed.ManagedDBOptions options, org.apache.hadoop.hdds.conf.ConfigurationSource config) throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException, org.apache.hadoop.hdds.utils.db.CodecException - Specified by:
initDBStorein classAbstractRDBStore<AbstractDatanodeDBDefinition>- Throws:
org.apache.hadoop.hdds.utils.db.RocksDatabaseExceptionorg.apache.hadoop.hdds.utils.db.CodecException
-
getMetadataTable
Description copied from interface:DatanodeStoreA Table that keeps the metadata.- Specified by:
getMetadataTablein interfaceDatanodeStore- Returns:
- Table
-
getBlockDataTable
public org.apache.hadoop.hdds.utils.db.Table<String,org.apache.hadoop.ozone.container.common.helpers.BlockData> getBlockDataTable()Description copied from interface:DatanodeStoreA Table that keeps the block data.- Specified by:
getBlockDataTablein interfaceDatanodeStore- Returns:
- Table
-
getLastChunkInfoTable
public org.apache.hadoop.hdds.utils.db.Table<String,org.apache.hadoop.ozone.container.common.helpers.BlockData> getLastChunkInfoTable()Description copied from interface:DatanodeStoreA Table that keeps the metadata of the last chunk of blocks.- Specified by:
getLastChunkInfoTablein interfaceDatanodeStore- Returns:
- Table
-
getDeletedBlocksTable
public org.apache.hadoop.hdds.utils.db.Table<String,org.apache.hadoop.ozone.container.common.helpers.ChunkInfoList> getDeletedBlocksTable()Description copied from interface:DatanodeStoreA Table that keeps IDs of blocks deleted from the block data table.- Specified by:
getDeletedBlocksTablein interfaceDatanodeStore- Returns:
- Table
-
getFinalizeBlocksTable
Description copied from interface:DatanodeStoreA Table that keeps finalize blocks requested from client.- Specified by:
getFinalizeBlocksTablein interfaceDatanodeStore- Returns:
- Table
-
getBlockIterator
public BlockIterator<org.apache.hadoop.ozone.container.common.helpers.BlockData> getBlockIterator(long containerID) throws IOException - Specified by:
getBlockIteratorin interfaceDatanodeStore- Throws:
IOException
-
getBlockIterator
public BlockIterator<org.apache.hadoop.ozone.container.common.helpers.BlockData> getBlockIterator(long containerID, org.apache.hadoop.hdds.utils.MetadataKeyFilters.KeyPrefixFilter filter) throws IOException - Specified by:
getBlockIteratorin interfaceDatanodeStore- Throws:
IOException
-
getFinalizeBlockIterator
public BlockIterator<Long> getFinalizeBlockIterator(long containerID, org.apache.hadoop.hdds.utils.MetadataKeyFilters.KeyPrefixFilter filter) throws IOException - Specified by:
getFinalizeBlockIteratorin interfaceDatanodeStore- Throws:
IOException
-
getBlockDataTableWithIterator
protected org.apache.hadoop.hdds.utils.db.Table<String,org.apache.hadoop.ozone.container.common.helpers.BlockData> getBlockDataTableWithIterator() -
getFinalizeBlocksTableWithIterator
-