All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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 - 2024 Weber Informatics LLC | Privacy Policy