Class QueryResult
- java.lang.Object
-
- oracle.nosql.driver.ops.Result
-
- oracle.nosql.driver.ops.QueryResult
-
public class QueryResult extends Result
QueryResult comprises a list ofMapValue
instances representing 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.
If the value returned by
getContinuationKey()
is not null there are additional results available. That value can be supplied to the query request usingQueryRequest.setContinuationKey(byte[])
to continue the query. It is possible for a query to return no results in an empty list but still have a non-null continuation key. This happens if the query reads the maximum amount of data allowed in a single request without matching a query predicate. In this case, the continuation key must be used to get results, if any exist.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getContinuationKey()
Returns the continuation key that can be used to obtain more results if non-null.int
getReadKB()
Returns the read throughput consumed by this operation, in KBytes.int
getReadUnits()
Returns the read throughput consumed by this operation, in read units.java.util.List<MapValue>
getResults()
Returns a list of results for the query.int
getWriteKB()
Returns the write throughput consumed by this operation, in KBytes.int
getWriteUnits()
Returns the write throughput consumed by this operation, in write units.java.lang.String
toString()
-
-
-
Method Detail
-
getResults
public java.util.List<MapValue> getResults()
Returns a list of results for the query. It is possible to have an empty list and a non-null continuation key.
-
getContinuationKey
public byte[] getContinuationKey()
Returns the continuation key that can be used to obtain more results if non-null.- Returns:
- the continuation key, or null if there are no further values to return.
-
getReadKB
public int getReadKB()
Returns the read throughput consumed by this operation, in KBytes. This is the actual amount of data read by the 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
-
getWriteKB
public int getWriteKB()
Returns the write throughput consumed by this operation, in KBytes.- Returns:
- the write KBytes consumed
-
getReadUnits
public int getReadUnits()
Returns the read throughput consumed by this operation, in read units. This number may be larger than that returned bygetReadKB()
if the operation usedConsistency.ABSOLUTE
- Returns:
- the read units consumed
-
getWriteUnits
public int getWriteUnits()
Returns the write throughput consumed by this operation, in write units.- Returns:
- the write units consumed
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-