public Set<IndexFieldTypesDTO> poll(final IndexSet indexSet, final Set<IndexFieldTypesDTO> existingIndexTypes) {
        final String activeWriteIndex = indexSet.getActiveWriteIndex();
        final Set<String> existingIndexNames = existingIndexTypes.stream()
                .map(IndexFieldTypesDTO::indexName)
                .collect(Collectors.toSet());

        return indices.getIndices(indexSet, "open").stream()
                // We always poll the active write index because the mapping can change for every ingested message.
                // Other indices will only be polled if we don't have the mapping data already.
                .filter(indexName -> indexName.equals(activeWriteIndex) || !existingIndexNames.contains(indexName))
                .map(indexName -> pollIndex(indexName, indexSet.getConfig().id()))
                .filter(Optional::isPresent)
                .map(Optional::get)
                .collect(Collectors.toSet());
    }
public Set < IndexFieldTypesDTO > poll ( final IndexSet indexSet , final Set < IndexFieldTypesDTO > existingIndexTypes ) { final String activeWriteIndex = indexSet . getActiveWriteIndex ( ) ; final Set < String > existingIndexNames = existingIndexTypes . stream ( ) . map ( IndexFieldTypesDTO :: indexName ) . collect ( Collectors . toSet ( ) ) ; return indices . getIndices ( indexSet , "open" ) . stream ( ) . filter ( indexName -> indexName . equals ( activeWriteIndex ) || ! existingIndexNames . contains ( indexName ) ) . map ( indexName -> pollIndex ( indexName , indexSet . getConfig ( ) . id ( ) ) ) . filter ( Optional :: isPresent ) . map ( Optional :: get ) . collect ( Collectors . toSet ( ) ) ; }
Returns the index field types for the given index set.
<p>
Indices present in <code>existingIndexTypes</code> (except for the current write index) will not be polled
again to avoid Elasticsearch requests.

@param indexSet index set to poll
@param existingIndexTypes existing index field type data
@return the polled index field type data for the given index set