public ScanSegmentWorker(final DynamoDBDelegate delegate, final ScanRequest request) { this.delegate = delegate; this.request = DynamoDBDelegate.copyScanRequest(request); this.hasNext = true; this.lastConsumedCapacity = delegate.estimateCapacityUnits(DynamoDBDelegate.SCAN, request.getTableName()); }
@Override public ScanContext call() throws Exception { try { ScanRequest originalRequest = DynamoDBDelegate.copyScanRequest(request); ScanResult result = next(); return new ScanContext(originalRequest, result); } catch (BackendRuntimeException e) { throw e.getBackendException(); } }