public interface StatementResult
ExecutionFuture.updateStatus()
, it can
represent information about either a completed or in progress operation. If
obtained via ExecutionFuture.get()
or KVStore.executeSync(java.lang.String)
, it
represents the final status of a finished operation.Modifier and Type | Method and Description |
---|---|
String |
getErrorMessage()
If
isSuccessful() is false, return a description of the
problem. |
String |
getInfo()
Returns information about the execution of the statement, in human
readable form.
|
String |
getInfoAsJson()
Returns the same information as
getInfo() , in JSON format. |
int |
getPlanId()
Returns the administrative plan id for this operation if the statement
was a create or remove table, a create or remove index, or an alter
index.
|
String |
getResult()
Returns the output of a DDL statement that generates results, such as
SHOW TABLES, SHOW AS JSON TABLES, DESCRIBE TABLE, or DESCRIBE AS JSON
TABLE.
|
boolean |
isCancelled()
Returns true if the statement had been cancelled.
|
boolean |
isDone()
Returns true if the statement completed.
|
boolean |
isSuccessful()
Returns true if this statement has finished and was successful.
|
int getPlanId()
The plan id will be 0 if this statement was not an administrative operation, or did not require execution.
String getInfo()
String getInfoAsJson()
getInfo()
, in JSON format.
Several possible formats are returned, depending on the statement. The
format of a data definition command which requires server side
processing is as follows:
{ "version" : "2", "planInfo" : { "id" : 6, "name" : "CreateIndex:users:LastName", "isDone" : true, "state" : "SUCCEEDED", "start" : "2014-10-29 18:41:12 UTC", "interrupted" : null, "end" : "2014-10-29 18:41:12 UTC", "error" : null, "executionDetails" : { "taskCounts" : { "total" : 3, "successful" : 3, "failed" : 0, "interrupted" : 0, "incomplete" : 0, "notStarted" : 0 }, "finished" : [ { "taskNum" : 1, "name" : "StartAddIndex:users:LastName", "state" : "SUCCEEDED", "start" : "2014-10-29 18:41:12 UTC", "end" : "2014-10-29 18:41:12 UTC" }, { "taskNum" : 2, "name" : "WaitForAddIndex:users:LastName", "state" : "SUCCEEDED", "start" : "2014-10-29 18:41:12 UTC", "end" : "2014-10-29 18:41:12 UTC" }, { "taskNum" : 3, "name" : "CompleteAddIndex:users:LastName", "state" : "SUCCEEDED", "start" : "2014-10-29 18:41:12 UTC", "end" : "2014-10-29 18:41:12 UTC" } ], "running" : [ ], "pending" : [ ] } } }
String getErrorMessage()
isSuccessful()
is false, return a description of the
problem. Will be null if isSuccessful()
is true.boolean isSuccessful()
boolean isDone()
ExecutionFuture.isDone()
boolean isCancelled()
ExecutionFuture.isCancelled()
ExecutionFuture.cancel(boolean)
String getResult()
{ "type" : "table", "name" : "users", "comment" : null, "shardKey" : [ "id" ], "primaryKey" : [ "id" ], "fields" : [ { "name" : "id", "type" : "INTEGER", "nullable" : true, "default" : null }, { "name" : "firstName", "type" : "STRING", "nullable" : true, "default" : null }, { "name" : "lastName", "type" : "STRING", "nullable" : true, "default" : null }, { "name" : "age", "type" : "INTEGER", "nullable" : true, "default" : null } ], "indexes" : [ { "name" : "LastName", "comment" : null, "fields" : [ "lastName" ] } ] } }The output of a SHOW AS JSON TABLES command is:
{"tables" : ["users"]}
Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved.