src/java/org/apache/cassandra/db/SystemTable.java
/** if hints become incompatible across versions of cassandra, that logic (and associated purging) is managed here. */
if hints become incompatible across versions of cassandra, that logic (and associated purging) is managed here.
if hints become incompatible across versions of cassandra that logic ( and associated purging ) is managed here .
private static void purgeIncompatibleHints() throws IOException
    {
        ByteBuffer upgradeMarker = ByteBufferUtil.bytes("Pre-1.0 hints purged");
        Table table = Table.open(Table.SYSTEM_TABLE);
        QueryFilter filter = QueryFilter.getNamesFilter(decorate(COOKIE_KEY), new QueryPath(STATUS_CF), upgradeMarker);
        ColumnFamily cf = table.getColumnFamilyStore(STATUS_CF).getColumnFamily(filter);
        if (cf != null)
        {
            logger.debug("Pre-1.0 hints already purged");
            return;
        }
        ColumnFamilyStore hintsCfs = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(HintedHandOffManager.HINTS_CF);
        if (hintsCfs.getSSTables().size() > 0)
        {
            logger.info("Possible old-format hints found. Truncating");
            try
            {
                hintsCfs.truncate();
            }
            catch (Exception e)
            {
                throw new RuntimeException(e);
            }
        }
        logger.debug("Marking pre-1.0 hints purged");
        RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, COOKIE_KEY);
        rm.add(new QueryPath(STATUS_CF, null, upgradeMarker), ByteBufferUtil.bytes("oh yes, they were purged"), LamportClock.getVersion());
        rm.apply();
    }
private static void purgeIncompatibleHints ( ) throws IOException { ByteBuffer upgradeMarker = ByteBufferUtil . bytes ( "Pre-1.0 hints purged" ) ; Table table = Table . open ( Table . SYSTEM_TABLE ) ; QueryFilter filter = QueryFilter . getNamesFilter ( decorate ( COOKIE_KEY ) , new QueryPath ( STATUS_CF ) , upgradeMarker ) ; ColumnFamily cf = table . getColumnFamilyStore ( STATUS_CF ) . getColumnFamily ( filter ) ; if ( cf != null ) { logger . debug ( "Pre-1.0 hints already purged" ) ; return ; } ColumnFamilyStore hintsCfs = Table . open ( Table . SYSTEM_TABLE ) . getColumnFamilyStore ( HintedHandOffManager . HINTS_CF ) ; if ( hintsCfs . getSSTables ( ) . size ( ) > 0 ) { logger . info ( "Possible old-format hints found. Truncating" ) ; try { hintsCfs . truncate ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } logger . debug ( "Marking pre-1.0 hints purged" ) ; RowMutation rm = new RowMutation ( Table . SYSTEM_TABLE , COOKIE_KEY ) ; rm . add ( new QueryPath ( STATUS_CF , null , upgradeMarker ) , ByteBufferUtil . bytes ( "oh yes, they were purged" ) , LamportClock . getVersion ( ) ) ; rm . apply ( ) ; }
if hints become incompatible across versions of cassandra, that logic (and associated purging) is managed here.
if hints become incompatible across versions of cassandra that logic ( and associated purging ) is managed here .
// marker not found.  Snapshot + remove hints and add the marker