public class SimpleCuckooTable extends Object implements CuckooTable
Constructor and Description |
---|
SimpleCuckooTable(BitSet bitSet,
int numBuckets,
int tagsPerBucket,
int bitsPerTag)
Create a single cuckoo table on given bit set.
|
Modifier and Type | Method and Description |
---|---|
TagPosition |
deleteTag(int bucketIndex,
int tag)
Delete a tag in specified bucket and return its position.
|
TagPosition |
findTag(int bucketIndex,
int tag)
Find a tag in specified bucket and return its position.
|
TagPosition |
findTag(int bucketIndex1,
int bucketIndex2,
int tag)
Find a tag in specified two buckets and return its position.
|
int |
getBitsPerTag() |
int |
getNumBuckets() |
int |
getNumTagsPerBuckets() |
int |
getSizeInBytes() |
int |
getSizeInTags() |
int |
insertOrKickTag(int bucketIndex,
int tag)
Insert a tag into specified bucket.
|
int |
readTag(int bucketIndex,
int slotIndex)
Reads the value of tag in specified position.
|
void |
writeTag(int bucketIndex,
int slotIndex,
int tag)
Set the value of tag in specified position.
|
public SimpleCuckooTable(BitSet bitSet, int numBuckets, int tagsPerBucket, int bitsPerTag)
bitSet
- the bit set will be used as the underlying storagenumBuckets
- the number of buckets this table hastagsPerBucket
- the number of slots each bucket hasbitsPerTag
- the number of bits each slot haspublic int readTag(int bucketIndex, int slotIndex)
CuckooTable
readTag
in interface CuckooTable
bucketIndex
- the bucket indexslotIndex
- the slot in bucketpublic void writeTag(int bucketIndex, int slotIndex, int tag)
CuckooTable
writeTag
in interface CuckooTable
bucketIndex
- the bucket indexslotIndex
- the slot in buckettag
- the tag value to writepublic TagPosition findTag(int bucketIndex, int tag)
CuckooTable
findTag
in interface CuckooTable
bucketIndex
- the bucket indextag
- the tag value to findpublic TagPosition findTag(int bucketIndex1, int bucketIndex2, int tag)
CuckooTable
findTag
in interface CuckooTable
bucketIndex1
- the first bucket indexbucketIndex2
- the second bucket indextag
- the tag value to findpublic TagPosition deleteTag(int bucketIndex, int tag)
CuckooTable
deleteTag
in interface CuckooTable
bucketIndex
- the bucket to delete fromtag
- the tag value to findpublic int insertOrKickTag(int bucketIndex, int tag)
CuckooTable
insertOrKickTag
in interface CuckooTable
bucketIndex
- the bucket indextag
- the tag value to findpublic int getNumTagsPerBuckets()
getNumTagsPerBuckets
in interface CuckooTable
public int getNumBuckets()
getNumBuckets
in interface CuckooTable
public int getBitsPerTag()
getBitsPerTag
in interface CuckooTable
public int getSizeInBytes()
getSizeInBytes
in interface CuckooTable
public int getSizeInTags()
getSizeInTags
in interface CuckooTable
Copyright © 2023. All Rights Reserved.