public BatchMultiIndexer(int clusterSize, File outputDirectory, String fragmentName) {
Preconditions.checkArgument(clusterSize > 0, "Invalid clusterSize.");
Preconditions.checkArgument(null != outputDirectory && outputDirectory.exists() && outputDirectory.isDirectory(), "check the output directory.");
this.clusterSize = clusterSize;
this.outputDirectory = outputDirectory;
hashFunction = new Hash(clusterSize);
indexManagers = new BatchIndexManager[clusterSize];
for (int i = 0; i < clusterSize; i++) {
IndexDescriptor id = new IndexDescriptor(clusterSize, i , fragmentName);
indexManagers[i] = new BatchIndexManager(id, new File(outputDirectory, "index-" + String.valueOf(i)));
}