src/java/org/apache/cassandra/db/SystemTable.java
/**
     * One of three things will happen if you try to read the system table:
     * 1. files are present and you can read them: great
     * 2. no files are there: great (new node is assumed)
     * 3. files are present but you can't read them: bad
     * @throws ConfigurationException
     */
One of three things will happen if you try to read the system table:
1. files are present and you can read them: great
2. no files are there: great (new node is assumed)
3. files are present but you can't read them: bad
@throws ConfigurationException
One of three things will happen if you try to read the system table : 1 . files are present and you can read them : great 2 . no files are there : great ( new node is assumed ) 3 . files are present but you can ' t read them : bad @throws ConfigurationException
public static void checkHealth() throws ConfigurationException, IOException
    {
        Table table = null;
        try
        {
            table = Table.open(Table.SYSTEM_TABLE);
        }
        catch (AssertionError err)
        {
            ConfigurationException ex = new ConfigurationException("Could not read system table!");
            ex.initCause(err);
            throw ex;
        }
        SortedSet<ByteBuffer> cols = new TreeSet<ByteBuffer>(BytesType.instance);
        cols.add(CLUSTERNAME);
        QueryFilter filter = QueryFilter.getNamesFilter(decorate(LOCATION_KEY), new QueryPath(STATUS_CF), cols);
        ColumnFamily cf = table.getColumnFamilyStore(STATUS_CF).getColumnFamily(filter);
        if (cf == null)
        {
            ColumnFamilyStore cfs = table.getColumnFamilyStore(STATUS_CF);
            if (!cfs.getSSTables().isEmpty())
                throw new ConfigurationException("Found system table files, but they couldn't be loaded!");
            RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, LOCATION_KEY);
            cf = ColumnFamily.create(Table.SYSTEM_TABLE, SystemTable.STATUS_CF);
            cf.addColumn(new Column(CLUSTERNAME, ByteBufferUtil.bytes(DatabaseDescriptor.getClusterName()), LamportClock.getVersion()));
            rm.add(cf);
            rm.apply();
            return;
        }
        IColumn clusterCol = cf.getColumn(CLUSTERNAME);
        assert clusterCol != null;
        String savedClusterName = ByteBufferUtil.string(clusterCol.value());
        if (!DatabaseDescriptor.getClusterName().equals(savedClusterName))
            throw new ConfigurationException("Saved cluster name " + savedClusterName + " != configured name " + DatabaseDescriptor.getClusterName());
    }
public static void checkHealth ( ) throws ConfigurationException , IOException { Table table = null ; try { table = Table . open ( Table . SYSTEM_TABLE ) ; } catch ( AssertionError err ) { ConfigurationException ex = new ConfigurationException ( "Could not read system table!" ) ; ex . initCause ( err ) ; throw ex ; } SortedSet < ByteBuffer > cols = new TreeSet < ByteBuffer > ( BytesType . instance ) ; cols . add ( CLUSTERNAME ) ; QueryFilter filter = QueryFilter . getNamesFilter ( decorate ( LOCATION_KEY ) , new QueryPath ( STATUS_CF ) , cols ) ; ColumnFamily cf = table . getColumnFamilyStore ( STATUS_CF ) . getColumnFamily ( filter ) ; if ( cf == null ) { ColumnFamilyStore cfs = table . getColumnFamilyStore ( STATUS_CF ) ; if ( ! cfs . getSSTables ( ) . isEmpty ( ) ) throw new ConfigurationException ( "Found system table files, but they couldn't be loaded!" ) ; RowMutation rm = new RowMutation ( Table . SYSTEM_TABLE , LOCATION_KEY ) ; cf = ColumnFamily . create ( Table . SYSTEM_TABLE , SystemTable . STATUS_CF ) ; cf . addColumn ( new Column ( CLUSTERNAME , ByteBufferUtil . bytes ( DatabaseDescriptor . getClusterName ( ) ) , LamportClock . getVersion ( ) ) ) ; rm . add ( cf ) ; rm . apply ( ) ; return ; } IColumn clusterCol = cf . getColumn ( CLUSTERNAME ) ; assert clusterCol != null ; String savedClusterName = ByteBufferUtil . string ( clusterCol . value ( ) ) ; if ( ! DatabaseDescriptor . getClusterName ( ) . equals ( savedClusterName ) ) throw new ConfigurationException ( "Saved cluster name " + savedClusterName + " != configured name " + DatabaseDescriptor . getClusterName ( ) ) ; }
One of three things will happen if you try to read the system table:
 1. files are present and you can read them: great
 2. no files are there: great (new node is assumed)
 3. files are present but you can't read them: bad
 @throws ConfigurationException
One of three things will happen if you try to read the system table : 1 . files are present and you can read them : great 2 . no files are there : great ( new node is assumed ) 3 . files are present but you can ' t read them : bad @throws ConfigurationException
// this happens when a user switches from OPP to RP. // this is a brand new node // no system files.  this is a new node.