@Override public void close() throws IOException { closeCurrentReader(); }
new S3EventIterator(new LambdaContext(context), toProcess, s3ClientFactory);
@Override public InternalEvent next() { updateCursor(); /* * Wrap reading next row in retry logic. This is because there is intermittent socket timeouts * when reading from S3 that cause the function to hang/fail. */ Callable<String> callable = () -> { return this.lineIterator.next(); }; String nextRow; try { CallResults<Object> results = new CallExecutor(this.config).execute(callable); nextRow = (String) results.getResult(); } catch (RetriesExhaustedException ree) { throw new RuntimeException(ree.getCallResults().getLastExceptionThatCausedRetry()); } catch (UnexpectedException ue) { throw ue; } /* * Construct the internal event */ return new S3InternalEvent(nextRow, this.context, this.arrivalTime, currentS3Entity.getObject().getKey(), currentS3Entity.getBucket().getName(), currentS3Entity.getObject().getVersionId()); }
new S3EventIterator(new LambdaContext(context), toProcess, s3ClientFactory);
@Override public InternalEvent next() { updateCursor(); /* * Wrap reading next row in retry logic. This is because there is intermittent socket timeouts * when reading from S3 that cause the function to hang/fail. */ Callable<String> callable = () -> { return this.lineIterator.next(); }; String nextRow; try { CallResults<Object> results = new CallExecutor(this.config).execute(callable); nextRow = (String) results.getResult(); } catch (RetriesExhaustedException ree) { throw new RuntimeException(ree.getCallResults().getLastExceptionThatCausedRetry()); } catch (UnexpectedException ue) { throw ue; } /* * Construct the internal event */ return new S3InternalEvent(nextRow, this.context, this.arrivalTime, currentS3Entity.getObject().getKey(), currentS3Entity.getBucket().getName(), currentS3Entity.getObject().getVersionId()); }
@Override public void close() throws IOException { closeCurrentReader(); }
new S3EventIterator(new LambdaContext(context), toProcess, s3ClientFactory);
@Override public boolean hasNext() { if (this.currentIndex < this.records.size()) { return true; } /* * Wrap has next row in retry logic. This is because there is intermittent socket timeouts when * reading from S3 that cause the function to hang/fail. */ Callable<Boolean> callable = () -> { return this.lineIterator.hasNext(); }; boolean hasNext; try { CallResults<Object> results = new CallExecutor(this.config).execute(callable); hasNext = (boolean) results.getResult(); } catch (RetriesExhaustedException ree) { throw new RuntimeException(ree.getCallResults().getLastExceptionThatCausedRetry()); } catch (UnexpectedException ue) { throw ue; } /* * If there are no lines then the reader from which the lines came from should be closed. */ if (!hasNext) { closeCurrentReader(); } return hasNext; }
new S3EventIterator(new LambdaContext(context), toProcess, s3ClientFactory);
@Override public boolean hasNext() { if (this.currentIndex < this.records.size()) { return true; } /* * Wrap has next row in retry logic. This is because there is intermittent socket timeouts when * reading from S3 that cause the function to hang/fail. */ Callable<Boolean> callable = () -> { return this.lineIterator.hasNext(); }; boolean hasNext; try { CallResults<Object> results = new CallExecutor(this.config).execute(callable); hasNext = (boolean) results.getResult(); } catch (RetriesExhaustedException ree) { throw new RuntimeException(ree.getCallResults().getLastExceptionThatCausedRetry()); } catch (UnexpectedException ue) { throw ue; } /* * If there are no lines then the reader from which the lines came from should be closed. */ if (!hasNext) { closeCurrentReader(); } return hasNext; }