public class SizeEncoder extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
mBitsPerBucket |
protected alluxio.client.file.cache.cuckoofilter.SizeEncoder.Bucket[] |
mBuckets |
protected int |
mMaxSizeBits |
protected int |
mNumBuckets |
protected int |
mSizeGroupBits |
Constructor and Description |
---|
SizeEncoder(int maxSizeBits,
int numBucketsBits)
Creates a new instance of
SizeEncoder . |
Modifier and Type | Method and Description |
---|---|
void |
add(int size)
Adds a new size to the encoder.
|
int |
dec(int group)
Decrements the size from the encoder.
|
String |
dumpInfo()
Get info of buckets in the encoder.
|
int |
encode(int size)
Encode the size into a group.
|
protected final int mMaxSizeBits
protected final int mSizeGroupBits
protected final int mBitsPerBucket
protected final int mNumBuckets
protected final alluxio.client.file.cache.cuckoofilter.SizeEncoder.Bucket[] mBuckets
public SizeEncoder(int maxSizeBits, int numBucketsBits)
SizeEncoder
.maxSizeBits
- the maximum size in bitsnumBucketsBits
- the number of prefix bits of sizepublic void add(int size)
size
- the size to addpublic int dec(int group)
group
- the group to decrementpublic int encode(int size)
size
- the size to encodepublic String dumpInfo()
Copyright © 2023. All Rights Reserved.