org.apache.flink.optimizer.dag.TwoInputNode Java Examples

The following examples show how to use org.apache.flink.optimizer.dag.TwoInputNode. 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: 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 #2
Source File: HashJoinBuildFirstProperties.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(!in1.isOnDynamicPath() && in2.isOnDynamicPath()) {
		// sanity check that the first input is cached and remove that cache
		if (!in1.getTempMode().isCached()) {
			throw new CompilerException("No cache at point where static and dynamic parts meet.");
		}
		in1.setTempMode(in1.getTempMode().makeNonCached());
		strategy = DriverStrategy.HYBRIDHASH_BUILD_FIRST_CACHED;
	}
	else {
		strategy = DriverStrategy.HYBRIDHASH_BUILD_FIRST;
	}
	return new DualInputPlanNode(node, "Join ("+node.getOperator().getName()+")", in1, in2, strategy, this.keys1, this.keys2);
}
 
Example #3
Source File: HashJoinBuildFirstProperties.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(!in1.isOnDynamicPath() && in2.isOnDynamicPath()) {
		// sanity check that the first input is cached and remove that cache
		if (!in1.getTempMode().isCached()) {
			throw new CompilerException("No cache at point where static and dynamic parts meet.");
		}
		in1.setTempMode(in1.getTempMode().makeNonCached());
		strategy = DriverStrategy.HYBRIDHASH_BUILD_FIRST_CACHED;
	}
	else {
		strategy = DriverStrategy.HYBRIDHASH_BUILD_FIRST;
	}
	return new DualInputPlanNode(node, "Join ("+node.getOperator().getName()+")", in1, in2, strategy, this.keys1, this.keys2);
}
 
Example #4
Source File: HashJoinBuildFirstProperties.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(!in1.isOnDynamicPath() && in2.isOnDynamicPath()) {
		// sanity check that the first input is cached and remove that cache
		if (!in1.getTempMode().isCached()) {
			throw new CompilerException("No cache at point where static and dynamic parts meet.");
		}
		in1.setTempMode(in1.getTempMode().makeNonCached());
		strategy = DriverStrategy.HYBRIDHASH_BUILD_FIRST_CACHED;
	}
	else {
		strategy = DriverStrategy.HYBRIDHASH_BUILD_FIRST;
	}
	return new DualInputPlanNode(node, "Join ("+node.getOperator().getName()+")", in1, in2, strategy, this.keys1, this.keys2);
}
 
Example #5
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 #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: DualInputPlanNode.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public TwoInputNode getTwoInputNode() {
	if (this.template instanceof TwoInputNode) {
		return (TwoInputNode) this.template;
	} else {
		throw new RuntimeException();
	}
}
 
Example #8
Source File: DualInputPlanNode.java    From flink with Apache License 2.0 5 votes vote down vote up
public TwoInputNode getTwoInputNode() {
	if (this.template instanceof TwoInputNode) {
		return (TwoInputNode) this.template;
	} else {
		throw new RuntimeException();
	}
}
 
Example #9
Source File: CoGroupRawDescriptor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in1.getLocalProperties().getOrdering() == null ? null : in1.getLocalProperties().getOrdering().getFieldSortDirections();

	if (inputOrders == null || inputOrders.length < this.keys1.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator.");
	} else if (inputOrders.length > this.keys1.size()) {
		boolean[] tmp = new boolean[this.keys1.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}

	return new DualInputPlanNode(node, "CoGroup (" + node.getOperator().getName() + ")", in1, in2,
			DriverStrategy.CO_GROUP_RAW, this.keys1, this.keys2, inputOrders);
}
 
Example #10
Source File: AbstractSortMergeJoinDescriptor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in1.getLocalProperties().getOrdering().getFieldSortDirections();

	if (inputOrders == null || inputOrders.length < this.keys1.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a merge operator.");
	} else if (inputOrders.length > this.keys1.size()) {
		boolean[] tmp = new boolean[this.keys1.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}

	String nodeName = String.format("%s (%s)", getNodeName(), node.getOperator().getName());
	return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2, inputOrders);
}
 
