Package org.apache.bookkeeper.metastore
Class InMemoryMetastoreCursor
- java.lang.Object
-
- org.apache.bookkeeper.metastore.InMemoryMetastoreCursor
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,MetastoreCursor
class InMemoryMetastoreCursor extends java.lang.Object implements 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
Constructors Constructor Description InMemoryMetastoreCursor(java.util.SortedMap<java.lang.String,Versioned<Value>> map, java.util.Set<java.lang.String> fields, java.util.concurrent.ScheduledExecutorService scheduler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidasyncReadEntries(int numEntries, MetastoreCursor.ReadEntriesCallback cb, java.lang.Object ctx)Asynchronously read entries from the cursor, up to the specifiednumEntries.voidclose()booleanhasMoreEntries()Is there any entries left in the cursor to read.java.util.Iterator<MetastoreTableItem>readEntries(int numEntries)Read entries from the cursor, up to the specifiednumEntries.
-
-
-
Method Detail
-
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
public java.util.Iterator<MetastoreTableItem> readEntries(int numEntries) throws MSException
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
public void asyncReadEntries(int numEntries, MetastoreCursor.ReadEntriesCallback cb, java.lang.Object ctx)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:
MetastoreCursor.readEntries(int)
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-