Java Code Examples for org.apache.flink.types.Record#updateBinaryRepresenation()
The following examples show how to use
org.apache.flink.types.Record#updateBinaryRepresenation() .
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: ChainedAllReduceDriverTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Override public Record reduce(Record value1, Record value2) throws Exception { IntValue v1 = value1.getField(0, IntValue.class); IntValue v2 = value2.getField(0, IntValue.class); // set value and force update of record; this updates and returns // value1 in order to test ChainedAllReduceDriver.collect() when // object reuse is enabled v1.setValue(v1.getValue() + v2.getValue()); value1.setField(0, v1); value1.updateBinaryRepresenation(); return value1; }
Example 2
Source File: UniformRecordGenerator.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Override public Record next(Record reuse) { if(!repeatKey) { if(valCnt >= numVals+startVal) { return null; } key.setValue(keyCnt++); value.setValue(valCnt); if(keyCnt == numKeys+startKey) { keyCnt = startKey; valCnt++; } } else { if(keyCnt >= numKeys+startKey) { return null; } key.setValue(keyCnt); value.setValue(valCnt++); if(valCnt == numVals+startVal) { valCnt = startVal; keyCnt++; } } reuse.setField(0, this.key); reuse.setField(1, this.value); reuse.updateBinaryRepresenation(); return reuse; }
Example 3
Source File: ChainedAllReduceDriverTest.java From flink with Apache License 2.0 | 5 votes |
@Override public Record reduce(Record value1, Record value2) throws Exception { IntValue v1 = value1.getField(0, IntValue.class); IntValue v2 = value2.getField(0, IntValue.class); // set value and force update of record; this updates and returns // value1 in order to test ChainedAllReduceDriver.collect() when // object reuse is enabled v1.setValue(v1.getValue() + v2.getValue()); value1.setField(0, v1); value1.updateBinaryRepresenation(); return value1; }
Example 4
Source File: UniformRecordGenerator.java From flink with Apache License 2.0 | 5 votes |
@Override public Record next(Record reuse) { if(!repeatKey) { if(valCnt >= numVals+startVal) { return null; } key.setValue(keyCnt++); value.setValue(valCnt); if(keyCnt == numKeys+startKey) { keyCnt = startKey; valCnt++; } } else { if(keyCnt >= numKeys+startKey) { return null; } key.setValue(keyCnt); value.setValue(valCnt++); if(valCnt == numVals+startVal) { valCnt = startVal; keyCnt++; } } reuse.setField(0, this.key); reuse.setField(1, this.value); reuse.updateBinaryRepresenation(); return reuse; }
Example 5
Source File: ChainedAllReduceDriverTest.java From flink with Apache License 2.0 | 5 votes |
@Override public Record reduce(Record value1, Record value2) throws Exception { IntValue v1 = value1.getField(0, IntValue.class); IntValue v2 = value2.getField(0, IntValue.class); // set value and force update of record; this updates and returns // value1 in order to test ChainedAllReduceDriver.collect() when // object reuse is enabled v1.setValue(v1.getValue() + v2.getValue()); value1.setField(0, v1); value1.updateBinaryRepresenation(); return value1; }
Example 6
Source File: UniformRecordGenerator.java From flink with Apache License 2.0 | 5 votes |
@Override public Record next(Record reuse) { if(!repeatKey) { if(valCnt >= numVals+startVal) { return null; } key.setValue(keyCnt++); value.setValue(valCnt); if(keyCnt == numKeys+startKey) { keyCnt = startKey; valCnt++; } } else { if(keyCnt >= numKeys+startKey) { return null; } key.setValue(keyCnt); value.setValue(valCnt++); if(valCnt == numVals+startVal) { valCnt = startVal; keyCnt++; } } reuse.setField(0, this.key); reuse.setField(1, this.value); reuse.updateBinaryRepresenation(); return reuse; }