com.bigdata.mdi
Class IndexPartitionCause

java.lang.Object
  extended by com.bigdata.mdi.IndexPartitionCause
All Implemented Interfaces:
Externalizable, Serializable

public class IndexPartitionCause
extends Object
implements Externalizable

Encapsulate the reason why an index partition was created and the synchronous overflow counter of the data service on which the index partition was created as of that action. This information may be used to support heuristics which refuse to move an index partition which was recently moved or to join an index partition which was recently split, etc.

Version:
$Id: IndexPartitionCause.java 3305 2010-07-27 15:08:28Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Nested Class Summary
static class IndexPartitionCause.CauseEnum
          Typesafe enumeration of reasons why an index partition was created.
 
Constructor Summary
IndexPartitionCause()
          De-serialization ctor.
IndexPartitionCause(IndexPartitionCause.CauseEnum cause, long synchronousOverflowCounter, long lastCommitTime)
           
 
Method Summary
 IndexPartitionCause.CauseEnum getCause()
          The underlying cause.
 long getLastCommitTime()
          The lastCommitTime for the live journal.
 long getSynchronousOverflowCounter()
          The value of the synchronous overflow counter at the time that the index partition was created.
static IndexPartitionCause join(ResourceManager resourceManager)
          Factory for IndexPartitionCause.CauseEnum.Join.
static IndexPartitionCause move(ResourceManager resourceManager)
          Factory for IndexPartitionCause.CauseEnum.Move.
 void readExternal(ObjectInput in)
           
static IndexPartitionCause register(ResourceManager resourceManager)
          Factory for IndexPartitionCause.CauseEnum.Register.
static IndexPartitionCause split(ResourceManager resourceManager)
          Factory for IndexPartitionCause.CauseEnum.Split.
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndexPartitionCause

public IndexPartitionCause()
De-serialization ctor.


IndexPartitionCause

public IndexPartitionCause(IndexPartitionCause.CauseEnum cause,
                           long synchronousOverflowCounter,
                           long lastCommitTime)
Parameters:
cause - The reason why the index partition was created.
synchronousOverflowCounter - The value of the counter at the time that the index partition was created.
lastCommitTime - The lastCommitTime for the live journal. Note that this will be 0L if no commits have been performed on the journal. This makes the "time" less robust than the overflow counter.
Method Detail

getCause

public IndexPartitionCause.CauseEnum getCause()
The underlying cause.


getSynchronousOverflowCounter

public long getSynchronousOverflowCounter()
The value of the synchronous overflow counter at the time that the index partition was created.


getLastCommitTime

public long getLastCommitTime()
The lastCommitTime for the live journal. Note that this will be 0L if no commits have been performed on the journal. This makes the "time" less robust than the overflow counter.


register

public static IndexPartitionCause register(ResourceManager resourceManager)
Factory for IndexPartitionCause.CauseEnum.Register.


split

public static IndexPartitionCause split(ResourceManager resourceManager)
Factory for IndexPartitionCause.CauseEnum.Split.


join

public static IndexPartitionCause join(ResourceManager resourceManager)
Factory for IndexPartitionCause.CauseEnum.Join.


move

public static IndexPartitionCause move(ResourceManager resourceManager)
Factory for IndexPartitionCause.CauseEnum.Move.


readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


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