public abstract class SetOperation extends Object
Modifier and Type | Method and Description |
---|---|
static SetOperationBuilder |
builder()
Makes a new builder
|
abstract Family |
getFamily()
Gets the Family of this SetOperation
|
static int |
getMaxAnotBResultBytes(int nomEntries)
Returns the maximum number of bytes for the returned CompactSketch, given the
value of nomEntries of the first sketch A of AnotB.
|
static int |
getMaxIntersectionBytes(int nomEntries)
Returns the maximum required storage bytes given a nomEntries parameter for Intersection
operations
|
static int |
getMaxUnionBytes(int nomEntries)
Returns the maximum required storage bytes given a nomEntries parameter for Union operations
|
static SetOperation |
heapify(org.apache.datasketches.memory.Memory srcMem)
Heapify takes the SetOperations image in Memory and instantiates an on-heap
SetOperation using the
Default Update Seed.
|
static SetOperation |
heapify(org.apache.datasketches.memory.Memory srcMem,
long expectedSeed)
Heapify takes the SetOperation image in Memory and instantiates an on-heap
SetOperation using the given expectedSeed.
|
abstract boolean |
isSameResource(org.apache.datasketches.memory.Memory that)
Returns true if the backing resource of this is identical with the backing resource
of that.
|
static SetOperation |
wrap(org.apache.datasketches.memory.Memory srcMem)
Wrap takes the SetOperation image in Memory and refers to it directly.
|
static SetOperation |
wrap(org.apache.datasketches.memory.Memory srcMem,
long expectedSeed)
Wrap takes the SetOperation image in Memory and refers to it directly.
|
static SetOperation |
wrap(org.apache.datasketches.memory.WritableMemory srcMem)
Wrap takes the SetOperation image in Memory and refers to it directly.
|
static SetOperation |
wrap(org.apache.datasketches.memory.WritableMemory srcMem,
long expectedSeed)
Wrap takes the SetOperation image in Memory and refers to it directly.
|
public static final SetOperationBuilder builder()
public static SetOperation heapify(org.apache.datasketches.memory.Memory srcMem)
Note: Only certain set operators during stateful operations can be serialized and thus heapified.
srcMem
- an image of a SetOperation where the image seed hash matches the default seed hash.
See Memorypublic static SetOperation heapify(org.apache.datasketches.memory.Memory srcMem, long expectedSeed)
Note: Only certain set operators during stateful operations can be serialized and thus heapified.
srcMem
- an image of a SetOperation where the hash of the given expectedSeed matches the image seed hash.
See MemoryexpectedSeed
- the seed used to validate the given Memory image.
See Update Hash Seed.public static SetOperation wrap(org.apache.datasketches.memory.Memory srcMem)
Note: Only certain set operators during stateful operations can be serialized and thus wrapped.
srcMem
- an image of a SetOperation where the image seed hash matches the default seed hash.
See Memorypublic static SetOperation wrap(org.apache.datasketches.memory.Memory srcMem, long expectedSeed)
Note: Only certain set operators during stateful operations can be serialized and thus wrapped.
srcMem
- an image of a SetOperation where the hash of the given expectedSeed matches the image seed hash.
See MemoryexpectedSeed
- the seed used to validate the given Memory image.
See Update Hash Seed.public static SetOperation wrap(org.apache.datasketches.memory.WritableMemory srcMem)
Note: Only certain set operators during stateful operations can be serialized and thus wrapped.
srcMem
- an image of a SetOperation where the image seed hash matches the default seed hash.
See Memorypublic static SetOperation wrap(org.apache.datasketches.memory.WritableMemory srcMem, long expectedSeed)
Note: Only certain set operators during stateful operations can be serialized and thus wrapped.
srcMem
- an image of a SetOperation where the hash of the given expectedSeed matches the image seed hash.
See MemoryexpectedSeed
- the seed used to validate the given Memory image.
See Update Hash Seed.public static int getMaxUnionBytes(int nomEntries)
nomEntries
- Nominal Entries
This will become the ceiling power of 2 if it is not.public static int getMaxIntersectionBytes(int nomEntries)
nomEntries
- Nominal Entries
This will become the ceiling power of 2 if it is not.public static int getMaxAnotBResultBytes(int nomEntries)
nomEntries
- this value must be a power of 2.public abstract Family getFamily()
public abstract boolean isSameResource(org.apache.datasketches.memory.Memory that)
Note: Only certain set operators during stateful operations can be serialized. Only when they are stored into Memory will this be relevant.
that
- A different non-null objectCopyright © 2015–2022 The Apache Software Foundation. All rights reserved.