private void setupDefaultUser ( ) { try { // insert the default superuser if AUTH_KS.CREDENTIALS_CF is empty. if ( ! hasExistingUsers ( ) ) { process ( String . format ( "INSERT INTO %s.%s (username, salted_hash) VALUES ('%s', '%s') USING TIMESTAMP 0" , Auth . AUTH_KS , CREDENTIALS_CF , DEFAULT_USER_NAME , escape ( hashpw ( DEFAULT_USER_PASSWORD ) ) ) , ConsistencyLevel . ONE ) ; logger . info ( "PasswordAuthenticator created default user '{}'" , DEFAULT_USER_NAME ) ; } } catch ( RequestExecutionException e ) { logger . warn ( "PasswordAuthenticator skipped default user setup: some nodes were not ready" ) ; } }
if there are no users yet - add default superuser .