Example #11
Source File: CoGroupDescriptor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in1.getLocalProperties().getOrdering() == null ? null : in1.getLocalProperties().getOrdering().getFieldSortDirections();
	
	if (inputOrders == null || inputOrders.length < this.keys1.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator.");
	} else if (inputOrders.length > this.keys1.size()) {
		boolean[] tmp = new boolean[this.keys1.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}
	
	return new DualInputPlanNode(node, "CoGroup ("+node.getOperator().getName()+")", in1, in2, DriverStrategy.CO_GROUP, this.keys1, this.keys2, inputOrders);
}
 
Example #12
Source File: UtilSinkJoinOpDescriptor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	if (node instanceof SinkJoiner) {
		return new SinkJoinerPlanNode((SinkJoiner) node, in1, in2);
	} else {
		throw new CompilerException();
	}
}
 
Example #13
Source File: CoGroupWithSolutionSetFirstDescriptor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in2.getLocalProperties().getOrdering() == null ? null : in2.getLocalProperties().getOrdering().getFieldSortDirections();

	if (inputOrders == null || inputOrders.length < this.keys2.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator.");
	} else if (inputOrders.length > this.keys2.size()) {
		boolean[] tmp = new boolean[this.keys2.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}

	return new DualInputPlanNode(node, "CoGroup ("+node.getOperator().getName()+")", in1, in2, DriverStrategy.CO_GROUP, this.keys1, this.keys2, inputOrders);
}
 
Example #14
Source File: CoGroupWithSolutionSetFirstDescriptor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in2.getLocalProperties().getOrdering() == null ? null : in2.getLocalProperties().getOrdering().getFieldSortDirections();

	if (inputOrders == null || inputOrders.length < this.keys2.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator.");
	} else if (inputOrders.length > this.keys2.size()) {
		boolean[] tmp = new boolean[this.keys2.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}

	return new DualInputPlanNode(node, "CoGroup ("+node.getOperator().getName()+")", in1, in2, DriverStrategy.CO_GROUP, this.keys1, this.keys2, inputOrders);
}
 
Example #15
Source File: AbstractSortMergeJoinDescriptor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in1.getLocalProperties().getOrdering().getFieldSortDirections();

	if (inputOrders == null || inputOrders.length < this.keys1.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a merge operator.");
	} else if (inputOrders.length > this.keys1.size()) {
		boolean[] tmp = new boolean[this.keys1.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}

	String nodeName = String.format("%s (%s)", getNodeName(), node.getOperator().getName());
	return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2, inputOrders);
}
 
Example #16
Source File: DualInputPlanNode.java    From flink with Apache License 2.0 5 votes vote down vote up
public TwoInputNode getTwoInputNode() {
	if (this.template instanceof TwoInputNode) {
		return (TwoInputNode) this.template;
	} else {
		throw new RuntimeException();
	}
}
 
Example #17
Source File: AbstractSortMergeJoinDescriptor.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in1.getLocalProperties().getOrdering().getFieldSortDirections();

	if (inputOrders == null || inputOrders.length < this.keys1.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a merge operator.");
	} else if (inputOrders.length > this.keys1.size()) {
		boolean[] tmp = new boolean[this.keys1.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}

	String nodeName = String.format("%s (%s)", getNodeName(), node.getOperator().getName());
	return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2, inputOrders);
}
 
Example #18
Source File: CoGroupDescriptor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in1.getLocalProperties().getOrdering() == null ? null : in1.getLocalProperties().getOrdering().getFieldSortDirections();
	
	if (inputOrders == null || inputOrders.length < this.keys1.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator.");
	} else if (inputOrders.length > this.keys1.size()) {
		boolean[] tmp = new boolean[this.keys1.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}
	
	return new DualInputPlanNode(node, "CoGroup ("+node.getOperator().getName()+")", in1, in2, DriverStrategy.CO_GROUP, this.keys1, this.keys2, inputOrders);
}
 
