com.google.cloud.bigtable.grpc.scanner
Class RowResultScanner<T>
- java.lang.Object
-
- com.google.cloud.bigtable.grpc.scanner.RowResultScanner<T>
-
- All Implemented Interfaces:
- ResultScanner<T>, Closeable, AutoCloseable
public class RowResultScanner<T> extends Object implements ResultScanner<T>
AResultScanner
that wraps GCJServerStream
.
-
-
Constructor Summary
Constructors Constructor and Description RowResultScanner(com.google.api.gax.rpc.ServerStream<T> stream, T[] arr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
available()
Check number of rows immediately available.void
close()
T
next()
Read the next row and block until a row is available.T[]
next(int count)
Read the next N rows where N <= count.
-
-
-
Method Detail
-
next
public T next()
Description copied from interface:ResultScanner
Read the next row and block until a row is available. Will return null on end-of-stream.- Specified by:
next
in interfaceResultScanner<T>
- Returns:
- a T object.
-
next
public T[] next(int count)
Description copied from interface:ResultScanner
Read the next N rows where N <= count. Will block until count are available or end-of-stream is reached.- Specified by:
next
in interfaceResultScanner<T>
- Parameters:
count
- The number of rows to read.- Returns:
- an array of T objects.
-
available
public int available()
Description copied from interface:ResultScanner
Check number of rows immediately available. Calls toResultScanner.next()
will not block on network for at least n results.- Specified by:
available
in interfaceResultScanner<T>
- Returns:
- a int.
-
close
public void close()
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceAutoCloseable
-
-