it.unimi.di.mg4j.index.cluster
Interface DocumentalPartitioningStrategy

All Superinterfaces:
PartitioningStrategy, Serializable
All Known Implementing Classes:
ContiguousDocumentalStrategy

public interface DocumentalPartitioningStrategy
extends PartitioningStrategy

A way to associate a document with a local index out of a given set and a local document number in the local index.

When partitioning documentally an index, we need a way to associate to each global document pointer a local index (the index that will contain the postings of that document) and a local document pointer (the document pointer actually represented in the local index).

Usually, a documental partitioning strategy has a matching DocumentalClusteringStrategy whose methods satisfy the following equations:

 globalPointer(localIndex(d), localPointer(d)) = d
 <localIndex(globalPointer(i, l)), localPointer(globalPointer(i, l))> = <i, l>
 

Author:
Alessandro Arrabito, Sebastiano Vigna

Method Summary
 int localIndex(int globalPointer)
          Returns the index to which a given global document pointer is be mapped by this strategy.
 int localPointer(int globalPointer)
          Returns the local document pointer corresponding to a global document pointer.
 int numberOfDocuments(int localIndex)
          Returns the number of documents that will be assigned to the given local index.
 
Methods inherited from interface it.unimi.di.mg4j.index.cluster.PartitioningStrategy
numberOfLocalIndices, properties
 

Method Detail

localIndex

int localIndex(int globalPointer)
Returns the index to which a given global document pointer is be mapped by this strategy.

Parameters:
globalPointer - a global document pointer.
Returns:
the corresponding local index.

localPointer

int localPointer(int globalPointer)
Returns the local document pointer corresponding to a global document pointer.

Parameters:
globalPointer - a global document pointer.
Returns:
the corresponding local document pointer.

numberOfDocuments

int numberOfDocuments(int localIndex)
Returns the number of documents that will be assigned to the given local index.

Parameters:
localIndex - the local index.
Returns:
the number of documents that will be assigned to localIndex.