Interface MetastoreCursor

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    InMemoryMetastoreCursor

    public interface MetastoreCursor
    extends java.io.Closeable
    A Metastore 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 specified numEntries. 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 specified numEntries.
        Parameters:
        numEntries - maximum number of entries to read
        callback - callback object
        ctx - opaque context
        See Also:
        readEntries(int)