private void executeAddKeySpace ( Tree statement ) { if ( ! CliMain . isConnected ( ) ) return ; // first value is the keyspace name, after that it is all key=value String keyspaceName = CliUtils . unescapeSQLString ( statement . getChild ( 0 ) . getText ( ) ) ; KsDef ksDef = new KsDef ( keyspaceName , DEFAULT_PLACEMENT_STRATEGY , new LinkedList < CfDef > ( ) ) ; try { String mySchemaVersion = thriftClient . system_add_keyspace ( updateKsDefAttributes ( statement , ksDef ) ) ; sessionState . out . println ( mySchemaVersion ) ; keyspacesMap . put ( keyspaceName , thriftClient . describe_keyspace ( keyspaceName ) ) ; } catch ( InvalidRequestException e ) { throw new RuntimeException ( e ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Add a keyspace