Package org.apache.bookkeeper.bookie
Class InMemoryEntryLogMetadataMap
java.lang.Object
org.apache.bookkeeper.bookie.InMemoryEntryLogMetadataMap
- All Implemented Interfaces:
Closeable,AutoCloseable,EntryLogMetadataMap
In-memory metadata-store to store entry-log metadata-map in memory-map.
-
Constructor Summary
Constructors -
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) Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.voidforKey(long entryLogId, BiConsumer<Long, EntryLogMetadata> action) Performs the given action for the key.booleanisEmpty()Returns true if there are no elements in the map.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.
-
Constructor Details
-
InMemoryEntryLogMetadataMap
public InMemoryEntryLogMetadataMap()
-
-
Method Details
-
containsKey
public boolean containsKey(long entryLogId) Description copied from interface:EntryLogMetadataMapChecks if record with entryLogId exists into the map.- Specified by:
containsKeyin interfaceEntryLogMetadataMap- Returns:
-
put
Description copied from interface:EntryLogMetadataMapAdds entryLogMetadata record into the map.- Specified by:
putin interfaceEntryLogMetadataMap
-
forEach
Description copied from interface:EntryLogMetadataMapPerforms the given action for each entry in this map until all entries have been processed or the action throws an exception.- Specified by:
forEachin interfaceEntryLogMetadataMap
-
forKey
public void forKey(long entryLogId, BiConsumer<Long, EntryLogMetadata> action) throws BookieException.EntryLogMetadataMapExceptionDescription copied from interface:EntryLogMetadataMapPerforms the given action for the key.- Specified by:
forKeyin interfaceEntryLogMetadataMap- Throws:
BookieException.EntryLogMetadataMapException
-
remove
public void remove(long entryLogId) Description copied from interface:EntryLogMetadataMapRemoves entryLogMetadata record from the map.- Specified by:
removein interfaceEntryLogMetadataMap
-
size
public int size()Description copied from interface:EntryLogMetadataMapReturns number of entryLogMetadata records presents into the map.- Specified by:
sizein interfaceEntryLogMetadataMap- Returns:
-
isEmpty
public boolean isEmpty()Description copied from interface:EntryLogMetadataMapReturns true if there are no elements in the map.- Specified by:
isEmptyin interfaceEntryLogMetadataMap- Returns:
-
clear
public void clear()Description copied from interface:EntryLogMetadataMapClear all records from the map. For unit tests.- Specified by:
clearin interfaceEntryLogMetadataMap
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-