Class DatanodeStoreSchemaThreeImpl
java.lang.Object
org.apache.hadoop.ozone.container.metadata.AbstractRDBStore<AbstractDatanodeDBDefinition>
org.apache.hadoop.ozone.container.metadata.AbstractDatanodeStore
org.apache.hadoop.ozone.container.metadata.DatanodeStoreWithIncrementalChunkList
org.apache.hadoop.ozone.container.metadata.DatanodeStoreSchemaThreeImpl
- All Implemented Interfaces:
AutoCloseable,DatanodeStore,DBStoreManager,DeleteTransactionStore<String>,org.apache.ratis.util.UncheckedAutoCloseable
public class DatanodeStoreSchemaThreeImpl
extends DatanodeStoreWithIncrementalChunkList
implements DeleteTransactionStore<String>
Constructs a datanode store in accordance with schema version 3, which uses
three column families/tables:
1. A block data table.
2. A metadata table.
3. A Delete Transaction Table.
This is different from schema version 2 from these points:
- All keys have containerID as prefix.
- The table 3 has String as key instead of Long since we want to use prefix.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.ozone.container.metadata.AbstractDatanodeStore
AbstractDatanodeStore.KeyValueBlockIterator, AbstractDatanodeStore.KeyValueBlockLocalIdIterator -
Field Summary
FieldsFields inherited from class org.apache.hadoop.ozone.container.metadata.AbstractDatanodeStore
LOGFields inherited from interface org.apache.hadoop.ozone.container.metadata.DatanodeStore
NO_SUCH_BLOCK_ERR_MSG -
Constructor Summary
ConstructorsConstructorDescriptionDatanodeStoreSchemaThreeImpl(org.apache.hadoop.hdds.conf.ConfigurationSource config, String dbPath, boolean openReadOnly) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddumpKVContainerData(long containerID, File dumpDir) 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.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.DeletedBlocksTransaction> static FilegetDumpDir(File metaDir) getFinalizeBlockIterator(long containerID, org.apache.hadoop.hdds.utils.MetadataKeyFilters.KeyPrefixFilter filter) static FilegetTableDumpFile(org.apache.hadoop.hdds.utils.db.Table<String, ?> table, File dumpDir) voidloadKVContainerData(File dumpDir) voidremoveKVContainerData(long containerID) Methods inherited from class org.apache.hadoop.ozone.container.metadata.DatanodeStoreWithIncrementalChunkList
getCompleteBlockData, putBlockByIDMethods inherited from class org.apache.hadoop.ozone.container.metadata.AbstractDatanodeStore
getBlockDataTable, getBlockDataTableWithIterator, getDeletedBlocksTable, getFinalizeBlocksTable, getFinalizeBlocksTableWithIterator, getLastChunkInfoTable, getMetadataTable, initDBStoreMethods 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
getBlockByIDMethods inherited from interface org.apache.hadoop.ozone.container.metadata.DBStoreManager
compactDB, flushDB, flushLog, getBatchHandler, getStore, isClosed, stopMethods inherited from interface org.apache.ratis.util.UncheckedAutoCloseable
close
-
Field Details
-
DUMP_FILE_SUFFIX
- See Also:
-
DUMP_DIR
- See Also:
-
-
Constructor Details
-
DatanodeStoreSchemaThreeImpl
public DatanodeStoreSchemaThreeImpl(org.apache.hadoop.hdds.conf.ConfigurationSource config, String dbPath, boolean openReadOnly) throws IOException - Throws:
IOException
-
-
Method Details
-
getDeleteTransactionTable
public org.apache.hadoop.hdds.utils.db.Table<String,org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.DeletedBlocksTransaction> getDeleteTransactionTable()- Specified by:
getDeleteTransactionTablein interfaceDeleteTransactionStore<String>
-
getBlockIterator
public BlockIterator<org.apache.hadoop.ozone.container.common.helpers.BlockData> getBlockIterator(long containerID) throws IOException - Specified by:
getBlockIteratorin interfaceDatanodeStore- Overrides:
getBlockIteratorin classAbstractDatanodeStore- 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- Overrides:
getBlockIteratorin classAbstractDatanodeStore- Throws:
IOException
-
getFinalizeBlockIterator
public BlockIterator<Long> getFinalizeBlockIterator(long containerID, org.apache.hadoop.hdds.utils.MetadataKeyFilters.KeyPrefixFilter filter) throws IOException - Specified by:
getFinalizeBlockIteratorin interfaceDatanodeStore- Overrides:
getFinalizeBlockIteratorin classAbstractDatanodeStore- Throws:
IOException
-
removeKVContainerData
- Throws:
IOException
-
dumpKVContainerData
- Throws:
IOException
-
loadKVContainerData
- Throws:
IOException
-
getTableDumpFile
public static File getTableDumpFile(org.apache.hadoop.hdds.utils.db.Table<String, ?> table, File dumpDir) throws IOException- Throws:
IOException
-
getDumpDir
-
compactionIfNeeded
- Specified by:
compactionIfNeededin interfaceDBStoreManager- Throws:
Exception
-