Class PersistentEntryLogMetadataMap
- java.lang.Object
-
- org.apache.bookkeeper.bookie.storage.ldb.PersistentEntryLogMetadataMap
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,EntryLogMetadataMap
public class PersistentEntryLogMetadataMap extends java.lang.Object implements EntryLogMetadataMap
Persistent entryLogMetadata-map that stores entry-loggers metadata into rocksDB.
-
-
Constructor Summary
Constructors Constructor Description PersistentEntryLogMetadataMap(java.lang.String metadataPath, ServerConfiguration conf)
-
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)EntryLogMetadatalife-cycle in supplied action will be transient and it will be recycled as soon as supplied action is completed.voidforKey(long entryLogId, java.util.function.BiConsumer<java.lang.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.voidthrowIfClosed()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.bookkeeper.bookie.EntryLogMetadataMap
isEmpty
-
-
-
-
Constructor Detail
-
PersistentEntryLogMetadataMap
public PersistentEntryLogMetadataMap(java.lang.String metadataPath, ServerConfiguration conf) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
containsKey
public boolean containsKey(long entryLogId) throws BookieException.EntryLogMetadataMapExceptionDescription 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.EntryLogMetadataMapExceptionDescription copied from interface:EntryLogMetadataMapAdds entryLogMetadata record into the map.- Specified by:
putin interfaceEntryLogMetadataMap- Throws:
BookieException.EntryLogMetadataMapException
-
forEach
public void forEach(java.util.function.BiConsumer<java.lang.Long,EntryLogMetadata> action) throws BookieException.EntryLogMetadataMapException
EntryLogMetadatalife-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, java.util.function.BiConsumer<java.lang.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
public void remove(long entryLogId) throws BookieException.EntryLogMetadataMapExceptionDescription copied from interface:EntryLogMetadataMapRemoves entryLogMetadata record from the map.- Specified by:
removein interfaceEntryLogMetadataMap- Throws:
BookieException.EntryLogMetadataMapException
-
size
public int size() throws BookieException.EntryLogMetadataMapExceptionDescription copied from interface:EntryLogMetadataMapReturns number of entryLogMetadata records presents into the map.- Specified by:
sizein interfaceEntryLogMetadataMap- Returns:
- Throws:
BookieException.EntryLogMetadataMapException
-
clear
public void clear() throws BookieException.EntryLogMetadataMapExceptionDescription copied from interface:EntryLogMetadataMapClear all records from the map. For unit tests.- Specified by:
clearin interfaceEntryLogMetadataMap- Throws:
BookieException.EntryLogMetadataMapException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
throwIfClosed
public void throwIfClosed() throws BookieException.EntryLogMetadataMapException
-
-