Search in sources :

Example 1 with BufferSlice

use of org.apache.apex.malhar.lib.utils.serde.BufferSlice in project apex-malhar by apache.

the class InMemSpillableStateStore method getSync.

@Override
public Slice getSync(long bucketId, @NotNull Slice key) {
    Map<Slice, Slice> bucket = store.get(bucketId);
    if (bucket == null) {
        bucket = Maps.newHashMap();
        store.put(bucketId, bucket);
    }
    if (key.getClass() == Slice.class) {
        // The hashCode of Slice was not correct, so correct it
        key = new BufferSlice(key);
    }
    return bucket.get(key);
}
Also used : BufferSlice(org.apache.apex.malhar.lib.utils.serde.BufferSlice) Slice(com.datatorrent.netlet.util.Slice) BufferSlice(org.apache.apex.malhar.lib.utils.serde.BufferSlice)

Aggregations

Slice (com.datatorrent.netlet.util.Slice)1 BufferSlice (org.apache.apex.malhar.lib.utils.serde.BufferSlice)1