public static class DatastoreIO.DatastoreReader extends java.lang.Object implements Source.Reader<com.google.api.services.datastore.DatastoreV1.Entity>
Usage:
DatastoreIterator iterator = new DatastoreIterator(query, datastore);
while (iterator.advance()) {
Entity e = iterator.getCurrent();
...
}
| 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.advance() call. |
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.advance() call.getCurrent in interface Source.Reader<com.google.api.services.datastore.DatastoreV1.Entity>public 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