Search in sources :

Example 1 with WindowKey

use of org.apache.flink.table.runtime.util.WindowKey in project flink by apache.

the class WindowBytesHashMapTest method generateRandomKeys.

@Override
public WindowKey[] generateRandomKeys(int num) {
    final Random rnd = new Random(RANDOM_SEED);
    BinaryRowData[] keys = getRandomizedInputs(num, rnd, true);
    WindowKey[] windowKeys = new WindowKey[num];
    for (int i = 0; i < num; i++) {
        windowKeys[i] = new WindowKey(rnd.nextLong(), keys[i]);
    }
    return windowKeys;
}
Also used : Random(java.util.Random) BinaryRowData(org.apache.flink.table.data.binary.BinaryRowData) WindowKey(org.apache.flink.table.runtime.util.WindowKey)

Example 2 with WindowKey

use of org.apache.flink.table.runtime.util.WindowKey in project flink by apache.

the class WindowBytesMultiMapTest method generateRandomKeys.

@Override
public WindowKey[] generateRandomKeys(int num) {
    final Random rnd = new Random(RANDOM_SEED);
    BinaryRowData[] keys = getRandomizedInputs(num, rnd, true);
    WindowKey[] windowKeys = new WindowKey[num];
    for (int i = 0; i < num; i++) {
        windowKeys[i] = new WindowKey(rnd.nextLong(), keys[i]);
    }
    return windowKeys;
}
Also used : Random(java.util.Random) BinaryRowData(org.apache.flink.table.data.binary.BinaryRowData) WindowKey(org.apache.flink.table.runtime.util.WindowKey)

Example 3 with WindowKey

use of org.apache.flink.table.runtime.util.WindowKey in project flink by apache.

the class WindowKeySerializer method deserialize.

@Override
public WindowKey deserialize(DataInputView source) throws IOException {
    long window = source.readLong();
    RowData key = keySerializer.deserialize(source);
    return new WindowKey(window, key);
}
Also used : RowData(org.apache.flink.table.data.RowData) BinaryRowData(org.apache.flink.table.data.binary.BinaryRowData) WindowKey(org.apache.flink.table.runtime.util.WindowKey)

Aggregations

BinaryRowData (org.apache.flink.table.data.binary.BinaryRowData)3 WindowKey (org.apache.flink.table.runtime.util.WindowKey)3 Random (java.util.Random)2 RowData (org.apache.flink.table.data.RowData)1