Package org.apache.bookkeeper.metastore
Class InMemoryMetastoreCursor
java.lang.Object
org.apache.bookkeeper.metastore.InMemoryMetastoreCursor
- All Implemented Interfaces:
Closeable,AutoCloseable,MetastoreCursor
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.bookkeeper.metastore.MetastoreCursor
MetastoreCursor.ReadEntriesCallback -
Field Summary
Fields inherited from interface org.apache.bookkeeper.metastore.MetastoreCursor
EMPTY_CURSOR -
Constructor Summary
ConstructorsConstructorDescriptionInMemoryMetastoreCursor(SortedMap<String, Versioned<Value>> map, Set<String> fields, ScheduledExecutorService scheduler) -
Method Summary
Modifier and TypeMethodDescriptionvoidasyncReadEntries(int numEntries, MetastoreCursor.ReadEntriesCallback cb, Object ctx) Asynchronously read entries from the cursor, up to the specifiednumEntries.voidclose()booleanIs there any entries left in the cursor to read.readEntries(int numEntries) Read entries from the cursor, up to the specifiednumEntries.
-
Constructor Details
-
InMemoryMetastoreCursor
-
-
Method Details
-
hasMoreEntries
public boolean hasMoreEntries()Description copied from interface:MetastoreCursorIs there any entries left in the cursor to read.- Specified by:
hasMoreEntriesin interfaceMetastoreCursor- Returns:
- true if there is entries left, false otherwise.
-
readEntries
Description copied from interface:MetastoreCursorRead entries from the cursor, up to the specifiednumEntries. The returned list can be smaller.- Specified by:
readEntriesin interfaceMetastoreCursor- Parameters:
numEntries- maximum number of entries to read- Returns:
- the iterator of returned entries.
- Throws:
MSException- when failed to read entries from the cursor.
-
asyncReadEntries
Description copied from interface:MetastoreCursorAsynchronously read entries from the cursor, up to the specifiednumEntries.- Specified by:
asyncReadEntriesin interfaceMetastoreCursor- Parameters:
numEntries- maximum number of entries to readcb- callback objectctx- opaque context- See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-