public static class DatastoreIO.DatastoreReader extends java.lang.Object implements Source.Reader<com.google.api.services.datastore.DatastoreV1.Entity>
| Constructor and Description |
|---|
DatastoreIO.DatastoreReader(com.google.api.services.datastore.DatastoreV1.Query query,
com.google.api.services.datastore.client.Datastore datastore)
Returns a DatastoreIterator with query and Datastore object set.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
advance()
Advances the iterator to the next valid record.
|
void |
close()
Closes the iterator.
|
com.google.api.services.datastore.DatastoreV1.Entity |
getCurrent()
Returns the value of the data item which was read by the last
Source.Reader.start() or
Source.Reader.advance() call. |
boolean |
start()
Initializes the reader and advances the reader to the first record.
|
public DatastoreIO.DatastoreReader(com.google.api.services.datastore.DatastoreV1.Query query,
com.google.api.services.datastore.client.Datastore datastore)
query - the query to select records.datastore - a datastore connection to use.public com.google.api.services.datastore.DatastoreV1.Entity getCurrent()
Source.ReaderSource.Reader.start() or
Source.Reader.advance() call.getCurrent in interface Source.Reader<com.google.api.services.datastore.DatastoreV1.Entity>public boolean start()
throws java.io.IOException
Source.Reader This method should be called exactly once. The invocation should occur prior to calling
Source.Reader.advance() or Source.Reader.getCurrent(). This method may perform expensive operations that
are needed to initialize the reader.
start in interface Source.Reader<com.google.api.services.datastore.DatastoreV1.Entity>true if a record was read, false if we're at the end of input.java.io.IOExceptionpublic boolean advance()
throws java.io.IOException
Source.ReaderSource.Reader.getCurrent() call.advance in interface Source.Reader<com.google.api.services.datastore.DatastoreV1.Entity>true if a record was read, false if we're at the end of input.java.io.IOExceptionpublic void close()
throws java.io.IOException
Source.Readerclose in interface Source.Reader<com.google.api.services.datastore.DatastoreV1.Entity>close in interface java.lang.AutoCloseablejava.io.IOException