Class 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 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.