Java Code Examples for org.apache.flink.optimizer.plan.Channel#clone()

The following examples show how to use org.apache.flink.optimizer.plan.Channel#clone() . 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: SingleInputNode.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
protected void addLocalCandidates(Channel template, List<Set<? extends NamedChannel>> broadcastPlanChannels, RequestedGlobalProperties rgps,
		List<PlanNode> target, CostEstimator estimator)
{
	for (RequestedLocalProperties ilp : this.inConn.getInterestingProperties().getLocalProperties()) {
		final Channel in = template.clone();
		ilp.parameterizeChannel(in);
		
		// instantiate a candidate, if the instantiated local properties meet one possible local property set
		outer:
		for (OperatorDescriptorSingle dps: getPossibleProperties()) {
			for (RequestedLocalProperties ilps : dps.getPossibleLocalProperties()) {
				if (ilps.isMetBy(in.getLocalProperties())) {
					in.setRequiredLocalProps(ilps);
					instantiateCandidate(dps, in, broadcastPlanChannels, target, estimator, rgps, ilp);
					break outer;
				}
			}
		}
	}
}
 
Example 2
Source File: SingleInputNode.java    From flink with Apache License 2.0 6 votes vote down vote up
protected void addLocalCandidates(Channel template, List<Set<? extends NamedChannel>> broadcastPlanChannels, RequestedGlobalProperties rgps,
		List<PlanNode> target, CostEstimator estimator)
{
	for (RequestedLocalProperties ilp : this.inConn.getInterestingProperties().getLocalProperties()) {
		final Channel in = template.clone();
		ilp.parameterizeChannel(in);
		
		// instantiate a candidate, if the instantiated local properties meet one possible local property set
		outer:
		for (OperatorDescriptorSingle dps: getPossibleProperties()) {
			for (RequestedLocalProperties ilps : dps.getPossibleLocalProperties()) {
				if (ilps.isMetBy(in.getLocalProperties())) {
					in.setRequiredLocalProps(ilps);
					instantiateCandidate(dps, in, broadcastPlanChannels, target, estimator, rgps, ilp);
					break outer;
				}
			}
		}
	}
}
 
Example 3
Source File: SingleInputNode.java    From flink with Apache License 2.0 6 votes vote down vote up
protected void addLocalCandidates(Channel template, List<Set<? extends NamedChannel>> broadcastPlanChannels, RequestedGlobalProperties rgps,
		List<PlanNode> target, CostEstimator estimator)
{
	for (RequestedLocalProperties ilp : this.inConn.getInterestingProperties().getLocalProperties()) {
		final Channel in = template.clone();
		ilp.parameterizeChannel(in);
		
		// instantiate a candidate, if the instantiated local properties meet one possible local property set
		outer:
		for (OperatorDescriptorSingle dps: getPossibleProperties()) {
			for (RequestedLocalProperties ilps : dps.getPossibleLocalProperties()) {
				if (ilps.isMetBy(in.getLocalProperties())) {
					in.setRequiredLocalProps(ilps);
					instantiateCandidate(dps, in, broadcastPlanChannels, target, estimator, rgps, ilp);
					break outer;
				}
			}
		}
	}
}
 
Example 4
Source File: TwoInputNode.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
protected void addLocalCandidates(Channel template1, Channel template2, List<Set<? extends NamedChannel>> broadcastPlanChannels, 
		RequestedGlobalProperties rgps1, RequestedGlobalProperties rgps2,
		List<PlanNode> target, LocalPropertiesPair[] validLocalCombinations, CostEstimator estimator)
{
	for (RequestedLocalProperties ilp1 : this.input1.getInterestingProperties().getLocalProperties()) {
		final Channel in1 = template1.clone();
		ilp1.parameterizeChannel(in1);
		
		for (RequestedLocalProperties ilp2 : this.input2.getInterestingProperties().getLocalProperties()) {
			final Channel in2 = template2.clone();
			ilp2.parameterizeChannel(in2);
			
			for (OperatorDescriptorDual dps: getProperties()) {
				for (LocalPropertiesPair lpp : dps.getPossibleLocalProperties()) {
					if (lpp.getProperties1().isMetBy(in1.getLocalProperties()) &&
						lpp.getProperties2().isMetBy(in2.getLocalProperties()) )
					{
						// valid combination
						// for non trivial local properties, we need to check that they are co compatible
						// (such as when some sort order is requested, that both are the same sort order
						if (dps.areCoFulfilled(lpp.getProperties1(), lpp.getProperties2(), 
							in1.getLocalProperties(), in2.getLocalProperties()))
						{
							// copy, because setting required properties and instantiation may
							// change the channels and should not affect prior candidates
							Channel in1Copy = in1.clone();
							in1Copy.setRequiredLocalProps(lpp.getProperties1());
							
							Channel in2Copy = in2.clone();
							in2Copy.setRequiredLocalProps(lpp.getProperties2());
							
							// all right, co compatible
							instantiate(dps, in1Copy, in2Copy, broadcastPlanChannels, target, estimator, rgps1, rgps2, ilp1, ilp2);
							break;
						}
						// else cannot use this pair, fall through the loop and try the next one
					}
				}
			}
		}
	}
}
 
