voldemort.store.http
Class HttpStore

java.lang.Object
  extended by voldemort.store.http.HttpStore
All Implemented Interfaces:
Store<ByteArray,byte[],byte[]>

public class HttpStore
extends java.lang.Object
implements Store<ByteArray,byte[],byte[]>

A remote store client that transmits operations via HTTP and interacts with the VoldemortHttpServer.


Constructor Summary
HttpStore(java.lang.String storeName, java.lang.String host, int port, org.apache.commons.httpclient.HttpClient client, RequestFormat format, boolean reroute)
           
 
Method Summary
 void close()
          Close the store.
 boolean delete(ByteArray key, Version version)
          Delete all entries prior to the given version
 java.util.List<Versioned<byte[]>> get(ByteArray key, byte[] transforms)
          Get the value associated with the given key
 java.util.Map<ByteArray,java.util.List<Versioned<byte[]>>> getAll(java.lang.Iterable<ByteArray> keys, java.util.Map<ByteArray,byte[]> transforms)
          Get the values associated with the given keys and returns them in a Map of keys to a list of versioned values.
 java.lang.Object getCapability(StoreCapabilityType capability)
          Get some capability of the store.
 java.lang.String getName()
           
 java.util.List<Version> getVersions(ByteArray key)
           
 void put(ByteArray key, Versioned<byte[]> versioned, byte[] transforms)
          Associate the value with the key and version in this store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpStore

public HttpStore(java.lang.String storeName,
                 java.lang.String host,
                 int port,
                 org.apache.commons.httpclient.HttpClient client,
                 RequestFormat format,
                 boolean reroute)
Method Detail

delete

public boolean delete(ByteArray key,
                      Version version)
               throws VoldemortException
Description copied from interface: Store
Delete all entries prior to the given version

Specified by:
delete in interface Store<ByteArray,byte[],byte[]>
Parameters:
key - The key to delete
version - The current value of the key
Returns:
True if anything was deleted
Throws:
VoldemortException

get

public java.util.List<Versioned<byte[]>> get(ByteArray key,
                                             byte[] transforms)
                                      throws VoldemortException
Description copied from interface: Store
Get the value associated with the given key

Specified by:
get in interface Store<ByteArray,byte[],byte[]>
Parameters:
key - The key to check for
Returns:
The value associated with the key or an empty list if no values are found.
Throws:
VoldemortException

getAll

public java.util.Map<ByteArray,java.util.List<Versioned<byte[]>>> getAll(java.lang.Iterable<ByteArray> keys,
                                                                         java.util.Map<ByteArray,byte[]> transforms)
                                                                  throws VoldemortException
Description copied from interface: Store
Get the values associated with the given keys and returns them in a Map of keys to a list of versioned values. Note that the returned map will only contain entries for the keys which have a value associated with them.

Specified by:
getAll in interface Store<ByteArray,byte[],byte[]>
Parameters:
keys - The keys to check for.
Returns:
A Map of keys to a list of versioned values.
Throws:
VoldemortException

put

public void put(ByteArray key,
                Versioned<byte[]> versioned,
                byte[] transforms)
         throws VoldemortException
Description copied from interface: Store
Associate the value with the key and version in this store

Specified by:
put in interface Store<ByteArray,byte[],byte[]>
Parameters:
key - The key to use
versioned - The value to store and its version.
Throws:
VoldemortException

close

public void close()
Description copied from interface: Store
Close the store.

Specified by:
close in interface Store<ByteArray,byte[],byte[]>

getName

public java.lang.String getName()
Specified by:
getName in interface Store<ByteArray,byte[],byte[]>
Returns:
The name of the store.

getCapability

public java.lang.Object getCapability(StoreCapabilityType capability)
Description copied from interface: Store
Get some capability of the store. Examples would be the serializer used, or the routing strategy. This provides a mechanism to verify that the store hierarchy has some set of capabilities without knowing the precise layering.

Specified by:
getCapability in interface Store<ByteArray,byte[],byte[]>
Parameters:
capability - The capability type to retrieve
Returns:
The given capaiblity

getVersions

public java.util.List<Version> getVersions(ByteArray key)
Specified by:
getVersions in interface Store<ByteArray,byte[],byte[]>


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao