System.out.println("Adding content combiner on the fields: " + textIndexFamilies);
IteratorSetting setting = new IteratorSetting(10, TextIndexCombiner.class);
List<Column> columns = new ArrayList<Column>();
for (String family : StringUtils.split(textIndexFamilies, ',')) {
columns.add(new Column("fi\0" + family));
}
TextIndexCombiner.setColumns(setting, columns);
TextIndexCombiner.setLossyness(setting, true);
tops.attachIterator(tableName, setting, EnumSet.allOf(IteratorScope.class));
}
// Set the locality group for the full content column family
tops.setLocalityGroups(tableName, Collections.singletonMap("WikipediaDocuments", Collections.singleton(new Text(WikipediaMapper.DOCUMENT_COLUMN_FAMILY))));
}
if (!tops.exists(indexTableName)) {
tops.create(indexTableName);
// Add the UID combiner
IteratorSetting setting = new IteratorSetting(19, "UIDAggregator", GlobalIndexUidCombiner.class);
GlobalIndexUidCombiner.setCombineAllColumns(setting, true);
GlobalIndexUidCombiner.setLossyness(setting, true);
tops.attachIterator(indexTableName, setting, EnumSet.allOf(IteratorScope.class));
}
if (!tops.exists(reverseIndexTableName)) {
tops.create(reverseIndexTableName);
// Add the UID combiner
IteratorSetting setting = new IteratorSetting(19, "UIDAggregator", GlobalIndexUidCombiner.class);
GlobalIndexUidCombiner.setCombineAllColumns(setting, true);
GlobalIndexUidCombiner.setLossyness(setting, true);
tops.attachIterator(reverseIndexTableName, setting, EnumSet.allOf(IteratorScope.class));
}
if (!tops.exists(metadataTableName)) {
// Add the SummingCombiner with VARLEN encoding for the frequency column
tops.create(metadataTableName);
IteratorSetting setting = new IteratorSetting(10, SummingCombiner.class);
SummingCombiner.setColumns(setting, Collections.singletonList(new Column("f")));
SummingCombiner.setEncodingType(setting, SummingCombiner.Type.VARLEN);
tops.attachIterator(metadataTableName, setting, EnumSet.allOf(IteratorScope.class));
}
}