Class PersistentEntryLogMetadataMap
java.lang.Object
org.apache.bookkeeper.bookie.storage.ldb.PersistentEntryLogMetadataMap
- All Implemented Interfaces:
Closeable,AutoCloseable,EntryLogMetadataMap
Persistent entryLogMetadata-map that stores entry-loggers metadata into
rocksDB.
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentEntryLogMetadataMap(String metadataPath, ServerConfiguration conf) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all records from the map.voidclose()booleancontainsKey(long entryLogId) Checks if record with entryLogId exists into the map.voidforEach(BiConsumer<Long, EntryLogMetadata> action) EntryLogMetadatalife-cycle in supplied action will be transient and it will be recycled as soon as supplied action is completed.voidforKey(long entryLogId, BiConsumer<Long, EntryLogMetadata> action) EntryLogMetadatalife-cycle in supplied action will be transient and it will be recycled as soon as supplied action is completed.voidput(long entryLogId, EntryLogMetadata entryLogMeta) Adds entryLogMetadata record into the map.voidremove(long entryLogId) Removes entryLogMetadata record from the map.intsize()Returns number of entryLogMetadata records presents into the map.voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.bookkeeper.bookie.EntryLogMetadataMap
isEmpty
-
Constructor Details
-
PersistentEntryLogMetadataMap
public PersistentEntryLogMetadataMap(String metadataPath, ServerConfiguration conf) throws IOException - Throws:
IOException
-
-
Method Details
-
containsKey
Description copied from interface:EntryLogMetadataMapChecks if record with entryLogId exists into the map.- Specified by:
containsKeyin interfaceEntryLogMetadataMap- Returns:
- Throws:
BookieException.EntryLogMetadataMapException
-
put
public void put(long entryLogId, EntryLogMetadata entryLogMeta) throws BookieException.EntryLogMetadataMapException Description copied from interface:EntryLogMetadataMapAdds entryLogMetadata record into the map.- Specified by:
putin interfaceEntryLogMetadataMap- Throws:
BookieException.EntryLogMetadataMapException
-
forEach
public void forEach(BiConsumer<Long, EntryLogMetadata> action) throws BookieException.EntryLogMetadataMapExceptionEntryLogMetadatalife-cycle in supplied action will be transient and it will be recycled as soon as supplied action is completed.- Specified by:
forEachin interfaceEntryLogMetadataMap- Throws:
BookieException.EntryLogMetadataMapException
-
forKey
public void forKey(long entryLogId, BiConsumer<Long, EntryLogMetadata> action) throws BookieException.EntryLogMetadataMapExceptionEntryLogMetadatalife-cycle in supplied action will be transient and it will be recycled as soon as supplied action is completed.- Specified by:
forKeyin interfaceEntryLogMetadataMap- Throws:
BookieException.EntryLogMetadataMapException
-
remove
Description copied from interface:EntryLogMetadataMapRemoves entryLogMetadata record from the map.- Specified by:
removein interfaceEntryLogMetadataMap- Throws:
BookieException.EntryLogMetadataMapException
-
size
Description copied from interface:EntryLogMetadataMapReturns number of entryLogMetadata records presents into the map.- Specified by:
sizein interfaceEntryLogMetadataMap- Returns:
- Throws:
BookieException.EntryLogMetadataMapException
-
clear
Description copied from interface:EntryLogMetadataMapClear all records from the map. For unit tests.- Specified by:
clearin interfaceEntryLogMetadataMap- Throws:
BookieException.EntryLogMetadataMapException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
throwIfClosed
-