Package oracle.nosql.driver.ops
Class PutResult
java.lang.Object
oracle.nosql.driver.ops.Result
oracle.nosql.driver.ops.WriteResult
oracle.nosql.driver.ops.PutResult
Represents the result of a
NoSQLHandle.put(oracle.nosql.driver.ops.PutRequest)
operation.
On a successful operation the value returned by getVersion()
is
non-null. On failure that value is null. Information about the
existing row may be available using
getExistingValue()
, getExistingVersion()
,
getExistingCreationTime()
and getExistingModificationTime()
,
depending on the use of PutRequest.setReturnRow(boolean)
and the results of
the operation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the existing creation time if available.long
Returns the existing modification time if available.Returns the metadata of the returned row, or null if the row does not exist or metadata was not set.Returns the existing row value if available.Returns the existing rowVersion
if available.Returns the value generated if the operation created a new value.int
Returns the read throughput consumed by this operation, in KBytes.int
Returns the read throughput consumed by this operation, in read units.Returns theVersion
of the new row if the operation was successful.int
Returns the write throughput consumed by this operation, in KBytes.int
Returns the write throughput consumed by this operation, in write units.toString()
Methods inherited from class oracle.nosql.driver.ops.Result
getRateLimitDelayedMs, getRetryStats
-
Constructor Details
-
PutResult
public PutResult()
-
-
Method Details
-
getVersion
Returns theVersion
of the new row if the operation was successful. If the operation failed null is returned.- Returns:
- the
Version
on success, null on failure
-
getExistingVersion
Returns the existing rowVersion
if available. This value will only be available if the conditions specified inPutRequest.setReturnRow(boolean)
are met.- Returns:
- the Version
-
getExistingValue
Returns the existing row value if available. This value will only be available if the conditions specified inPutRequest.setReturnRow(boolean)
are met.- Returns:
- the value
-
getExistingCreationTime
public long getExistingCreationTime()Returns the existing creation time if available. This value will only be available if the conditions specified inPutRequest.setReturnRow(boolean)
are met. Note: If the row was written by a version of the system older than 25.3 the creation time will be equal to the modification time, if it was written by a system older than 19.5 it will be zero.- Returns:
- the creation time in milliseconds since Jan 1, 1970 GMT
- Since:
- 5.4.18
-
getExistingModificationTime
public long getExistingModificationTime()Returns the existing modification time if available. This value will only be available if the conditions specified inPutRequest.setReturnRow(boolean)
are met.- Returns:
- the existing modification time in milliseconds since Jan 1, 1970 GMT
- Since:
- 5.3.0
-
getExistingRowMetadata
Returns the metadata of the returned row, or null if the row does not exist or metadata was not set.- Returns:
- the metadata of the row, or null if row does not exist or not set
- Since:
- 5.4.18
-
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 because this was an update operation.- 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()
because it was an update operation.- 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
-
getGeneratedValue
Returns the value generated if the operation created a new value. This can happen if the table contains an identity column or string column declared as a generated UUID. If the table has no such columns this value is null. If a value was generated for the operation, it is non-null.- Returns:
- the generated value
- Since:
- 5.0.1
-
toString
-