private static long getMaxMetricID(final TSDB tsdb) {
// first up, we need the max metric ID so we can split up the data table
// amongst threads.
final GetRequest get = new GetRequest(tsdb.uidTable(), new byte[] { 0 });
get.family("id".getBytes(CHARSET));
get.qualifier("metrics".getBytes(CHARSET));
ArrayList<KeyValue> row;
try {
row = tsdb.getClient().get(get).joinUninterruptibly();
if (row == null || row.isEmpty()) {
throw new IllegalStateException("No data in the metric max UID cell");