Beispiel #1
0
 public static void dropAllStoreObjects(RawStore store)
     throws MetaException, InvalidObjectException, InvalidInputException {
   try {
     Deadline.registerIfNot(100000);
     List<Function> funcs = store.getAllFunctions();
     for (Function func : funcs) {
       store.dropFunction(func.getDbName(), func.getFunctionName());
     }
     List<String> dbs = store.getAllDatabases();
     for (int i = 0; i < dbs.size(); i++) {
       String db = dbs.get(i);
       List<String> tbls = store.getAllTables(db);
       for (String tbl : tbls) {
         Deadline.startTimer("getPartition");
         List<Partition> parts = store.getPartitions(db, tbl, 100);
         for (Partition part : parts) {
           store.dropPartition(db, tbl, part.getValues());
         }
         store.dropTable(db, tbl);
       }
       store.dropDatabase(db);
     }
     List<String> roles = store.listRoleNames();
     for (String role : roles) {
       store.removeRole(role);
     }
   } catch (NoSuchObjectException e) {
   }
 }
Beispiel #2
0
 private void initMS() {
   base.setConf(getConf());
 }