ensureTabletHasNoUnexpectedMetadataEntries(extent, mapFiles);
}
}
private void ensureTabletHasNoUnexpectedMetadataEntries(KeyExtent extent, SortedMap<String,DataFileValue> expectedMapFiles) throws Exception {
Scanner scanner = new ScannerImpl(HdfsZooInstance.getInstance(), SecurityConstants.getSystemCredentials(), Constants.METADATA_TABLE_ID,
Constants.NO_AUTHS);
scanner.setRange(extent.toMetadataRange());
HashSet<ColumnFQ> expectedColumns = new HashSet<ColumnFQ>();
expectedColumns.add(Constants.METADATA_DIRECTORY_COLUMN);
expectedColumns.add(Constants.METADATA_PREV_ROW_COLUMN);
expectedColumns.add(Constants.METADATA_TIME_COLUMN);
expectedColumns.add(Constants.METADATA_LOCK_COLUMN);
HashSet<Text> expectedColumnFamilies = new HashSet<Text>();
expectedColumnFamilies.add(Constants.METADATA_DATAFILE_COLUMN_FAMILY);
expectedColumnFamilies.add(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY);
expectedColumnFamilies.add(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);
expectedColumnFamilies.add(Constants.METADATA_LAST_LOCATION_COLUMN_FAMILY);
expectedColumnFamilies.add(Constants.METADATA_BULKFILE_COLUMN_FAMILY);
Iterator<Entry<Key,Value>> iter = scanner.iterator();
while (iter.hasNext()) {
Key key = iter.next().getKey();
if (!key.getRow().equals(extent.getMetadataEntry())) {
throw new Exception("Tablet " + extent + " contained unexpected " + Constants.METADATA_TABLE_NAME + " entry " + key);