@NotThreadSafe public class SelectObjectContentEventStream extends Object implements Closeable
SelectObjectContentEvents, generated as the result of a call
 to AmazonS3.selectObjectContent(SelectObjectContentRequest).
 This stream is usually read by one of getEventsIterator(), visitAllEvents(SelectObjectContentEventVisitor),
 getRecordsInputStream() or (for smaller results) getAllEvents().SelectObjectContentResult.getPayload()| Constructor and Description | 
|---|
| SelectObjectContentEventStream(SdkFilterInputStream inputStream) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | abort()Abort this stream, potentially before all events have been read. | 
| void | close()Close this stream, after all events have been read. | 
| List<SelectObjectContentEvent> | getAllEvents()Read all of the  SelectObjectContentEvents from this stream into memory. | 
| Iterator<SelectObjectContentEvent> | getEventsIterator()Retrieve an iterator over the  SelectObjectContentEvents in this stream, in the order they are returned by S3. | 
| SelectRecordsInputStream | getRecordsInputStream()Retrieve an input stream to the subset of the S3 object that matched the query. | 
| SelectRecordsInputStream | getRecordsInputStream(SelectObjectContentEventVisitor listener)Retrieve an input stream to the subset of the S3 object that matched the query. | 
| void | visitAllEvents(SelectObjectContentEventVisitor visitor)Apply the provided  SelectObjectContentEventVisitorto eachSelectObjectContentEventin this stream
 in the order they are returned by S3. | 
public SelectObjectContentEventStream(SdkFilterInputStream inputStream)
public List<SelectObjectContentEvent> getAllEvents() throws SelectObjectContentEventException
SelectObjectContentEvents from this stream into memory. For large objects, lazy-loading using
 getEventsIterator(), getRecordsInputStream() or visitAllEvents(SelectObjectContentEventVisitor)
 should be used instead.
 This will raise a runtime exception if visitAllEvents(SelectObjectContentEventVisitor),
 getRecordsInputStream() or getEventsIterator() have already been used.
 After using this method, you still must close() this object to release the connection to S3.public void visitAllEvents(SelectObjectContentEventVisitor visitor) throws SelectObjectContentEventException
SelectObjectContentEventVisitor to each SelectObjectContentEvent in this stream
 in the order they are returned by S3. This will lazily-load the events from S3, minimizing the amount of memory used.
 This will raise a runtime exception if getAllEvents(), getRecordsInputStream() or getEventsIterator()
 have already been used.
 After using this method, you still must close() this object to release the connection to S3.visitor - The visitor that should be applied to each event in this stream.SelectObjectContentEventExceptionpublic Iterator<SelectObjectContentEvent> getEventsIterator() throws SelectObjectContentEventException
SelectObjectContentEvents in this stream, in the order they are returned by S3. This
 will lazily-load the events from S3, minimizing the amount of memory used.
 This will raise a runtime exception if getAllEvents(), visitAllEvents(SelectObjectContentEventVisitor)
 or getRecordsInputStream() have already been used.
 After using this method, you still must close() this object to release the connection to S3.public SelectRecordsInputStream getRecordsInputStream() throws SelectObjectContentEventException
SelectObjectContentEvent.RecordsEvents into an InputStream. This will lazily-load the content from
 S3, minimizing the amount of memory used.
 This will raise a runtime exception if getAllEvents(), visitAllEvents(SelectObjectContentEventVisitor)
 or getEventsIterator() have already been used.
 Like all streams, you should SelectRecordsInputStream.close() it after the content has been read. This
 is equivalent to calling close() on this SelectObjectContentEventStream.public SelectRecordsInputStream getRecordsInputStream(SelectObjectContentEventVisitor listener) throws SelectObjectContentEventException
SelectObjectContentEvent.RecordsEvents into an InputStream. This will lazily-load the content from
 S3, minimizing the amount of memory used.
 Unlike getRecordsInputStream(), this allows you to provide a "listener" SelectObjectContentEventVisitor
 that intercepts the events returned by S3 while the thread that called SdkFilterInputStream.read() blocks
 waiting for S3 to return a response.
 This will raise a runtime exception if getAllEvents(), visitAllEvents(SelectObjectContentEventVisitor)
 or getEventsIterator() have already been used.
 Like all streams, you should SelectRecordsInputStream.close() it after the content has been read. This
 is equivalent to calling close() on this SelectObjectContentEventStream.listener - A visitor for monitoring the progress of the query between SelectObjectContentEvent.RecordsEvents.SelectObjectContentEventExceptiongetRecordsInputStream()public void abort()
close() if there are
 still events pending on the stream. Using this method has a performance impact, because it will forcibly close the active
 connection to S3, whereas reading to end of the stream before calling close() will still allow the connection to
 be reused.public void close()
           throws IOException
abort() to signal an intent to only partially read events in the
 stream.close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2013 Amazon Web Services, Inc. All Rights Reserved.