Class CommandResult

  • All Implemented Interfaces:
    java.io.Serializable

    public class CommandResult
    extends java.lang.Object
    implements java.io.Serializable
    This class represents the result of executing a command against the database. Objects of this type may be serialized and sent across a communication channel. The command being executed is not included in this class because some commands have very complex and non-serializable representations, such as SelectCommands.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long endTimestamp
      The system time when command execution ended.
      private boolean exitCommand
      A flag recording whether the command was an exit command or not.
      private java.lang.Exception failure
      If a failure occurs while a command is being executed, this will be the exception that indicated the failure.
      private long firstResultTimestamp
      The time to the first result being produced.
      private Schema schema
      If the command was a SELECT query and the results are to be kept, this will be the schema of the results as computed by the database.
      private long startTimestamp
      The system time when command execution started.
      private java.util.ArrayList<TupleLiteral> tuples
      If the command was a SELECT query and the results are to be kept, this will be a collection of the tuples in the order they were produced by the database.
    • Constructor Summary

      Constructors 
      Constructor Description
      CommandResult()  
    • Field Detail

      • startTimestamp

        private long startTimestamp
        The system time when command execution started.
      • endTimestamp

        private long endTimestamp
        The system time when command execution ended.
      • exitCommand

        private boolean exitCommand
        A flag recording whether the command was an exit command or not.
      • failure

        private java.lang.Exception failure
        If a failure occurs while a command is being executed, this will be the exception that indicated the failure.
      • firstResultTimestamp

        private long firstResultTimestamp
        The time to the first result being produced.
      • schema

        private Schema schema
        If the command was a SELECT query and the results are to be kept, this will be the schema of the results as computed by the database.
      • tuples

        private java.util.ArrayList<TupleLiteral> tuples
        If the command was a SELECT query and the results are to be kept, this will be a collection of the tuples in the order they were produced by the database.
    • Constructor Detail

      • CommandResult

        public CommandResult()
    • Method Detail

      • startExecution

        public void startExecution()
      • collectSelectResults

        public void collectSelectResults​(SelectCommand command)
      • recordFailure

        public void recordFailure​(java.lang.Exception e)
      • setExit

        public void setExit()
      • isExit

        public boolean isExit()
      • failed

        public boolean failed()
      • getFailure

        public java.lang.Exception getFailure()
      • endExecution

        public void endExecution()
      • getTotalTime

        public long getTotalTime()
        Returns the total execution time of the command in milliseconds.
        Returns:
        the total execution time of the command in milliseconds.
      • getTimeToFirstResult

        public long getTimeToFirstResult()
        Returns the time to the first result in milliseconds.
        Returns:
        the time to the first result in milliseconds.
      • getSchema

        public Schema getSchema()
      • getTuples

        public java.util.List<TupleLiteral> getTuples()