Package org.apache.bookkeeper.metastore
Interface MetastoreCursor
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
InMemoryMetastoreCursor
public interface MetastoreCursor extends java.io.CloseableA Metastore Cursor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMetastoreCursor.ReadEntriesCallbackA callback for reading entries.
-
Field Summary
Fields Modifier and Type Field Description static MetastoreCursorEMPTY_CURSOR
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidasyncReadEntries(int numEntries, MetastoreCursor.ReadEntriesCallback callback, java.lang.Object ctx)Asynchronously read entries from the cursor, up to the specifiednumEntries.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.
-
-
-
Field Detail
-
EMPTY_CURSOR
static final MetastoreCursor EMPTY_CURSOR
-
-
Method Detail
-
hasMoreEntries
boolean hasMoreEntries()
Is there any entries left in the cursor to read.- Returns:
- true if there is entries left, false otherwise.
-
readEntries
java.util.Iterator<MetastoreTableItem> readEntries(int numEntries) throws MSException
Read entries from the cursor, up to the specifiednumEntries. The returned list can be smaller.- 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
void asyncReadEntries(int numEntries, MetastoreCursor.ReadEntriesCallback callback, java.lang.Object ctx)Asynchronously read entries from the cursor, up to the specifiednumEntries.- Parameters:
numEntries- maximum number of entries to readcallback- callback objectctx- opaque context- See Also:
readEntries(int)
-
-