private void block() {
   IN_RESTORE_LATCH.trigger();
   // this mimics what happens in the HDFS client code.
   // an interrupt on a waiting object leads to an infinite loop
   try {
     synchronized (this) {
       wait();
     }
   } catch (InterruptedException e) {
     while (!isClosed()) {
       try {
         synchronized (this) {
           wait();
         }
       } catch (InterruptedException ignored) {
       }
     }
   }
 }