Search in sources :

Example 1 with NativeMemory

use of com.yahoo.memory.NativeMemory in project Gaffer by gchq.

the class UnionSerialiser method deserialise.

@Override
public Union deserialise(final byte[] bytes) throws SerialisationException {
    final Union union = Sketches.setOperationBuilder().buildUnion();
    union.update(Sketch.heapify(new NativeMemory(bytes)));
    return union;
}
Also used : NativeMemory(com.yahoo.memory.NativeMemory) Union(com.yahoo.sketches.theta.Union)

Example 2 with NativeMemory

use of com.yahoo.memory.NativeMemory in project druid by druid-io.

the class SketchBufferAggregator method init.

@Override
public void init(ByteBuffer buf, int position) {
    if (nm == null) {
        nm = new NativeMemory(buf);
    }
    Memory mem = new MemoryRegion(nm, position, maxIntermediateSize);
    unions.put(position, (Union) SetOperation.builder().initMemory(mem).build(size, Family.UNION));
}
Also used : NativeMemory(com.yahoo.memory.NativeMemory) Memory(com.yahoo.memory.Memory) NativeMemory(com.yahoo.memory.NativeMemory) MemoryRegion(com.yahoo.memory.MemoryRegion)

Example 3 with NativeMemory

use of com.yahoo.memory.NativeMemory in project Gaffer by gchq.

the class DoublesUnionSerialiser method deserialise.

@Override
public DoublesUnion deserialise(final byte[] bytes) throws SerialisationException {
    final DoublesUnion union = DoublesUnion.builder().build();
    union.update(new NativeMemory(bytes));
    return union;
}
Also used : NativeMemory(com.yahoo.memory.NativeMemory) DoublesUnion(com.yahoo.sketches.quantiles.DoublesUnion)

Aggregations

NativeMemory (com.yahoo.memory.NativeMemory)3 Memory (com.yahoo.memory.Memory)1 MemoryRegion (com.yahoo.memory.MemoryRegion)1 DoublesUnion (com.yahoo.sketches.quantiles.DoublesUnion)1 Union (com.yahoo.sketches.theta.Union)1