public static void purgeIncompatibleHints() throws IOException
{
// 0.6->0.7
final ByteBuffer hintsPurged6to7 = ByteBufferUtil.bytes("Hints purged as part of upgrading from 0.6.x to 0.7");
Table table = Table.open(Table.SYSTEM_TABLE);
QueryFilter dotSeven = QueryFilter.getNamesFilter(decorate(COOKIE_KEY), new QueryPath(STATUS_CF), hintsPurged6to7);
ColumnFamily cf = table.getColumnFamilyStore(STATUS_CF).getColumnFamily(dotSeven);
if (cf == null)
{
// upgrading from 0.6 to 0.7.
logger.info("Upgrading to 0.7. Purging hints if there are any. Old hints will be snapshotted.");
new Truncation(Table.SYSTEM_TABLE, HintedHandOffManager.HINTS_CF).apply();
RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, COOKIE_KEY);
rm.add(new QueryPath(STATUS_CF, null, hintsPurged6to7), ByteBufferUtil.bytes("oh yes, it they were purged."), System.currentTimeMillis());
rm.apply();
}
}