org.apache.whirr.state
Class ClusterStateStore

java.lang.Object
  extended by org.apache.whirr.state.ClusterStateStore
Direct Known Subclasses:
BlobClusterStateStore, FileClusterStateStore, MemoryClusterStateStore

public abstract class ClusterStateStore
extends Object

Interface for cluster state storage facilities.


Constructor Summary
ClusterStateStore()
           
 
Method Summary
abstract  void destroy()
          Destroys the provided cluster's state in storage.
abstract  Cluster load()
          Deserializes cluster state from storage.
abstract  void save(Cluster cluster)
          Saves cluster state to storage.
protected  String serialize(Cluster cluster)
          Create parser friendly string representation for a Cluster
 Cluster tryLoadOrEmpty()
          Try to load the cluster state or return an empty instance
protected  Cluster unserialize(ClusterSpec spec, String content)
          Rebuild the Cluster instance by using the string representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterStateStore

public ClusterStateStore()
Method Detail

load

public abstract Cluster load()
                      throws IOException
Deserializes cluster state from storage.

Returns:
Throws:
IOException

tryLoadOrEmpty

public Cluster tryLoadOrEmpty()
Try to load the cluster state or return an empty instance

Returns:

save

public abstract void save(Cluster cluster)
                   throws IOException
Saves cluster state to storage.

Parameters:
cluster -
Throws:
IOException

destroy

public abstract void destroy()
                      throws IOException
Destroys the provided cluster's state in storage.

Throws:
IOException

serialize

protected String serialize(Cluster cluster)
                    throws IOException
Create parser friendly string representation for a Cluster

Parameters:
cluster -
Returns:
String representation
Throws:
IOException

unserialize

protected Cluster unserialize(ClusterSpec spec,
                              String content)
                       throws UnknownHostException
Rebuild the Cluster instance by using the string representation

Parameters:
spec -
content -
Returns:
Throws:
UnknownHostException


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.