Java Code Examples for org.apache.flink.runtime.operators.shipping.ShipStrategyType#values()

The following examples show how to use org.apache.flink.runtime.operators.shipping.ShipStrategyType#values() . 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: TaskConfig.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public ShipStrategyType getOutputShipStrategy(int outputNum) {
	// check how many outputs are encoded in the config
	final int outputCnt = this.config.getInteger(OUTPUTS_NUM, -1);
	if (outputCnt < 1) {
		throw new CorruptConfigurationException("No output ship strategies are specified in the configuration.");
	}
	
	// sanity range checks
	if (outputNum < 0 || outputNum >= outputCnt) {
		throw new IllegalArgumentException("Invalid index for output shipping strategy.");
	}
	
	final int strategy = this.config.getInteger(OUTPUT_SHIP_STRATEGY_PREFIX + outputNum, -1);
	if (strategy == -1) {
		throw new CorruptConfigurationException("No output shipping strategy in configuration for output " + outputNum);
	} else if (strategy < 0 || strategy >= ShipStrategyType.values().length) {
		throw new CorruptConfigurationException("Illegal output shipping strategy in configuration for output "
																		+ outputNum + ": " + strategy);
	} else {
		return ShipStrategyType.values()[strategy];
	}
}
 
Example 2
Source File: TaskConfig.java    From flink with Apache License 2.0 6 votes vote down vote up
public ShipStrategyType getOutputShipStrategy(int outputNum) {
	// check how many outputs are encoded in the config
	final int outputCnt = this.config.getInteger(OUTPUTS_NUM, -1);
	if (outputCnt < 1) {
		throw new CorruptConfigurationException("No output ship strategies are specified in the configuration.");
	}
	
	// sanity range checks
	if (outputNum < 0 || outputNum >= outputCnt) {
		throw new IllegalArgumentException("Invalid index for output shipping strategy.");
	}
	
	final int strategy = this.config.getInteger(OUTPUT_SHIP_STRATEGY_PREFIX + outputNum, -1);
	if (strategy == -1) {
		throw new CorruptConfigurationException("No output shipping strategy in configuration for output " + outputNum);
	} else if (strategy < 0 || strategy >= ShipStrategyType.values().length) {
		throw new CorruptConfigurationException("Illegal output shipping strategy in configuration for output "
																		+ outputNum + ": " + strategy);
	} else {
		return ShipStrategyType.values()[strategy];
	}
}
 
Example 3
Source File: TaskConfig.java    From flink with Apache License 2.0 6 votes vote down vote up
public ShipStrategyType getOutputShipStrategy(int outputNum) {
	// check how many outputs are encoded in the config
	final int outputCnt = this.config.getInteger(OUTPUTS_NUM, -1);
	if (outputCnt < 1) {
		throw new CorruptConfigurationException("No output ship strategies are specified in the configuration.");
	}
	
	// sanity range checks
	if (outputNum < 0 || outputNum >= outputCnt) {
		throw new IllegalArgumentException("Invalid index for output shipping strategy.");
	}
	
	final int strategy = this.config.getInteger(OUTPUT_SHIP_STRATEGY_PREFIX + outputNum, -1);
	if (strategy == -1) {
		throw new CorruptConfigurationException("No output shipping strategy in configuration for output " + outputNum);
	} else if (strategy < 0 || strategy >= ShipStrategyType.values().length) {
		throw new CorruptConfigurationException("Illegal output shipping strategy in configuration for output "
																		+ outputNum + ": " + strategy);
	} else {
		return ShipStrategyType.values()[strategy];
	}
}