use of org.apache.flink.table.runtime.hashtable.BinaryHashTable in project flink by apache.
the class HashJoinOperator method open.
@Override
public void open() throws Exception {
super.open();
ClassLoader cl = getContainingTask().getUserCodeClassLoader();
final AbstractRowDataSerializer buildSerializer = (AbstractRowDataSerializer) getOperatorConfig().getTypeSerializerIn1(getUserCodeClassloader());
final AbstractRowDataSerializer probeSerializer = (AbstractRowDataSerializer) getOperatorConfig().getTypeSerializerIn2(getUserCodeClassloader());
boolean hashJoinUseBitMaps = getContainingTask().getEnvironment().getTaskConfiguration().getBoolean(AlgorithmOptions.HASH_JOIN_BLOOM_FILTERS);
int parallel = getRuntimeContext().getNumberOfParallelSubtasks();
this.condition = parameter.condFuncCode.newInstance(cl);
condition.setRuntimeContext(getRuntimeContext());
condition.open(new Configuration());
this.table = new BinaryHashTable(getContainingTask().getJobConfiguration(), getContainingTask(), buildSerializer, probeSerializer, parameter.buildProjectionCode.newInstance(cl), parameter.probeProjectionCode.newInstance(cl), getContainingTask().getEnvironment().getMemoryManager(), computeMemorySize(), getContainingTask().getEnvironment().getIOManager(), parameter.buildRowSize, parameter.buildRowCount / parallel, hashJoinUseBitMaps, type, condition, reverseJoinFunction, parameter.filterNullKeys, parameter.tryDistinctBuildRow);
this.collector = new StreamRecordCollector<>(output);
this.buildSideNullRow = new GenericRowData(buildSerializer.getArity());
this.probeSideNullRow = new GenericRowData(probeSerializer.getArity());
this.joinedRow = new JoinedRowData();
this.buildEnd = false;
getMetricGroup().gauge("memoryUsedSizeInBytes", table::getUsedMemoryInBytes);
getMetricGroup().gauge("numSpillFiles", table::getNumSpillFiles);
getMetricGroup().gauge("spillInBytes", table::getSpillInBytes);
parameter.condFuncCode = null;
parameter.buildProjectionCode = null;
parameter.probeProjectionCode = null;
}
Aggregations