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 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)
EntryLogMetadata
life-cycle in supplied action will be transient and it will be recycled as soon as supplied action is completed.void
forKey(long entryLogId, java.util.function.BiConsumer<java.lang.Long,EntryLogMetadata> action)
EntryLogMetadata
life-cycle in supplied action will be transient and it will be recycled as soon as supplied action is completed.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.void
throwIfClosed()
-
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.EntryLogMetadataMapException
Description copied from interface:EntryLogMetadataMap
Checks if record with entryLogId exists into the map.- Specified by:
containsKey
in interfaceEntryLogMetadataMap
- Returns:
- Throws:
BookieException.EntryLogMetadataMapException
-
put
public void put(long entryLogId, EntryLogMetadata entryLogMeta) throws BookieException.EntryLogMetadataMapException
Description copied from interface:EntryLogMetadataMap
Adds entryLogMetadata record into the map.- Specified by:
put
in interfaceEntryLogMetadataMap
- Throws:
BookieException.EntryLogMetadataMapException
-
forEach
public void forEach(java.util.function.BiConsumer<java.lang.Long,EntryLogMetadata> action) throws BookieException.EntryLogMetadataMapException
EntryLogMetadata
life-cycle in supplied action will be transient and it will be recycled as soon as supplied action is completed.- Specified by:
forEach
in interfaceEntryLogMetadataMap
- Throws:
BookieException.EntryLogMetadataMapException
-
forKey
public void forKey(long entryLogId, java.util.function.BiConsumer<java.lang.Long,EntryLogMetadata> action) throws BookieException.EntryLogMetadataMapException
EntryLogMetadata
life-cycle in supplied action will be transient and it will be recycled as soon as supplied action is completed.- Specified by:
forKey
in interfaceEntryLogMetadataMap
- Throws:
BookieException.EntryLogMetadataMapException
-
remove
public void remove(long entryLogId) throws BookieException.EntryLogMetadataMapException
Description copied from interface:EntryLogMetadataMap
Removes entryLogMetadata record from the map.- Specified by:
remove
in interfaceEntryLogMetadataMap
- Throws:
BookieException.EntryLogMetadataMapException
-
size
public int size() throws BookieException.EntryLogMetadataMapException
Description copied from interface:EntryLogMetadataMap
Returns number of entryLogMetadata records presents into the map.- Specified by:
size
in interfaceEntryLogMetadataMap
- Returns:
- Throws:
BookieException.EntryLogMetadataMapException
-
clear
public void clear() throws BookieException.EntryLogMetadataMapException
Description copied from interface:EntryLogMetadataMap
Clear all records from the map. For unit tests.- Specified by:
clear
in interfaceEntryLogMetadataMap
- Throws:
BookieException.EntryLogMetadataMapException
-
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
-
throwIfClosed
public void throwIfClosed() throws BookieException.EntryLogMetadataMapException
-
-