com.bigdata.journal
Enum RunState

java.lang.Object
  extended by java.lang.Enum<RunState>
      extended by com.bigdata.journal.RunState
All Implemented Interfaces:
Serializable, Comparable<RunState>

public enum RunState
extends Enum<RunState>

Enum of transaction run states.

Version:
$Id: RunState.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Enum Constant Summary
Aborted
           
Active
           
Committed
           
Prepared
           
 
Method Summary
 boolean isTransitionAllowed(RunState newval)
          Return true iff a transition is allowable from the current RunState to the proposed RunState.
 String toString()
           
static RunState valueOf(String name)
          Returns the enum constant of this type with the specified name.
static RunState[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Active

public static final RunState Active

Prepared

public static final RunState Prepared

Committed

public static final RunState Committed

Aborted

public static final RunState Aborted
Method Detail

values

public static RunState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (RunState c : RunState.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static RunState valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Overrides:
toString in class Enum<RunState>

isTransitionAllowed

public boolean isTransitionAllowed(RunState newval)
Return true iff a transition is allowable from the current RunState to the proposed RunState.

Note: Only certain state transitions are allowed. These are: {Active->Prepared, Active->Aborted, Active->Committed; Prepared->Committed, Prepared->Aborted}. Both Committed and Aborted are absorbing states.

Note: A transition to the same state is always allowed.

Parameters:
newval - The proposed RunState.
Returns:
true iff that state transition is allowed.


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.