LOG.info("Writing some data to the table");
writeData(colsPerKey, recordSize, writeThreads, startKey, numKeys);
// flush the table
LOG.info("Flushing the table");
Admin admin = util.getHBaseAdmin();
admin.flush(getTablename());
// re-open the regions to make sure that the replicas are up to date
long refreshTime = conf.getLong(StorefileRefresherChore.REGIONSERVER_STOREFILE_REFRESH_PERIOD, 0);
if (refreshTime > 0 && refreshTime <= 10000) {
LOG.info("Sleeping " + refreshTime + "ms to ensure that the data is replicated");
Threads.sleep(refreshTime);
} else {
LOG.info("Reopening the table");
admin.disableTable(getTablename());
admin.enableTable(getTablename());
}
// We should only start the ChaosMonkey after the readers are started and have cached
// all of the region locations. Because the meta is not replicated, the timebounded reads
// will timeout if meta server is killed.