Class DatanodeTable<KEY,VALUE>
java.lang.Object
org.apache.hadoop.ozone.container.metadata.DatanodeTable<KEY,VALUE>
- All Implemented Interfaces:
org.apache.hadoop.hdds.utils.db.Table<KEY,VALUE>
- Direct Known Subclasses:
SchemaOneDeletedBlocksTable
public class DatanodeTable<KEY,VALUE>
extends Object
implements org.apache.hadoop.hdds.utils.db.Table<KEY,VALUE>
Wrapper class to represent a table in a datanode RocksDB instance.
This class can wrap any existing
Table instance, but will throw
UnsupportedOperationException for Table.iterator().
This is because differing schema versions used in datanode DB layouts may
have differing underlying table structures, so iterating a table instance
directly, without taking into account key prefixes, may yield unexpected
results.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hdds.utils.db.Table
org.apache.hadoop.hdds.utils.db.Table.KeyValue<K,V>, org.apache.hadoop.hdds.utils.db.Table.KeyValueIterator<KEY, VALUE> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddeleteBatchWithPrefix(org.apache.hadoop.hdds.utils.db.BatchOperation batch, KEY prefix) voiddeleteRange(KEY beginKey, KEY endKey) voiddeleteRangeWithBatch(org.apache.hadoop.hdds.utils.db.BatchOperation batch, KEY beginKey, KEY endKey) voiddeleteWithBatch(org.apache.hadoop.hdds.utils.db.BatchOperation batch, KEY key) voiddumpToFileWithPrefix(File externalFile, KEY prefix) longgetIfExist(KEY key) getName()getRangeKVs(KEY startKey, int count, KEY prefix, org.apache.hadoop.hdds.utils.MetadataKeyFilters.KeyPrefixFilter filter, boolean isSequential) getReadCopy(KEY key) booleanisEmpty()booleanvoidloadFromFile(File externalFile) voidvoidputWithBatch(org.apache.hadoop.hdds.utils.db.BatchOperation batch, KEY key, VALUE value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hdds.utils.db.Table
addCacheEntry, addCacheEntry, addCacheEntry, cacheIterator, cleanupCache, createCacheMetrics, getCacheValue, getRangeKVs, getRangeKVs, getSkipCache, iterator, iterator, keyIterator, keyIterator, valueIterator, valueIterator
-
Constructor Details
-
DatanodeTable
-
-
Method Details
-
put
-
putWithBatch
-
isEmpty
public boolean isEmpty() throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException -
delete
public void delete(KEY key) throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException, org.apache.hadoop.hdds.utils.db.CodecException -
deleteRange
-
deleteWithBatch
public void deleteWithBatch(org.apache.hadoop.hdds.utils.db.BatchOperation batch, KEY key) throws org.apache.hadoop.hdds.utils.db.CodecException -
deleteRangeWithBatch
-
iterator
-
getName
-
getEstimatedKeyCount
public long getEstimatedKeyCount() throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException -
isExist
public boolean isExist(KEY key) throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException, org.apache.hadoop.hdds.utils.db.CodecException -
get
-
getIfExist
-
getReadCopy
-
getRangeKVs
public List<org.apache.hadoop.hdds.utils.db.Table.KeyValue<KEY,VALUE>> getRangeKVs(KEY startKey, int count, KEY prefix, org.apache.hadoop.hdds.utils.MetadataKeyFilters.KeyPrefixFilter filter, boolean isSequential) throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException, org.apache.hadoop.hdds.utils.db.CodecException -
deleteBatchWithPrefix
public void deleteBatchWithPrefix(org.apache.hadoop.hdds.utils.db.BatchOperation batch, KEY prefix) throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException, org.apache.hadoop.hdds.utils.db.CodecException -
dumpToFileWithPrefix
-
loadFromFile
public void loadFromFile(File externalFile) throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException
-