com.google.cloud.bigtable.grpc.scanner
Class ResumingStreamingResultScanner
- java.lang.Object
-
- com.google.cloud.bigtable.grpc.scanner.ResumingStreamingResultScanner
-
- All Implemented Interfaces:
- ResultScanner<FlatRow>, Closeable, AutoCloseable
@NotThreadSafe public class ResumingStreamingResultScanner extends Object implements ResultScanner<FlatRow>
A ResultScanner that attempts to resume the readRows call when it encounters gRPC INTERNAL errors.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Constructor Summary
Constructors Constructor and Description ResumingStreamingResultScanner(ResponseQueueReader responseQueueReader)
Constructor for ResumingStreamingResultScanner.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
available()
Check number of rows immediately available.void
close()
FlatRow
next()
Read the next row and block until a row is available.FlatRow[]
next(int count)
Read the next N rows where N <= count.
-
-
-
Constructor Detail
-
ResumingStreamingResultScanner
public ResumingStreamingResultScanner(ResponseQueueReader responseQueueReader)
Constructor for ResumingStreamingResultScanner.- Parameters:
responseQueueReader
- aResponseQueueReader
which queues upFlatRow
s.
-
-
Method Detail
-
next
public final FlatRow[] next(int count) throws IOException
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<FlatRow>
- Parameters:
count
- The number of rows to read.- Returns:
- an array of T objects.
- Throws:
IOException
- if any.
-
next
public FlatRow next() throws IOException
Read the next row and block until a row is available. Will return null on end-of-stream.- Specified by:
next
in interfaceResultScanner<FlatRow>
- Returns:
- a T object.
- Throws:
IOException
- if any.
-
available
public int available()
Check number of rows immediately available. Calls toResultScanner.next()
will not block on network for at least n results.- Specified by:
available
in interfaceResultScanner<FlatRow>
- Returns:
- a int.
-
close
public void close()
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceAutoCloseable
-
-