Package com.yahoo.document
Class BucketIdFactory
java.lang.Object
com.yahoo.document.BucketIdFactory
A bucket id contains bit used for various purposes. In most use cases, these can use the default
settings, but the number of bits used for the different purposes is configurable, to allow for
special uses.
Because of this, bucket ids cannot be generated without knowing how the bucket id is configured to
be put together, so all bucket ids must be generated by this factory class.
For more information about what the sub parts of a bucket id actually is, read the bucket splitting documentation.
- Author:
- HÃ¥kon Humberset
-
Constructor Summary
ConstructorDescriptionCreate a factory, using the default configuration.BucketIdFactory
(int locationBits, int gidBits, int countBits) Create a factory, using the provided configuration.BucketIdFactory
(String configId) Create a factory, with parameters gotten from configuration. -
Method Summary
Modifier and TypeMethodDescriptiongetBucketId
(DocumentId doc) Get the bucket id for a given document.int
int
int
-
Constructor Details
-
BucketIdFactory
public BucketIdFactory()Create a factory, using the default configuration. -
BucketIdFactory
public BucketIdFactory(int locationBits, int gidBits, int countBits) Create a factory, using the provided configuration.- Parameters:
gidBits
- How many bits that are used to specify gidbits.
-
BucketIdFactory
Create a factory, with parameters gotten from configuration. TODO: Not implemented yet- Parameters:
configId
- The config id from where to get config.
-
-
Method Details
-
getLocationBitCount
public int getLocationBitCount()- Returns:
- Get number of bits used for storing of LSB part of location.
-
getGidBitCount
public int getGidBitCount()- Returns:
- Get number of bits used to specify gid.
-
getCountBitCount
public int getCountBitCount()- Returns:
- Get number of bits used to store bit count used.
-
getBucketId
Get the bucket id for a given document.- Parameters:
doc
- The doc.- Returns:
- The bucket id.
-