Java Code Examples for org.apache.flink.runtime.operators.testutils.types.IntPair#setKey()

The following examples show how to use org.apache.flink.runtime.operators.testutils.types.IntPair#setKey() . 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: HashTableITCase.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public IntPair next(IntPair reuse) {
	if (this.numLeft > 0) {
		this.numLeft--;
		reuse.setKey(this.key);
		reuse.setValue(this.value);
		return reuse;
	}
	else {
		return null;
	}
}
 
Example 2
Source File: UniformIntPairGenerator.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public IntPair next(IntPair target) {
	if(!repeatKey) {
		if(valCnt >= numVals) {
			return null;
		}
		
		target.setKey(keyCnt++);
		target.setValue(valCnt);
		
		if(keyCnt == numKeys) {
			keyCnt = 0;
			valCnt++;
		}
	} else {
		if(keyCnt >= numKeys) {
			return null;
		}
		
		target.setKey(keyCnt);
		target.setValue(valCnt++);
		
		if(valCnt == numVals) {
			valCnt = 0;
			keyCnt++;
		}
	}
	
	return target;
}
 
Example 3
Source File: RandomIntPairGenerator.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public IntPair next(IntPair reuse) {
	if (this.count++ < this.numRecords) {
		reuse.setKey(this.rnd.nextInt());
		reuse.setValue(this.rnd.nextInt());
		return reuse;
	} else {
		return null;
	}
}
 
Example 4
Source File: HashTableITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public IntPair next(IntPair reuse) {
	if (this.numLeft > 0) {
		this.numLeft--;
		reuse.setKey(this.key);
		reuse.setValue(this.value);
		return reuse;
	}
	else {
		return null;
	}
}
 
Example 5
Source File: UniformIntPairGenerator.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public IntPair next(IntPair target) {
	if(!repeatKey) {
		if(valCnt >= numVals) {
			return null;
		}
		
		target.setKey(keyCnt++);
		target.setValue(valCnt);
		
		if(keyCnt == numKeys) {
			keyCnt = 0;
			valCnt++;
		}
	} else {
		if(keyCnt >= numKeys) {
			return null;
		}
		
		target.setKey(keyCnt);
		target.setValue(valCnt++);
		
		if(valCnt == numVals) {
			valCnt = 0;
			keyCnt++;
		}
	}
	
	return target;
}
 
Example 6
Source File: RandomIntPairGenerator.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public IntPair next(IntPair reuse) {
	if (this.count++ < this.numRecords) {
		reuse.setKey(this.rnd.nextInt());
		reuse.setValue(this.rnd.nextInt());
		return reuse;
	} else {
		return null;
	}
}
 
Example 7
Source File: HashTableITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public IntPair next(IntPair reuse) {
	if (this.numLeft > 0) {
		this.numLeft--;
		reuse.setKey(this.key);
		reuse.setValue(this.value);
		return reuse;
	}
	else {
		return null;
	}
}
 
Example 8
Source File: UniformIntPairGenerator.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public IntPair next(IntPair target) {
	if(!repeatKey) {
		if(valCnt >= numVals) {
			return null;
		}
		
		target.setKey(keyCnt++);
		target.setValue(valCnt);
		
		if(keyCnt == numKeys) {
			keyCnt = 0;
			valCnt++;
		}
	} else {
		if(keyCnt >= numKeys) {
			return null;
		}
		
		target.setKey(keyCnt);
		target.setValue(valCnt++);
		
		if(valCnt == numVals) {
			valCnt = 0;
			keyCnt++;
		}
	}
	
	return target;
}
 
Example 9
Source File: RandomIntPairGenerator.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public IntPair next(IntPair reuse) {
	if (this.count++ < this.numRecords) {
		reuse.setKey(this.rnd.nextInt());
		reuse.setValue(this.rnd.nextInt());
		return reuse;
	} else {
		return null;
	}
}
 
Example 10
Source File: TestData.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public IntPair readWithKeyDenormalization(IntPair reuse, DataInputView source) throws IOException {
	reuse.setKey(source.readInt() + Integer.MIN_VALUE);
	reuse.setValue(source.readInt());
	return reuse;
}
 
Example 11
Source File: TestData.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public IntPair readWithKeyDenormalization(IntPair reuse, DataInputView source) throws IOException {
	reuse.setKey(source.readInt() + Integer.MIN_VALUE);
	reuse.setValue(source.readInt());
	return reuse;
}
 
Example 12
Source File: TestData.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public IntPair readWithKeyDenormalization(IntPair reuse, DataInputView source) throws IOException {
	reuse.setKey(source.readInt() + Integer.MIN_VALUE);
	reuse.setValue(source.readInt());
	return reuse;
}