voldemort.client.protocol.admin
Class AdminClient.StreamingOperations

java.lang.Object
  extended by voldemort.client.protocol.admin.AdminClient.StreamingOperations
Enclosing class:
AdminClient

public class AdminClient.StreamingOperations
extends java.lang.Object

Encapsulates all steaming operations that actually read and write key-value pairs into the cluster


Constructor Summary
AdminClient.StreamingOperations()
           
 
Method Summary
 java.util.Iterator<QueryKeyResult> queryKeys(int nodeId, java.lang.String storeName, java.util.Iterator<ByteArray> keys)
          Fetch key/value tuples from a given server, directly from storage engine
 void updateEntries(int nodeId, java.lang.String storeName, java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> entryIterator, VoldemortFilter filter)
          Update a stream of key/value entries at the given node.
 void updateEntriesTimeBased(int nodeId, java.lang.String storeName, java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> entryIterator, VoldemortFilter filter)
          Update a stream of key/value entries at the given node in the same way as updateEntries(int, String, Iterator, VoldemortFilter) The only difference being the resolving on the server will happen based on timestamp and not the vector clock.
 void updateSlopEntries(int nodeId, java.util.Iterator<Versioned<Slop>> entryIterator)
          Update slops which may be meant for multiple stores
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminClient.StreamingOperations

public AdminClient.StreamingOperations()
Method Detail

updateEntries

public void updateEntries(int nodeId,
                          java.lang.String storeName,
                          java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> entryIterator,
                          VoldemortFilter filter)
Update a stream of key/value entries at the given node. The iterator entries are streamed from the client to the server:
  1. Client performs a handshake with the server (sending in the update entries request with a store name and a VoldemortFilter instance.
  2. While entryIterator has entries, the client will keep sending the updates one after another to the server, buffering the data, without waiting for a response from the server.
  3. After iteration is complete, send an end of stream message, force a flush of the buffer, check the response on the server to check if a VoldemortException has occured.

Parameters:
nodeId - Id of the remote node (where we wish to update the entries)
storeName - Store name for the entries
entryIterator - Iterator of key-value pairs for the entries
filter - Custom filter implementation to filter out entries which should not be updated.
Throws:
VoldemortException

updateEntriesTimeBased

public void updateEntriesTimeBased(int nodeId,
                                   java.lang.String storeName,
                                   java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> entryIterator,
                                   VoldemortFilter filter)
Update a stream of key/value entries at the given node in the same way as updateEntries(int, String, Iterator, VoldemortFilter) The only difference being the resolving on the server will happen based on timestamp and not the vector clock.

Parameters:
nodeId - Id of the remote node (where we wish to update the entries)
storeName - Store name for the entries
entryIterator - Iterator of key-value pairs for the entries
filter - Custom filter implementation to filter out entries which should not be updated.
Throws:
VoldemortException

queryKeys

public java.util.Iterator<QueryKeyResult> queryKeys(int nodeId,
                                                    java.lang.String storeName,
                                                    java.util.Iterator<ByteArray> keys)
Fetch key/value tuples from a given server, directly from storage engine

Entries are being queried synchronously as the iteration happens i.e. the whole result set is not buffered in memory.

Parameters:
nodeId - Id of the node to fetch from
storeName - Name of the store
keys - An Iterable of keys
Returns:
An iterator which allows entries to be streamed as they're being iterated over.

updateSlopEntries

public void updateSlopEntries(int nodeId,
                              java.util.Iterator<Versioned<Slop>> entryIterator)
Update slops which may be meant for multiple stores

Parameters:
nodeId - The id of the node
entryIterator - An iterator over all the slops for this particular node


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu