org.apache.mesos.state
Class AbstractState

java.lang.Object
  extended by org.apache.mesos.state.AbstractState
All Implemented Interfaces:
State
Direct Known Subclasses:
LevelDBState, ZooKeeperState

public abstract class AbstractState
extends Object
implements State

Abstract implementation of State that provides operations on futures to make concrete classes easier to create.


Constructor Summary
AbstractState()
           
 
Method Summary
 Future<Boolean> expunge(Variable variable)
          Returns true if successfully expunged the variable from the state or false if the variable did not exist or was no longer valid.
 Future<Variable> fetch(String name)
          Returns an immutable "variable" representing the current value from the state associated with the specified name.
protected  void finalize()
           
 Future<Iterator<String>> names()
          Returns an iterator of variable names in the state.
 Future<Variable> store(Variable variable)
          Returns an immutable "variable" representing the current value in the state if updating the specified variable in the state was successful, otherwise returns null.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractState

public AbstractState()
Method Detail

fetch

public Future<Variable> fetch(String name)
Description copied from interface: State
Returns an immutable "variable" representing the current value from the state associated with the specified name.

Specified by:
fetch in interface State

store

public Future<Variable> store(Variable variable)
Description copied from interface: State
Returns an immutable "variable" representing the current value in the state if updating the specified variable in the state was successful, otherwise returns null.

Specified by:
store in interface State

expunge

public Future<Boolean> expunge(Variable variable)
Description copied from interface: State
Returns true if successfully expunged the variable from the state or false if the variable did not exist or was no longer valid.

Specified by:
expunge in interface State

names

public Future<Iterator<String>> names()
Description copied from interface: State
Returns an iterator of variable names in the state.

Specified by:
names in interface State

finalize

protected void finalize()
Overrides:
finalize in class Object


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.