示例#1
0
 public Map<ByteArray, List<Versioned<byte[]>>> getAll(Iterable<ByteArray> keys)
     throws VoldemortException {
   StoreUtils.assertValidKeys(keys);
   SocketAndStreams sands = pool.checkout(destination);
   try {
     requestFormat.writeGetAllRequest(sands.getOutputStream(), name, keys, reroute);
     sands.getOutputStream().flush();
     return requestFormat.readGetAllResponse(sands.getInputStream());
   } catch (IOException e) {
     close(sands.getSocket());
     throw new VoldemortException(e);
   } finally {
     pool.checkin(destination, sands);
   }
 }
示例#2
0
 public List<Versioned<byte[]>> get(ByteArray key) throws VoldemortException {
   StoreUtils.assertValidKey(key);
   SocketAndStreams sands = pool.checkout(destination);
   try {
     requestFormat.writeGetRequest(sands.getOutputStream(), name, key, reroute);
     sands.getOutputStream().flush();
     return requestFormat.readGetResponse(sands.getInputStream());
   } catch (IOException e) {
     close(sands.getSocket());
     throw new UnreachableStoreException(
         "Failure in get on " + destination + ": " + e.getMessage(), e);
   } finally {
     pool.checkin(destination, sands);
   }
 }