Java Code Examples for org.apache.flink.core.io.GenericInputSplit#getSplitNumber()

The following examples show how to use org.apache.flink.core.io.GenericInputSplit#getSplitNumber() . 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: Generator.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
public void open(GenericInputSplit split) throws IOException {
	this.partitionId = split.getSplitNumber();
	// total number of partitions
	int numPartitions = split.getTotalNumberOfSplits();

	// ensure even distribution of records and keys
	Preconditions.checkArgument(
		numRecords % numPartitions == 0,
		"Records cannot be evenly distributed among partitions");
	Preconditions.checkArgument(
		numKeys % numPartitions == 0,
		"Keys cannot be evenly distributed among partitions");

	this.recordsPerPartition = numRecords / numPartitions;
	this.keysPerPartition = numKeys / numPartitions;

	this.recordCnt = 0;
}
 
Example 2
Source File: Generator.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void open(GenericInputSplit split) throws IOException {
	this.partitionId = split.getSplitNumber();
	// total number of partitions
	int numPartitions = split.getTotalNumberOfSplits();

	// ensure even distribution of records and keys
	Preconditions.checkArgument(
		numRecords % numPartitions == 0,
		"Records cannot be evenly distributed among partitions");
	Preconditions.checkArgument(
		numKeys % numPartitions == 0,
		"Keys cannot be evenly distributed among partitions");

	this.recordsPerPartition = numRecords / numPartitions;
	this.keysPerPartition = numKeys / numPartitions;

	this.recordCnt = 0;
}
 
Example 3
Source File: Generator.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void open(GenericInputSplit split) throws IOException {
	this.partitionId = split.getSplitNumber();
	// total number of partitions
	int numPartitions = split.getTotalNumberOfSplits();

	// ensure even distribution of records and keys
	Preconditions.checkArgument(
		numRecords % numPartitions == 0,
		"Records cannot be evenly distributed among partitions");
	Preconditions.checkArgument(
		numKeys % numPartitions == 0,
		"Keys cannot be evenly distributed among partitions");

	this.recordsPerPartition = numRecords / numPartitions;
	this.keysPerPartition = numKeys / numPartitions;

	this.recordCnt = 0;
}
 
Example 4
Source File: GenericInputFormat.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public void open(GenericInputSplit split) throws IOException {
	this.partitionNumber = split.getSplitNumber();
}
 
Example 5
Source File: NonRichGenericInputFormat.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public void open(GenericInputSplit split) throws IOException {
	this.partitionNumber = split.getSplitNumber();
}
 
Example 6
Source File: GenericInputFormat.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void open(GenericInputSplit split) throws IOException {
	this.partitionNumber = split.getSplitNumber();
}
 
Example 7
Source File: NonRichGenericInputFormat.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void open(GenericInputSplit split) throws IOException {
	this.partitionNumber = split.getSplitNumber();
}
 
Example 8
Source File: GenericInputFormat.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void open(GenericInputSplit split) throws IOException {
	this.partitionNumber = split.getSplitNumber();
}
 
Example 9
Source File: NonRichGenericInputFormat.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void open(GenericInputSplit split) throws IOException {
	this.partitionNumber = split.getSplitNumber();
}