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 void
clear()
Clear all records from the map.void
close()
boolean
containsKey(long entryLogId)
Checks if record with entryLogId exists into the map.void
forEach(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.void
forKey(long entryLogId, java.util.function.BiConsumer<java.lang.Long,EntryLogMetadata> action)
Performs the given action for the key.boolean
isEmpty()
Returns true if there are no elements in the map.void
put(long entryLogId, EntryLogMetadata entryLogMeta)
Adds entryLogMetadata record into the map.void
remove(long entryLogId)
Removes entryLogMetadata record from the map.int
size()
Returns number of entryLogMetadata records presents into the map.
-
-
-
Method Detail
-
containsKey
public boolean containsKey(long entryLogId)
Description copied from interface:EntryLogMetadataMap
Checks if record with entryLogId exists into the map.- Specified by:
containsKey
in interfaceEntryLogMetadataMap
- Returns:
-
put
public void put(long entryLogId, EntryLogMetadata entryLogMeta)
Description copied from interface:EntryLogMetadataMap
Adds entryLogMetadata record into the map.- Specified by:
put
in interfaceEntryLogMetadataMap
-
forEach
public void forEach(java.util.function.BiConsumer<java.lang.Long,EntryLogMetadata> action)
Description copied from interface:EntryLogMetadataMap
Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.- Specified by:
forEach
in interfaceEntryLogMetadataMap
-
forKey
public void forKey(long entryLogId, java.util.function.BiConsumer<java.lang.Long,EntryLogMetadata> action) throws BookieException.EntryLogMetadataMapException
Description copied from interface:EntryLogMetadataMap
Performs the given action for the key.- Specified by:
forKey
in interfaceEntryLogMetadataMap
- Throws:
BookieException.EntryLogMetadataMapException
-
remove
public void remove(long entryLogId)
Description copied from interface:EntryLogMetadataMap
Removes entryLogMetadata record from the map.- Specified by:
remove
in interfaceEntryLogMetadataMap
-
size
public int size()
Description copied from interface:EntryLogMetadataMap
Returns number of entryLogMetadata records presents into the map.- Specified by:
size
in interfaceEntryLogMetadataMap
- Returns:
-
isEmpty
public boolean isEmpty()
Description copied from interface:EntryLogMetadataMap
Returns true if there are no elements in the map.- Specified by:
isEmpty
in interfaceEntryLogMetadataMap
- Returns:
-
clear
public void clear()
Description copied from interface:EntryLogMetadataMap
Clear all records from the map. For unit tests.- Specified by:
clear
in interfaceEntryLogMetadataMap
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-