예제 #1
0
 private static CreateTableStatement getCreateTableStatement(String cql) {
   CreateTableStatement statement;
   try {
     statement = (CreateTableStatement) QueryProcessor.parseStatement(cql).prepare().statement;
   } catch (RequestValidationException e) {
     // Cannot proceed if an error occurs
     throw new RuntimeException("Error configuring SSTable reader. Cannot proceed", e);
   }
   return statement;
 }
  public void setup() {
    Auth.setupTable(PERMISSIONS_CF, PERMISSIONS_CF_SCHEMA);

    try {
      String query =
          String.format(
              "SELECT permissions FROM %s.%s WHERE username = ? AND resource = ?",
              Auth.AUTH_KS, PERMISSIONS_CF);
      authorizeStatement =
          (SelectStatement) QueryProcessor.parseStatement(query).prepare().statement;
    } catch (RequestValidationException e) {
      throw new AssertionError(e); // not supposed to happen
    }
  }