Example 5
Source File: TwoInputNode.java    From flink with Apache License 2.0 4 votes vote down vote up
protected void addLocalCandidates(Channel template1, Channel template2, List<Set<? extends NamedChannel>> broadcastPlanChannels, 
		RequestedGlobalProperties rgps1, RequestedGlobalProperties rgps2,
		List<PlanNode> target, LocalPropertiesPair[] validLocalCombinations, CostEstimator estimator)
{
	for (RequestedLocalProperties ilp1 : this.input1.getInterestingProperties().getLocalProperties()) {
		final Channel in1 = template1.clone();
		ilp1.parameterizeChannel(in1);
		
		for (RequestedLocalProperties ilp2 : this.input2.getInterestingProperties().getLocalProperties()) {
			final Channel in2 = template2.clone();
			ilp2.parameterizeChannel(in2);
			
			for (OperatorDescriptorDual dps: getProperties()) {
				for (LocalPropertiesPair lpp : dps.getPossibleLocalProperties()) {
					if (lpp.getProperties1().isMetBy(in1.getLocalProperties()) &&
						lpp.getProperties2().isMetBy(in2.getLocalProperties()) )
					{
						// valid combination
						// for non trivial local properties, we need to check that they are co compatible
						// (such as when some sort order is requested, that both are the same sort order
						if (dps.areCoFulfilled(lpp.getProperties1(), lpp.getProperties2(), 
							in1.getLocalProperties(), in2.getLocalProperties()))
						{
							// copy, because setting required properties and instantiation may
							// change the channels and should not affect prior candidates
							Channel in1Copy = in1.clone();
							in1Copy.setRequiredLocalProps(lpp.getProperties1());
							
							Channel in2Copy = in2.clone();
							in2Copy.setRequiredLocalProps(lpp.getProperties2());
							
							// all right, co compatible
							instantiate(dps, in1Copy, in2Copy, broadcastPlanChannels, target, estimator, rgps1, rgps2, ilp1, ilp2);
							break;
						}
						// else cannot use this pair, fall through the loop and try the next one
					}
				}
			}
		}
	}
}
 
Example 6
Source File: TwoInputNode.java    From flink with Apache License 2.0 4 votes vote down vote up
protected void addLocalCandidates(Channel template1, Channel template2, List<Set<? extends NamedChannel>> broadcastPlanChannels, 
		RequestedGlobalProperties rgps1, RequestedGlobalProperties rgps2,
		List<PlanNode> target, LocalPropertiesPair[] validLocalCombinations, CostEstimator estimator)
{
	for (RequestedLocalProperties ilp1 : this.input1.getInterestingProperties().getLocalProperties()) {
		final Channel in1 = template1.clone();
		ilp1.parameterizeChannel(in1);
		
		for (RequestedLocalProperties ilp2 : this.input2.getInterestingProperties().getLocalProperties()) {
			final Channel in2 = template2.clone();
			ilp2.parameterizeChannel(in2);
			
			for (OperatorDescriptorDual dps: getProperties()) {
				for (LocalPropertiesPair lpp : dps.getPossibleLocalProperties()) {
					if (lpp.getProperties1().isMetBy(in1.getLocalProperties()) &&
						lpp.getProperties2().isMetBy(in2.getLocalProperties()) )
					{
						// valid combination
						// for non trivial local properties, we need to check that they are co compatible
						// (such as when some sort order is requested, that both are the same sort order
						if (dps.areCoFulfilled(lpp.getProperties1(), lpp.getProperties2(), 
							in1.getLocalProperties(), in2.getLocalProperties()))
						{
							// copy, because setting required properties and instantiation may
							// change the channels and should not affect prior candidates
							Channel in1Copy = in1.clone();
							in1Copy.setRequiredLocalProps(lpp.getProperties1());
							
							Channel in2Copy = in2.clone();
							in2Copy.setRequiredLocalProps(lpp.getProperties2());
							
							// all right, co compatible
							instantiate(dps, in1Copy, in2Copy, broadcastPlanChannels, target, estimator, rgps1, rgps2, ilp1, ilp2);
							break;
						}
						// else cannot use this pair, fall through the loop and try the next one
					}
				}
			}
		}
	}
}