Esempio n. 1
0
 // lifted from TestAtomicOperation
 private HRegion createHRegion(
     byte[] tableName, String callingMethod, WAL log, Durability durability) throws IOException {
   HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));
   htd.setDurability(durability);
   HColumnDescriptor hcd = new HColumnDescriptor(FAMILY);
   htd.addFamily(hcd);
   HRegionInfo info = new HRegionInfo(htd.getTableName(), null, null, false);
   Path path = new Path(DIR + callingMethod);
   if (FS.exists(path)) {
     if (!FS.delete(path, true)) {
       throw new IOException("Failed delete of " + path);
     }
   }
   return HRegion.createHRegion(info, path, CONF, htd, log);
 }