Package com.yahoo.document
Class BucketIdFactory
- java.lang.Object
-
- com.yahoo.document.BucketIdFactory
-
public class BucketIdFactory extends java.lang.Object
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
Constructors Constructor Description BucketIdFactory()
Create a factory, using the default configuration.BucketIdFactory(int locationBits, int gidBits, int countBits)
Create a factory, using the provided configuration.BucketIdFactory(java.lang.String configId)
Create a factory, with parameters gotten from configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BucketId
getBucketId(DocumentId doc)
Get the bucket id for a given document.int
getCountBitCount()
int
getGidBitCount()
int
getLocationBitCount()
-
-
-
Constructor Detail
-
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
public BucketIdFactory(java.lang.String configId)
Create a factory, with parameters gotten from configuration. TODO: Not implemented yet- Parameters:
configId
- The config id from where to get config.
-
-
Method Detail
-
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
public BucketId getBucketId(DocumentId doc)
Get the bucket id for a given document.- Parameters:
doc
- The doc.- Returns:
- The bucket id.
-
-