use of io.openmessaging.connector.api.data.FieldType in project rocketmq-externals by apache.
the class FileSinkTask method put.
@Override
public void put(Collection<SinkDataEntry> sinkDataEntries) {
for (SinkDataEntry record : sinkDataEntries) {
Object[] payloads = record.getPayload();
log.trace("Writing line to {}: {}", logFilename(), payloads);
Schema schema = record.getSchema();
List<Field> fields = schema.getFields();
for (Field field : fields) {
FieldType type = field.getType();
if (type.equals(FieldType.STRING)) {
log.info("Writing line to {}: {}", logFilename(), payloads[field.getIndex()]);
outputStream.println(String.valueOf(payloads[field.getIndex()]));
}
}
}
}
Aggregations