backtype.storm.utils
Class LocalState

java.lang.Object
  extended by backtype.storm.utils.LocalState

public class LocalState
extends Object

A simple, durable, atomic K/V database. *Very inefficient*, should only be used for occasional reads/writes. Every read/write hits disk.


Constructor Summary
LocalState(String backingDir)
           
 
Method Summary
 void cleanup(int keepVersions)
           
 Object get(Object key)
           
 void put(Object key, Object val)
           
 void put(Object key, Object val, boolean cleanup)
           
 void remove(Object key)
           
 void remove(Object key, boolean cleanup)
           
 Map<Object,Object> snapshot()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalState

public LocalState(String backingDir)
           throws IOException
Throws:
IOException
Method Detail

snapshot

public Map<Object,Object> snapshot()
                            throws IOException
Throws:
IOException

get

public Object get(Object key)
           throws IOException
Throws:
IOException

put

public void put(Object key,
                Object val)
         throws IOException
Throws:
IOException

put

public void put(Object key,
                Object val,
                boolean cleanup)
         throws IOException
Throws:
IOException

remove

public void remove(Object key)
            throws IOException
Throws:
IOException

remove

public void remove(Object key,
                   boolean cleanup)
            throws IOException
Throws:
IOException

cleanup

public void cleanup(int keepVersions)
             throws IOException
Throws:
IOException


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