public class BucketIdFactory extends Object
Modifier and Type | Field and Description |
---|---|
private int |
countBits |
private int |
gidBits |
private long |
gidMask |
private long |
initialCount |
private int |
locationBits |
private long |
locationMask |
Constructor and Description |
---|
BucketIdFactory()
Create 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.
|
Modifier and Type | Method and Description |
---|---|
BucketId |
getBucketId(DocumentId doc)
Get the bucket id for a given document.
|
int |
getCountBitCount() |
int |
getGidBitCount() |
private long |
getGidContribution(byte[] gid)
Get the gid bit contribution in the bucket id, shifted to the correct
position in the id.
|
int |
getLocationBitCount() |
private final int gidBits
private final int locationBits
private final int countBits
private final long initialCount
private final long locationMask
private final long gidMask
public BucketIdFactory()
public BucketIdFactory(int locationBits, int gidBits, int countBits)
gidBits
- How many bits that are used to specify gidbits.public BucketIdFactory(String configId)
configId
- The config id from where to get config.public int getLocationBitCount()
public int getGidBitCount()
public int getCountBitCount()
private long getGidContribution(byte[] gid)
gid
- The gid we need to calculate contribution from.public BucketId getBucketId(DocumentId doc)
doc
- The doc.Copyright © 2017. All rights reserved.