Package org.apache.bookkeeper.bookie
Class InMemoryEntryLogMetadataMap
- java.lang.Object
-
- org.apache.bookkeeper.bookie.InMemoryEntryLogMetadataMap
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,EntryLogMetadataMap
public class InMemoryEntryLogMetadataMap extends java.lang.Object implements EntryLogMetadataMap
In-memory metadata-store to store entry-log metadata-map in memory-map.
-
-
Constructor Summary
Constructors Constructor Description InMemoryEntryLogMetadataMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear all records from the map.voidclose()booleancontainsKey(long entryLogId)Checks if record with entryLogId exists into the map.voidforEach(java.util.function.BiConsumer<java.lang.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, java.util.function.BiConsumer<java.lang.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.
-
-
-
Method Detail
-
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
public void put(long entryLogId, EntryLogMetadata entryLogMeta)Description copied from interface:EntryLogMetadataMapAdds entryLogMetadata record into the map.- Specified by:
putin interfaceEntryLogMetadataMap
-
forEach
public void forEach(java.util.function.BiConsumer<java.lang.Long,EntryLogMetadata> action)
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, java.util.function.BiConsumer<java.lang.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
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-