Example #19
Source File: CoGroupRawDescriptor.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in1.getLocalProperties().getOrdering() == null ? null : in1.getLocalProperties().getOrdering().getFieldSortDirections();

	if (inputOrders == null || inputOrders.length < this.keys1.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator.");
	} else if (inputOrders.length > this.keys1.size()) {
		boolean[] tmp = new boolean[this.keys1.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}

	return new DualInputPlanNode(node, "CoGroup (" + node.getOperator().getName() + ")", in1, in2,
			DriverStrategy.CO_GROUP_RAW, this.keys1, this.keys2, inputOrders);
}
 
Example #20
Source File: CoGroupDescriptor.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in1.getLocalProperties().getOrdering() == null ? null : in1.getLocalProperties().getOrdering().getFieldSortDirections();
	
	if (inputOrders == null || inputOrders.length < this.keys1.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator.");
	} else if (inputOrders.length > this.keys1.size()) {
		boolean[] tmp = new boolean[this.keys1.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}
	
	return new DualInputPlanNode(node, "CoGroup ("+node.getOperator().getName()+")", in1, in2, DriverStrategy.CO_GROUP, this.keys1, this.keys2, inputOrders);
}
 
Example #21
Source File: UtilSinkJoinOpDescriptor.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	if (node instanceof SinkJoiner) {
		return new SinkJoinerPlanNode((SinkJoiner) node, in1, in2);
	} else {
		throw new CompilerException();
	}
}
 
Example #22
Source File: UtilSinkJoinOpDescriptor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	if (node instanceof SinkJoiner) {
		return new SinkJoinerPlanNode((SinkJoiner) node, in1, in2);
	} else {
		throw new CompilerException();
	}
}
 
Example #23
Source File: CoGroupRawDescriptor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in1.getLocalProperties().getOrdering() == null ? null : in1.getLocalProperties().getOrdering().getFieldSortDirections();

	if (inputOrders == null || inputOrders.length < this.keys1.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator.");
	} else if (inputOrders.length > this.keys1.size()) {
		boolean[] tmp = new boolean[this.keys1.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}

	return new DualInputPlanNode(node, "CoGroup (" + node.getOperator().getName() + ")", in1, in2,
			DriverStrategy.CO_GROUP_RAW, this.keys1, this.keys2, inputOrders);
}
 
Example #24
Source File: CoGroupWithSolutionSetFirstDescriptor.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	boolean[] inputOrders = in2.getLocalProperties().getOrdering() == null ? null : in2.getLocalProperties().getOrdering().getFieldSortDirections();

	if (inputOrders == null || inputOrders.length < this.keys2.size()) {
		throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator.");
	} else if (inputOrders.length > this.keys2.size()) {
		boolean[] tmp = new boolean[this.keys2.size()];
		System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
		inputOrders = tmp;
	}

	return new DualInputPlanNode(node, "CoGroup ("+node.getOperator().getName()+")", in1, in2, DriverStrategy.CO_GROUP, this.keys1, this.keys2, inputOrders);
}
 
Example #25
Source File: HashFullOuterJoinBuildSecondDescriptor.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {

	String nodeName = "FullOuterJoin ("+node.getOperator().getName()+")";
	return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2);
}
 
Example #26
Source File: HashFullOuterJoinBuildFirstDescriptor.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {

	String nodeName = "FullOuterJoin ("+node.getOperator().getName()+")";
	return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2);
}
 
Example #27
Source File: HashLeftOuterJoinBuildFirstDescriptor.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {

	String nodeName = "LeftOuterJoin ("+node.getOperator().getName()+")";
	return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2);
}
 
Example #28
Source File: CartesianProductDescriptor.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
	return new DualInputPlanNode(node, "Cross ("+node.getOperator().getName()+")", in1, in2, getStrategy());
}
 
Example #29
Source File: HashLeftOuterJoinBuildSecondDescriptor.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {

	String nodeName = "LeftOuterJoin ("+node.getOperator().getName()+")";
	return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2);
}
 
Example #30
Source File: HashRightOuterJoinBuildFirstDescriptor.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {

	String nodeName = "RightOuterJoin ("+node.getOperator().getName()+")";
	return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2);
}