Java Code Examples for org.apache.flink.runtime.operators.DriverStrategy#HYBRIDHASH_BUILD_SECOND

The following examples show how to use org.apache.flink.runtime.operators.DriverStrategy#HYBRIDHASH_BUILD_SECOND . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RelationalQueryCompilerTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
private boolean checkHashJoinStrategies(DualInputPlanNode join, SingleInputPlanNode reducer, boolean buildFirst) {
	if ((buildFirst && DriverStrategy.HYBRIDHASH_BUILD_FIRST == join.getDriverStrategy()) ||
		(!buildFirst && DriverStrategy.HYBRIDHASH_BUILD_SECOND == join.getDriverStrategy())) {

		// driver keys
		Assert.assertEquals(set0, join.getKeysForInput1());
		Assert.assertEquals(set0, join.getKeysForInput2());

		// local strategies
		Assert.assertEquals(LocalStrategy.NONE, join.getInput1().getLocalStrategy());
		Assert.assertEquals(LocalStrategy.NONE, join.getInput2().getLocalStrategy());
		Assert.assertEquals(LocalStrategy.COMBININGSORT, reducer.getInput().getLocalStrategy());

		// local strategy keys
		Assert.assertEquals(set01, reducer.getInput().getLocalStrategyKeys());
		Assert.assertEquals(set01, reducer.getKeys(0));
		Assert.assertTrue(Arrays.equals(reducer.getInput().getLocalStrategySortOrder(), reducer.getSortOrders(0)));
		return true;
	} else {
		return false;
	}
}
 
Example 2
Source File: HashJoinBuildSecondProperties.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	DriverStrategy strategy;
	
	if (!in2.isOnDynamicPath() && in1.isOnDynamicPath()) {
		// sanity check that the first input is cached and remove that cache
		if (!in2.getTempMode().isCached()) {
			throw new CompilerException("No cache at point where static and dynamic parts meet.");
		}
		
		in2.setTempMode(in2.getTempMode().makeNonCached());
		strategy = DriverStrategy.HYBRIDHASH_BUILD_SECOND_CACHED;
	}
	else {
		strategy = DriverStrategy.HYBRIDHASH_BUILD_SECOND;
	}
	return new DualInputPlanNode(node, "Join ("+node.getOperator().getName()+")", in1, in2, strategy, this.keys1, this.keys2);
}
 
Example 3
Source File: RelationalQueryCompilerTest.java    From flink with Apache License 2.0 6 votes vote down vote up
private boolean checkHashJoinStrategies(DualInputPlanNode join, SingleInputPlanNode reducer, boolean buildFirst) {
	if ((buildFirst && DriverStrategy.HYBRIDHASH_BUILD_FIRST == join.getDriverStrategy()) ||
		(!buildFirst && DriverStrategy.HYBRIDHASH_BUILD_SECOND == join.getDriverStrategy())) {

		// driver keys
		Assert.assertEquals(set0, join.getKeysForInput1());
		Assert.assertEquals(set0, join.getKeysForInput2());

		// local strategies
		Assert.assertEquals(LocalStrategy.NONE, join.getInput1().getLocalStrategy());
		Assert.assertEquals(LocalStrategy.NONE, join.getInput2().getLocalStrategy());
		Assert.assertEquals(LocalStrategy.COMBININGSORT, reducer.getInput().getLocalStrategy());

		// local strategy keys
		Assert.assertEquals(set01, reducer.getInput().getLocalStrategyKeys());
		Assert.assertEquals(set01, reducer.getKeys(0));
		Assert.assertTrue(Arrays.equals(reducer.getInput().getLocalStrategySortOrder(), reducer.getSortOrders(0)));
		return true;
	} else {
		return false;
	}
}
 
Example 4
Source File: HashJoinBuildSecondProperties.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	DriverStrategy strategy;
	
	if (!in2.isOnDynamicPath() && in1.isOnDynamicPath()) {
		// sanity check that the first input is cached and remove that cache
		if (!in2.getTempMode().isCached()) {
			throw new CompilerException("No cache at point where static and dynamic parts meet.");
		}
		
		in2.setTempMode(in2.getTempMode().makeNonCached());
		strategy = DriverStrategy.HYBRIDHASH_BUILD_SECOND_CACHED;
	}
	else {
		strategy = DriverStrategy.HYBRIDHASH_BUILD_SECOND;
	}
	return new DualInputPlanNode(node, "Join ("+node.getOperator().getName()+")", in1, in2, strategy, this.keys1, this.keys2);
}
 
Example 5
Source File: RelationalQueryCompilerTest.java    From flink with Apache License 2.0 6 votes vote down vote up
private boolean checkHashJoinStrategies(DualInputPlanNode join, SingleInputPlanNode reducer, boolean buildFirst) {
	if ((buildFirst && DriverStrategy.HYBRIDHASH_BUILD_FIRST == join.getDriverStrategy()) ||
		(!buildFirst && DriverStrategy.HYBRIDHASH_BUILD_SECOND == join.getDriverStrategy())) {

		// driver keys
		Assert.assertEquals(set0, join.getKeysForInput1());
		Assert.assertEquals(set0, join.getKeysForInput2());

		// local strategies
		Assert.assertEquals(LocalStrategy.NONE, join.getInput1().getLocalStrategy());
		Assert.assertEquals(LocalStrategy.NONE, join.getInput2().getLocalStrategy());
		Assert.assertEquals(LocalStrategy.COMBININGSORT, reducer.getInput().getLocalStrategy());

		// local strategy keys
		Assert.assertEquals(set01, reducer.getInput().getLocalStrategyKeys());
		Assert.assertEquals(set01, reducer.getKeys(0));
		Assert.assertTrue(Arrays.equals(reducer.getInput().getLocalStrategySortOrder(), reducer.getSortOrders(0)));
		return true;
	} else {
		return false;
	}
}
 
Example 6
Source File: HashJoinBuildSecondProperties.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	DriverStrategy strategy;
	
	if (!in2.isOnDynamicPath() && in1.isOnDynamicPath()) {
		// sanity check that the first input is cached and remove that cache
		if (!in2.getTempMode().isCached()) {
			throw new CompilerException("No cache at point where static and dynamic parts meet.");
		}
		
		in2.setTempMode(in2.getTempMode().makeNonCached());
		strategy = DriverStrategy.HYBRIDHASH_BUILD_SECOND_CACHED;
	}
	else {
		strategy = DriverStrategy.HYBRIDHASH_BUILD_SECOND;
	}
	return new DualInputPlanNode(node, "Join ("+node.getOperator().getName()+")", in1, in2, strategy, this.keys1, this.keys2);
}
 
Example 7
Source File: HashJoinBuildSecondProperties.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public DriverStrategy getStrategy() {
	return DriverStrategy.HYBRIDHASH_BUILD_SECOND;
}
 
Example 8
Source File: HashJoinBuildSecondProperties.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public DriverStrategy getStrategy() {
	return DriverStrategy.HYBRIDHASH_BUILD_SECOND;
}
 
Example 9
Source File: HashJoinBuildSecondProperties.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public DriverStrategy getStrategy() {
	return DriverStrategy.HYBRIDHASH_BUILD_SECOND;
}