Map<String, Object> bulkResult = bulkFuture.get(config.getTimeout(), TimeUnit.MILLISECONDS); cacheGetTime.addAndGet(System.currentTimeMillis() - start); if (bulkResult.size() != keyHook.getChunkskey().length) {
when(bulkFuture.get(cacheConfig.getTimeout(), TimeUnit.MILLISECONDS)).thenReturn(bulkResult);
/** * Get the values for multiple keys from the cache. * * @param <T> * @param keyIter Iterator that produces the keys * @param tc the transcoder to serialize and unserialize value * @return a map of the values (for each value that exists) * @throws OperationTimeoutException if the global operation timeout is * exceeded * @throws IllegalStateException in the rare circumstance where queue is too * full to accept any more requests */ public <T> Map<String, T> getBulk(Iterator<String> keyIter, Transcoder<T> tc) { try { return asyncGetBulk(keyIter, tc).get(operationTimeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { throw new RuntimeException("Interrupted getting bulk values", e); } catch (ExecutionException e) { throw new RuntimeException("Failed getting bulk values", e); } catch (TimeoutException e) { throw new OperationTimeoutException("Timeout waiting for bulkvalues", e); } }
/** * Get the values for multiple keys from the cache. * * @param <T> * @param keys the keys * @param tc the transcoder to serialize and unserialize value * @return a map of the values (for each value that exists) * @throws OperationTimeoutException if the global operation timeout is * exceeded * @throws IllegalStateException in the rare circumstance where queue * is too full to accept any more requests */ public <T> Map<String, T> getBulk(Collection<String> keys, Transcoder<T> tc) { try { return asyncGetBulk(keys, tc).get( operationTimeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { throw new RuntimeException("Interrupted getting bulk values", e); } catch (ExecutionException e) { throw new RuntimeException("Failed getting bulk values", e); } catch (TimeoutException e) { throw new OperationTimeoutException( "Timeout waiting for bulkvalues", e); } }
/** * Get the values for multiple keys from the cache. * * @param <T> * @param keys the keys * @param tc the transcoder to serialize and unserialize value * @return a map of the values (for each value that exists) * @throws OperationTimeoutException if the global operation timeout is * exceeded * @throws IllegalStateException in the rare circumstance where queue * is too full to accept any more requests */ public <T> Map<String, T> getBulk(Collection<String> keys, Transcoder<T> tc) { try { return asyncGetBulk(keys, tc).get( operationTimeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { throw new RuntimeException("Interrupted getting bulk values", e); } catch (ExecutionException e) { throw new RuntimeException("Failed getting bulk values", e); } catch (TimeoutException e) { throw new OperationTimeoutException( "Timeout waiting for bulkvalues", e); } }
Transcoder<T> tc) { try { return asyncGetBulk(keyIter, tc).get(operationTimeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) {
Transcoder<T> tc) { try { return asyncGetBulk(keyIter, tc).get(operationTimeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) {
Map<String, Object> bulkResult = bulkFuture.get(config.getTimeout(), TimeUnit.MILLISECONDS); cacheGetTime.addAndGet(System.currentTimeMillis() - start); if (bulkResult.size() != keyHook.getChunkskey().length) {
@Override public ViewResponse get(long duration, TimeUnit units) throws InterruptedException, ExecutionException, TimeoutException { waitForAndCheckOperation(duration, units); if (multigetRef.get() == null) { return null; } Map<String, Object> docMap = multigetRef.get().get(duration, units); final ViewResponseWithDocs viewResp = (ViewResponseWithDocs) objRef.get(); Collection<ViewRow> rows = new LinkedList<ViewRow>(); Iterator<ViewRow> itr = viewResp.iterator(); while (itr.hasNext()) { ViewRow r = itr.next(); if(view instanceof SpatialView) { rows.add(new SpatialViewRowWithDocs(r.getId(), r.getBbox(), r.getGeometry(), r.getValue(), docMap.get(r.getId()))); } else { rows.add(new ViewRowWithDocs(r.getId(), r.getKey(), r.getValue(), docMap.get(r.getId()))); } } return new ViewResponseWithDocs(rows, viewResp.getErrors(), viewResp.getTotalRows()); }