Search in sources :

Example 1 with KeyPartitioner

use of com.ibm.streamsx.topology.internal.functional.window.KeyPartitioner in project streamsx.topology by IBMStreams.

the class FunctionWindow method initialize.

@Override
public void initialize(OperatorContext context) throws Exception {
    super.initialize(context);
    StreamWindow<Tuple> window = getInput(0).getStreamWindow();
    createWindowListener(window);
    if (window.isPartitioned()) {
        if (getKeyGetter() == null)
            throw new IllegalStateException("Missing keyGetter function");
        SPLMapping<Object> input0Mapping = getInputMapping(this, 0);
        Function<Object, Object> functionKeyGetter = getLogicObject(getKeyGetter());
        window.registerPartitioner(new KeyPartitioner(input0Mapping, functionKeyGetter));
    }
}
Also used : KeyPartitioner(com.ibm.streamsx.topology.internal.functional.window.KeyPartitioner) FunctionalHelper.getLogicObject(com.ibm.streamsx.topology.internal.functional.FunctionalHelper.getLogicObject) Tuple(com.ibm.streams.operator.Tuple)

Aggregations

Tuple (com.ibm.streams.operator.Tuple)1 FunctionalHelper.getLogicObject (com.ibm.streamsx.topology.internal.functional.FunctionalHelper.getLogicObject)1 KeyPartitioner (com.ibm.streamsx.topology.internal.functional.window.KeyPartitioner)1