io.ray.streaming.operator.impl.KeyByOperator Maven / Gradle / Ivy
package io.ray.streaming.operator.impl;
import io.ray.streaming.api.function.impl.KeyFunction;
import io.ray.streaming.message.KeyRecord;
import io.ray.streaming.message.Record;
import io.ray.streaming.operator.OneInputOperator;
import io.ray.streaming.operator.StreamOperator;
public class KeyByOperator extends StreamOperator>
implements OneInputOperator {
public KeyByOperator(KeyFunction keyFunction) {
super(keyFunction);
}
@Override
public void processElement(Record record) throws Exception {
K key = this.function.keyBy(record.getValue());
collect(new KeyRecord<>(key, record.getValue()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy