Java Code Examples for org.apache.flink.optimizer.dataproperties.RequestedGlobalProperties#setFullyReplicated()

The following examples show how to use org.apache.flink.optimizer.dataproperties.RequestedGlobalProperties#setFullyReplicated() . 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: CartesianProductDescriptor.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
protected List<GlobalPropertiesPair> createPossibleGlobalProperties() {
	ArrayList<GlobalPropertiesPair> pairs = new ArrayList<GlobalPropertiesPair>();
	
	if (this.allowBroadcastFirst) {
		// replicate first
		RequestedGlobalProperties replicated1 = new RequestedGlobalProperties();
		replicated1.setFullyReplicated();
		RequestedGlobalProperties any2 = new RequestedGlobalProperties();
		pairs.add(new GlobalPropertiesPair(replicated1, any2));
	}
	
	if (this.allowBroadcastSecond) {
		// replicate second
		RequestedGlobalProperties any1 = new RequestedGlobalProperties();
		RequestedGlobalProperties replicated2 = new RequestedGlobalProperties();
		replicated2.setFullyReplicated();
		pairs.add(new GlobalPropertiesPair(any1, replicated2));
	}

	return pairs;
}
 
Example 2
Source File: CartesianProductDescriptor.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
protected List<GlobalPropertiesPair> createPossibleGlobalProperties() {
	ArrayList<GlobalPropertiesPair> pairs = new ArrayList<GlobalPropertiesPair>();
	
	if (this.allowBroadcastFirst) {
		// replicate first
		RequestedGlobalProperties replicated1 = new RequestedGlobalProperties();
		replicated1.setFullyReplicated();
		RequestedGlobalProperties any2 = new RequestedGlobalProperties();
		pairs.add(new GlobalPropertiesPair(replicated1, any2));
	}
	
	if (this.allowBroadcastSecond) {
		// replicate second
		RequestedGlobalProperties any1 = new RequestedGlobalProperties();
		RequestedGlobalProperties replicated2 = new RequestedGlobalProperties();
		replicated2.setFullyReplicated();
		pairs.add(new GlobalPropertiesPair(any1, replicated2));
	}

	return pairs;
}
 
Example 3
Source File: CartesianProductDescriptor.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
protected List<GlobalPropertiesPair> createPossibleGlobalProperties() {
	ArrayList<GlobalPropertiesPair> pairs = new ArrayList<GlobalPropertiesPair>();
	
	if (this.allowBroadcastFirst) {
		// replicate first
		RequestedGlobalProperties replicated1 = new RequestedGlobalProperties();
		replicated1.setFullyReplicated();
		RequestedGlobalProperties any2 = new RequestedGlobalProperties();
		pairs.add(new GlobalPropertiesPair(replicated1, any2));
	}
	
	if (this.allowBroadcastSecond) {
		// replicate second
		RequestedGlobalProperties any1 = new RequestedGlobalProperties();
		RequestedGlobalProperties replicated2 = new RequestedGlobalProperties();
		replicated2.setFullyReplicated();
		pairs.add(new GlobalPropertiesPair(any1, replicated2));
	}

	return pairs;
}
 
Example 4
Source File: AbstractJoinDescriptor.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
protected List<GlobalPropertiesPair> createPossibleGlobalProperties() {
	ArrayList<GlobalPropertiesPair> pairs = new ArrayList<GlobalPropertiesPair>();
	
	if (repartitionAllowed) {
		// partition both (hash or custom)
		if (this.customPartitioner == null) {

			// we accept compatible partitionings of any type
			RequestedGlobalProperties partitioned_left_any = new RequestedGlobalProperties();
			RequestedGlobalProperties partitioned_right_any = new RequestedGlobalProperties();
			partitioned_left_any.setAnyPartitioning(this.keys1);
			partitioned_right_any.setAnyPartitioning(this.keys2);
			pairs.add(new GlobalPropertiesPair(partitioned_left_any, partitioned_right_any));

			// add strict hash partitioning of both inputs on their full key sets
			RequestedGlobalProperties partitioned_left_hash = new RequestedGlobalProperties();
			RequestedGlobalProperties partitioned_right_hash = new RequestedGlobalProperties();
			partitioned_left_hash.setHashPartitioned(this.keys1);
			partitioned_right_hash.setHashPartitioned(this.keys2);
			pairs.add(new GlobalPropertiesPair(partitioned_left_hash, partitioned_right_hash));
		}
		else {
			RequestedGlobalProperties partitioned_left = new RequestedGlobalProperties();
			partitioned_left.setCustomPartitioned(this.keys1, this.customPartitioner);

			RequestedGlobalProperties partitioned_right = new RequestedGlobalProperties();
			partitioned_right.setCustomPartitioned(this.keys2, this.customPartitioner);

			return Collections.singletonList(new GlobalPropertiesPair(partitioned_left, partitioned_right));
		}
		
		
		RequestedGlobalProperties partitioned1 = new RequestedGlobalProperties();
		if (customPartitioner == null) {
			partitioned1.setAnyPartitioning(this.keys1);
		} else {
			partitioned1.setCustomPartitioned(this.keys1, this.customPartitioner);
		}
		
		RequestedGlobalProperties partitioned2 = new RequestedGlobalProperties();
		if (customPartitioner == null) {
			partitioned2.setAnyPartitioning(this.keys2);
		} else {
			partitioned2.setCustomPartitioned(this.keys2, this.customPartitioner);
		}
		
		pairs.add(new GlobalPropertiesPair(partitioned1, partitioned2));
	}
	
	if (broadcastSecondAllowed) {
		// replicate second
		RequestedGlobalProperties any1 = new RequestedGlobalProperties();
		RequestedGlobalProperties replicated2 = new RequestedGlobalProperties();
		replicated2.setFullyReplicated();
		pairs.add(new GlobalPropertiesPair(any1, replicated2));
	}
	
	if (broadcastFirstAllowed) {
		// replicate first
		RequestedGlobalProperties replicated1 = new RequestedGlobalProperties();
		replicated1.setFullyReplicated();
		RequestedGlobalProperties any2 = new RequestedGlobalProperties();
		pairs.add(new GlobalPropertiesPair(replicated1, any2));
	}
	return pairs;
}
 
Example 5
Source File: AbstractJoinDescriptor.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected List<GlobalPropertiesPair> createPossibleGlobalProperties() {
	ArrayList<GlobalPropertiesPair> pairs = new ArrayList<GlobalPropertiesPair>();
	
	if (repartitionAllowed) {
		// partition both (hash or custom)
		if (this.customPartitioner == null) {

			// we accept compatible partitionings of any type
			RequestedGlobalProperties partitioned_left_any = new RequestedGlobalProperties();
			RequestedGlobalProperties partitioned_right_any = new RequestedGlobalProperties();
			partitioned_left_any.setAnyPartitioning(this.keys1);
			partitioned_right_any.setAnyPartitioning(this.keys2);
			pairs.add(new GlobalPropertiesPair(partitioned_left_any, partitioned_right_any));

			// add strict hash partitioning of both inputs on their full key sets
			RequestedGlobalProperties partitioned_left_hash = new RequestedGlobalProperties();
			RequestedGlobalProperties partitioned_right_hash = new RequestedGlobalProperties();
			partitioned_left_hash.setHashPartitioned(this.keys1);
			partitioned_right_hash.setHashPartitioned(this.keys2);
			pairs.add(new GlobalPropertiesPair(partitioned_left_hash, partitioned_right_hash));
		}
		else {
			RequestedGlobalProperties partitioned_left = new RequestedGlobalProperties();
			partitioned_left.setCustomPartitioned(this.keys1, this.customPartitioner);

			RequestedGlobalProperties partitioned_right = new RequestedGlobalProperties();
			partitioned_right.setCustomPartitioned(this.keys2, this.customPartitioner);

			return Collections.singletonList(new GlobalPropertiesPair(partitioned_left, partitioned_right));
		}
		
		
		RequestedGlobalProperties partitioned1 = new RequestedGlobalProperties();
		if (customPartitioner == null) {
			partitioned1.setAnyPartitioning(this.keys1);
		} else {
			partitioned1.setCustomPartitioned(this.keys1, this.customPartitioner);
		}
		
		RequestedGlobalProperties partitioned2 = new RequestedGlobalProperties();
		if (customPartitioner == null) {
			partitioned2.setAnyPartitioning(this.keys2);
		} else {
			partitioned2.setCustomPartitioned(this.keys2, this.customPartitioner);
		}
		
		pairs.add(new GlobalPropertiesPair(partitioned1, partitioned2));
	}
	
	if (broadcastSecondAllowed) {
		// replicate second
		RequestedGlobalProperties any1 = new RequestedGlobalProperties();
		RequestedGlobalProperties replicated2 = new RequestedGlobalProperties();
		replicated2.setFullyReplicated();
		pairs.add(new GlobalPropertiesPair(any1, replicated2));
	}
	
	if (broadcastFirstAllowed) {
		// replicate first
		RequestedGlobalProperties replicated1 = new RequestedGlobalProperties();
		replicated1.setFullyReplicated();
		RequestedGlobalProperties any2 = new RequestedGlobalProperties();
		pairs.add(new GlobalPropertiesPair(replicated1, any2));
	}
	return pairs;
}
 
Example 6
Source File: AbstractJoinDescriptor.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected List<GlobalPropertiesPair> createPossibleGlobalProperties() {
	ArrayList<GlobalPropertiesPair> pairs = new ArrayList<GlobalPropertiesPair>();
	
	if (repartitionAllowed) {
		// partition both (hash or custom)
		if (this.customPartitioner == null) {

			// we accept compatible partitionings of any type
			RequestedGlobalProperties partitioned_left_any = new RequestedGlobalProperties();
			RequestedGlobalProperties partitioned_right_any = new RequestedGlobalProperties();
			partitioned_left_any.setAnyPartitioning(this.keys1);
			partitioned_right_any.setAnyPartitioning(this.keys2);
			pairs.add(new GlobalPropertiesPair(partitioned_left_any, partitioned_right_any));

			// add strict hash partitioning of both inputs on their full key sets
			RequestedGlobalProperties partitioned_left_hash = new RequestedGlobalProperties();
			RequestedGlobalProperties partitioned_right_hash = new RequestedGlobalProperties();
			partitioned_left_hash.setHashPartitioned(this.keys1);
			partitioned_right_hash.setHashPartitioned(this.keys2);
			pairs.add(new GlobalPropertiesPair(partitioned_left_hash, partitioned_right_hash));
		}
		else {
			RequestedGlobalProperties partitioned_left = new RequestedGlobalProperties();
			partitioned_left.setCustomPartitioned(this.keys1, this.customPartitioner);

			RequestedGlobalProperties partitioned_right = new RequestedGlobalProperties();
			partitioned_right.setCustomPartitioned(this.keys2, this.customPartitioner);

			return Collections.singletonList(new GlobalPropertiesPair(partitioned_left, partitioned_right));
		}
		
		
		RequestedGlobalProperties partitioned1 = new RequestedGlobalProperties();
		if (customPartitioner == null) {
			partitioned1.setAnyPartitioning(this.keys1);
		} else {
			partitioned1.setCustomPartitioned(this.keys1, this.customPartitioner);
		}
		
		RequestedGlobalProperties partitioned2 = new RequestedGlobalProperties();
		if (customPartitioner == null) {
			partitioned2.setAnyPartitioning(this.keys2);
		} else {
			partitioned2.setCustomPartitioned(this.keys2, this.customPartitioner);
		}
		
		pairs.add(new GlobalPropertiesPair(partitioned1, partitioned2));
	}
	
	if (broadcastSecondAllowed) {
		// replicate second
		RequestedGlobalProperties any1 = new RequestedGlobalProperties();
		RequestedGlobalProperties replicated2 = new RequestedGlobalProperties();
		replicated2.setFullyReplicated();
		pairs.add(new GlobalPropertiesPair(any1, replicated2));
	}
	
	if (broadcastFirstAllowed) {
		// replicate first
		RequestedGlobalProperties replicated1 = new RequestedGlobalProperties();
		replicated1.setFullyReplicated();
		RequestedGlobalProperties any2 = new RequestedGlobalProperties();
		pairs.add(new GlobalPropertiesPair(replicated1, any2));
	}
	return pairs;
}