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 void
asyncReadEntries(int numEntries, MetastoreCursor.ReadEntriesCallback cb, java.lang.Object ctx)
Asynchronously read entries from the cursor, up to the specifiednumEntries
.void
close()
boolean
hasMoreEntries()
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:MetastoreCursor
Is there any entries left in the cursor to read.- Specified by:
hasMoreEntries
in 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:MetastoreCursor
Read entries from the cursor, up to the specifiednumEntries
. The returned list can be smaller.- Specified by:
readEntries
in 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:MetastoreCursor
Asynchronously read entries from the cursor, up to the specifiednumEntries
.- Specified by:
asyncReadEntries
in 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-