Ejemplo n.º 1
0
 /**
  * This method does an RPC to hbase:meta. Do not call this method with a lock/synchronize held.
  *
  * @param hris The hris to check if empty in hbase:meta and if so, clean them up.
  */
 private void cleanIfNoMetaEntry(Set<HRegionInfo> hris) {
   if (hris.isEmpty()) return;
   for (HRegionInfo hri : hris) {
     try {
       // This is RPC to meta table. It is done while we have a synchronize on
       // regionstates. No progress will be made if meta is not available at this time.
       // This is a cleanup task. Not critical.
       if (MetaTableAccessor.getRegion(server.getConnection(), hri.getEncodedNameAsBytes())
           == null) {
         regionOffline(hri);
         FSUtils.deleteRegionDir(server.getConfiguration(), hri);
       }
     } catch (IOException e) {
       LOG.warn("Got exception while deleting " + hri + " directories from file system.", e);
     }
   }
 }