use of com.hortonworks.streamline.streams.common.StreamlineEventImpl in project streamline by hortonworks.
the class StreamlineEventMapper method entity.
@Override
public StreamlineEvent entity(Result result) {
String id = Bytes.toString(result.getRow());
Map<String, Object> fieldsAndValues = new HashMap<>();
for (Map.Entry<byte[], byte[]> entry : result.getFamilyMap(CF_FIELDS).entrySet()) {
fieldsAndValues.put(Bytes.toString(entry.getKey()), Bytes.toString(entry.getValue()));
}
String dataSourceId = Bytes.toString(result.getFamilyMap(CF_DATASOURCE_ID).firstEntry().getKey());
StreamlineEventImpl event = StreamlineEventImpl.builder().fieldsAndValues(fieldsAndValues).dataSourceId(dataSourceId).build();
return new IdPreservedStreamlineEvent(event, id);
}
Aggregations