org.xcmis.search.query
Class Statistics

java.lang.Object
  extended by org.xcmis.search.query.Statistics
All Implemented Interfaces:
Serializable, Comparable<Statistics>

public class Statistics
extends Object
implements Comparable<Statistics>, Serializable

See Also:
Serialized Form

Field Summary
protected static Statistics EMPTY_STATISTICS
           
 
Constructor Summary
Statistics()
           
Statistics(long planningMillis)
           
Statistics(long planningMillis, long optimizationMillis, long resultFormulationMillis, long executionMillis)
           
 
Method Summary
 int compareTo(Statistics that)
          
 long getExecutionTime(TimeUnit unit)
          Get the time required to execute the query.
 long getOptimizationTime(TimeUnit unit)
          Get the time required to determine or select a (more) optimal plan.
 long getPlanningTime(TimeUnit unit)
          Get the time required to come up with the canonical plan.
 long getResultFormulationTime(TimeUnit unit)
          Get the time required to formulate the structure of the results.
 long getTotalTime(TimeUnit unit)
          Get the time required to execute the query.
protected  void readable(long millis, StringBuilder sb)
           
 String toString()
          
protected  long totalTime()
           
 Statistics withExecutionTime(long executionMillis)
          Create a new statistics object that has the supplied execution time.
 Statistics withExecutionTime(long execution, TimeUnit unit)
          Create a new statistics object that has the supplied execution time.
 Statistics withOptimizationTime(long optimizationMillis)
          Create a new statistics object that has the supplied optimization time.
 Statistics withOptimizationTime(long optimization, TimeUnit unit)
          Create a new statistics object that has the supplied optimization time.
 Statistics withPlanningTime(long planningMillis)
          Create a new statistics object that has the supplied planning time.
 Statistics withPlanningTime(long planning, TimeUnit unit)
          Create a new statistics object that has the supplied planning time.
 Statistics withResultsFormulationTime(long resultFormulationMillis)
          Create a new statistics object that has the supplied result formulation time.
 Statistics withResultsFormulationTime(long resultFormulation, TimeUnit unit)
          Create a new statistics object that has the supplied result formulation time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_STATISTICS

protected static final Statistics EMPTY_STATISTICS
Constructor Detail

Statistics

public Statistics()

Statistics

public Statistics(long planningMillis)

Statistics

public Statistics(long planningMillis,
                  long optimizationMillis,
                  long resultFormulationMillis,
                  long executionMillis)
Method Detail

getPlanningTime

public long getPlanningTime(TimeUnit unit)
Get the time required to come up with the canonical plan.

Parameters:
unit - the time unit that should be used
Returns:
the time to plan, in the desired units
Throws:
IllegalArgumentException - if the unit is null

getOptimizationTime

public long getOptimizationTime(TimeUnit unit)
Get the time required to determine or select a (more) optimal plan.

Parameters:
unit - the time unit that should be used
Returns:
the time to determine an optimal plan, in the desired units
Throws:
IllegalArgumentException - if the unit is null

getResultFormulationTime

public long getResultFormulationTime(TimeUnit unit)
Get the time required to formulate the structure of the results.

Parameters:
unit - the time unit that should be used
Returns:
the time to formulate the results, in the desired units
Throws:
IllegalArgumentException - if the unit is null

getExecutionTime

public long getExecutionTime(TimeUnit unit)
Get the time required to execute the query.

Parameters:
unit - the time unit that should be used
Returns:
the time to execute the query, in the desired units
Throws:
IllegalArgumentException - if the unit is null

getTotalTime

public long getTotalTime(TimeUnit unit)
Get the time required to execute the query.

Parameters:
unit - the time unit that should be used
Returns:
the time to execute the query, in the desired units
Throws:
IllegalArgumentException - if the unit is null

totalTime

protected long totalTime()

withPlanningTime

public Statistics withPlanningTime(long planningMillis)
Create a new statistics object that has the supplied planning time.

Parameters:
planningMillis - the number of milliseconds required by planning
Returns:
the new statistics object; never null
Throws:
IllegalArgumentException - if the time value is negative

withOptimizationTime

public Statistics withOptimizationTime(long optimizationMillis)
Create a new statistics object that has the supplied optimization time.

Parameters:
optimizationMillis - the number of milliseconds required by optimization
Returns:
the new statistics object; never null
Throws:
IllegalArgumentException - if the time value is negative

withResultsFormulationTime

public Statistics withResultsFormulationTime(long resultFormulationMillis)
Create a new statistics object that has the supplied result formulation time.

Parameters:
resultFormulationMillis - the number of milliseconds required by result formulation
Returns:
the new statistics object; never null
Throws:
IllegalArgumentException - if the time value is negative

withExecutionTime

public Statistics withExecutionTime(long executionMillis)
Create a new statistics object that has the supplied execution time.

Parameters:
executionMillis - the number of milliseconds required to execute the query
Returns:
the new statistics object; never null
Throws:
IllegalArgumentException - if the time value is negative

withPlanningTime

public Statistics withPlanningTime(long planning,
                                   TimeUnit unit)
Create a new statistics object that has the supplied planning time.

Parameters:
planning - the time required to plan the query
unit - the time unit
Returns:
the new statistics object; never null
Throws:
IllegalArgumentException - if the unit is null or if the time value is negative

withOptimizationTime

public Statistics withOptimizationTime(long optimization,
                                       TimeUnit unit)
Create a new statistics object that has the supplied optimization time.

Parameters:
optimization - the time required by optimization
unit - the time unit
Returns:
the new statistics object; never null
Throws:
IllegalArgumentException - if the unit is null or if the time value is negative

withResultsFormulationTime

public Statistics withResultsFormulationTime(long resultFormulation,
                                             TimeUnit unit)
Create a new statistics object that has the supplied result formulation time.

Parameters:
resultFormulation - the time required to formulate the results
unit - the time unit
Returns:
the new statistics object; never null
Throws:
IllegalArgumentException - if the unit is null or if the time value is negative

withExecutionTime

public Statistics withExecutionTime(long execution,
                                    TimeUnit unit)
Create a new statistics object that has the supplied execution time.

Parameters:
execution - the time required to execute the query
unit - the time unit
Returns:
the new statistics object; never null
Throws:
IllegalArgumentException - if the unit is null or if the time value is negative

compareTo

public int compareTo(Statistics that)

Specified by:
compareTo in interface Comparable<Statistics>
See Also:
Comparable.compareTo(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()

readable

protected void readable(long millis,
                        StringBuilder sb)


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.