in flink-connector-pinot/src/main/java/org/apache/flink/streaming/connectors/pinot/v2/writer/PinotWriter.java [67:86]
public PinotWriter(int subtaskId, int maxRowsPerSegment,
EventTimeExtractor<IN> eventTimeExtractor,
JsonSerializer<IN> jsonSerializer,
FileSystemAdapter fsAdapter,
Collection<PinotWriterState> states,
PinotSinkCommitter committer) {
this.subtaskId = subtaskId;
this.maxRowsPerSegment = maxRowsPerSegment;
this.eventTimeExtractor = checkNotNull(eventTimeExtractor);
this.jsonSerializer = checkNotNull(jsonSerializer);
this.fsAdapter = checkNotNull(fsAdapter);
this.activeSegments = new ArrayList<>();
this.committer = committer;
if (states.size() == 1) {
initializeState(states.iterator().next());
} else if (states.size() > 1) {
throw new IllegalStateException("Did not expected more than one element in states.");
}
}