io.ray.streaming.api.partition.Partition Maven / Gradle / Ivy
package io.ray.streaming.api.partition;
import io.ray.streaming.api.function.Function;
/**
* Interface of the partitioning strategy.
*
* @param Type of the input data.
*/
@FunctionalInterface
public interface Partition extends Function {
/**
* Given a record and downstream partitions, determine which partition(s) should receive the
* record.
*
* @param record The record.
* @param numPartition num of partitions
* @return IDs of the downstream partitions that should receive the record.
*/
int[] partition(T record, int numPartition);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy