Class AdminClient.StreamingOperations

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

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
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 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


public AdminClient.StreamingOperations()
Method Detail


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.

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.


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.

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


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

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