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

com.fluxtion.runtime.dataflow.groupby.AbstractJoin Maven / Gradle / Ivy

The newest version!
package com.fluxtion.runtime.dataflow.groupby;

import com.fluxtion.runtime.dataflow.Stateful;
import com.fluxtion.runtime.dataflow.Tuple;
import com.fluxtion.runtime.util.ObjectPool;

public abstract class AbstractJoin implements Stateful {
    //GroupBy> joinedGroup = new GroupByHashMap<>();
    protected final transient GroupByHashMap> joinedGroup = new GroupByHashMap<>();
    protected final transient ObjectPool tupleObjectPool = new ObjectPool<>(MutableTuple::new);

    @SuppressWarnings("unckecked")
    public abstract  GroupBy> join(
            GroupBy leftGroupBy, GroupBy rightGroupBY);

    //hack for incomplete generics in generated code
    public GroupBy join(Object leftGroupBy, Object rightGroupBY) {
        return this.join((GroupBy) leftGroupBy, (GroupBy) rightGroupBY);
    }

    @Override
    public GroupBy reset() {
        joinedGroup.values().forEach(t -> t.returnToPool(tupleObjectPool));
        return joinedGroup.reset();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy