public class ContiguousDocumentalStrategy extends Object implements DocumentalPartitioningStrategy, DocumentalClusteringStrategy, Serializable
To partition an index in contiguous parts, you must provide an array of cutpoints, which define each part. More precisely, given cutpoints c0,c2,…,ck, the global index will be partitioned into k local indices containing the documents from c0 (included) to c1 (excluded), from c1 (included) to c2 and so on. Note that necessarily c0=0 and ck=N, where N is the number of globally indexed documents.
The properties() method provides two properties, pointerfrom and pointerto,
that contain the first (included) and last (excluded) pointer in the local index.
| Constructor and Description |
|---|
ContiguousDocumentalStrategy(long... cutPoint)
Creates a new contiguous strategy with the given cutpoints.
|
| Modifier and Type | Method and Description |
|---|---|
long |
globalPointer(int localIndex,
long localPointer)
Returns the global document pointer given a local index and a local document pointer.
|
int |
localIndex(long globalPointer)
Returns the index to which a given global document pointer is be mapped by this strategy.
|
long |
localPointer(long globalPointer)
Returns the local document pointer corresponding to a global document pointer.
|
long |
numberOfDocuments(int localIndex)
Returns the number of documents that will be assigned to the given local index.
|
int |
numberOfLocalIndices()
Returns the number of local indices created by this strategy.
|
Properties[] |
properties()
Returns an array of properties, one for each local index, that specify additional information about local indices.
|
String |
toString() |
public ContiguousDocumentalStrategy(long... cutPoint)
Note that DocumentalStrategies has ready-made factory
methods for the common cases.
cutPoint - an array of cutpoints (see the class description}.public int numberOfLocalIndices()
PartitioningStrategynumberOfLocalIndices in interface ClusteringStrategynumberOfLocalIndices in interface PartitioningStrategypublic int localIndex(long globalPointer)
DocumentalPartitioningStrategylocalIndex in interface DocumentalPartitioningStrategyglobalPointer - a global document pointer.public long localPointer(long globalPointer)
DocumentalPartitioningStrategylocalPointer in interface DocumentalClusteringStrategylocalPointer in interface DocumentalPartitioningStrategyglobalPointer - a global document pointer.public long globalPointer(int localIndex,
long localPointer)
DocumentalClusteringStrategyglobalPointer in interface DocumentalClusteringStrategylocalIndex - the local index.localPointer - the local document pointer in localIndex.public long numberOfDocuments(int localIndex)
DocumentalPartitioningStrategynumberOfDocuments in interface DocumentalClusteringStrategynumberOfDocuments in interface DocumentalPartitioningStrategylocalIndex - the local index.localIndex.public Properties[] properties()
PartitioningStrategyproperties in interface PartitioningStrategynull (in that case, the set of properties is assumed to be empty).