Package oracle.nosql.driver.ops
Class QueryIterableResult
java.lang.Object
oracle.nosql.driver.ops.Result
oracle.nosql.driver.ops.QueryIterableResult
- All Implemented Interfaces:
- AutoCloseable,- Iterable<MapValue>
QueryIterableResult represents an 
Iterable over all the query
 results.
The shape of the values is based on the schema implied by the query. For example a query such as "SELECT * FROM ..." that returns an intact row will return values that conform to the schema of the table. Projections return instances that conform to the schema implied by the statement. UPDATE queries either return values based on a RETURNING clause or, by default, the number of rows affected by the statement.
Example:
 NoSQLHandle handle = ...;
 try (QueryRequest qreq = new QueryRequest()
          .setStatement("select * from foo") ) {
     for (MapValue row : handle.queryIterable(qreq)) {
         // do something with row
     }
 }
 
 Note: The read/write KB/Units, rate limit delay and retry stats are summed
 up from the beginning of the iteration.- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()intReturns the read throughput consumed by all iterators of this operation, in KBytes.intReturns the read throughput consumed by all iterators of this operation, in read units.intReturns the write throughput consumed by all iterators of this operation, in KBytes.intReturns the write throughput consumed by all iterators of this operation, in write units.iterator()Returns an iterator over all results of a query.Methods inherited from class oracle.nosql.driver.ops.ResultgetRateLimitDelayedMs, getRetryStatsMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Method Details- 
iteratorReturns an iterator over all results of a query. Each call is treated as a separate query. The first server call is done at the time of the first hasNext()/next() call. Note: Objects returned by this method can only be used safely by one thread at a time unless synchronized externally.
- 
getReadKBpublic int getReadKB()Returns the read throughput consumed by all iterators of this operation, in KBytes. This is the actual amount of data read by this operation. The number of read units consumed is returned bygetReadUnits()which may be a larger number if the operation usedConsistency.ABSOLUTE- Returns:
- the read KBytes consumed
 
- 
getWriteKBpublic int getWriteKB()Returns the write throughput consumed by all iterators of this operation, in KBytes.- Returns:
- the write KBytes consumed
 
- 
getReadUnitspublic int getReadUnits()Returns the read throughput consumed by all iterators of this operation, in read units. This number may be larger than that returned bygetReadKB()if the operation usedConsistency.ABSOLUTE- Returns:
- the read units consumed
 
- 
getWriteUnitspublic int getWriteUnits()Returns the write throughput consumed by all iterators of this operation, in write units.- Returns:
- the write units consumed
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
 
 
-