private void executeUpdateColumnFamily ( Tree statement ) { if ( ! CliMain . isConnected ( ) || ! hasKeySpace ( ) ) return ; String cfName = CliCompiler . getColumnFamily ( statement , currentCfDefs ( ) ) ; try { // request correct cfDef from the server (we let that call include CQL3 cf even though // they can't be modified by thrift because the error message that will be thrown by // system_update_column_family will be more useful) CfDef cfDef = getCfDef ( thriftClient . describe_keyspace ( this . keySpace ) , cfName , true ) ; if ( cfDef == null ) throw new RuntimeException ( "Column Family " + cfName + " was not found in the current keyspace." ) ; String mySchemaVersion = thriftClient . system_update_column_family ( updateCfDefAttributes ( statement , cfDef ) ) ; sessionState . out . println ( mySchemaVersion ) ; keyspacesMap . put ( keySpace , thriftClient . describe_keyspace ( keySpace ) ) ; } catch ( InvalidRequestException e ) { throw new RuntimeException ( e ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Update existing column family identified by name