Interface NonblockingStore

All Known Implementing Classes:
SocketStore, ThreadPoolBasedNonblockingStoreImpl

public interface NonblockingStore

A NonblockingStore mimics the Store interface but instead of blocking for the request to complete, it simply submits it for later processing and returns immediately. When the request is processed, the provided callback is invoked in order to provide interested parties with the results of the request.

At this point, the NonblockingStore is used from within the RoutedStore in order to provide asynchronous processing against multiple remote stores in parallel using a single thread approach.

There are two main implementations:

  1. ThreadPoolBasedNonblockingStoreImpl wraps a "blocking" Store inside a thread pool to provide a submit-and-return style of asynchronous request/response. This is useful for the case where the Store implementation is not based on SocketStore and as such cannot use NIO-based non-blocking networking.
  2. SocketStore uses NIO to submit a request to the networking layer which will process all requests to remote servers in a dedicated thread.

See Also:
Store, ThreadPoolBasedNonblockingStoreImpl, SocketStore, NonblockingStoreCallback, RoutedStore

Method Summary
 void close()
 void submitDeleteRequest(ByteArray key, Version version, NonblockingStoreCallback callback, long timeoutMs)
 void submitGetAllRequest(java.lang.Iterable<ByteArray> keys, java.util.Map<ByteArray,byte[]> transforms, NonblockingStoreCallback callback, long timeoutMs)
 void submitGetRequest(ByteArray key, byte[] transforms, NonblockingStoreCallback callback, long timeoutMs)
 void submitGetVersionsRequest(ByteArray key, NonblockingStoreCallback callback, long timeoutMs)
 void submitPutRequest(ByteArray key, Versioned<byte[]> value, byte[] transforms, NonblockingStoreCallback callback, long timeoutMs)

Method Detail


void submitGetRequest(ByteArray key,
                      byte[] transforms,
                      NonblockingStoreCallback callback,
                      long timeoutMs)


void submitGetAllRequest(java.lang.Iterable<ByteArray> keys,
                         java.util.Map<ByteArray,byte[]> transforms,
                         NonblockingStoreCallback callback,
                         long timeoutMs)


void submitGetVersionsRequest(ByteArray key,
                              NonblockingStoreCallback callback,
                              long timeoutMs)


void submitPutRequest(ByteArray key,
                      Versioned<byte[]> value,
                      byte[] transforms,
                      NonblockingStoreCallback callback,
                      long timeoutMs)


void submitDeleteRequest(ByteArray key,
                         Version version,
                         NonblockingStoreCallback callback,
                         long timeoutMs)


void close()
           throws VoldemortException

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