public class ElasticsearchDataReader extends Object implements ExternalSystemDataReader<KeyValue<Integer,String>>
Constructor and Description |
---|
ElasticsearchDataReader(ElasticsearchClient client,
String indexName,
int pageLength) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
List<KeyValue<Integer,String>> |
poll(java.time.Duration timeout)
Poll a batch of records from external system.
|
public ElasticsearchDataReader(ElasticsearchClient client, String indexName, int pageLength)
public List<KeyValue<Integer,String>> poll(java.time.Duration timeout)
ExternalSystemDataReader
Test cases will keep invoking this method until expected records have been polled, so it's not necessary to fetch all records in one poll, but records should not be duplicated across multiple invocations.
poll
in interface ExternalSystemDataReader<KeyValue<Integer,String>>
timeout
- The maximum time to blockpublic void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.