JobConf job = new JobConf(getConf(), WriteRandomVectors.class);
// job.set("mapred.job.tracker", "local");
// job.set("fs.default.name", "file:///");
FileSystem fs = FileSystem.get(job);
RetrievalEnvironment env = new RetrievalEnvironment(indexPath, fs);
K = (int) env.readCollectionTermCount();
job.setJobName("WriteRandomVectors");
if (D <= 0 || K <= 0) {
throw new RuntimeException("parameters not read properly");
}