예제 #1
0
 private void removeFile(PnfsId pnfsId) {
   try {
     repository.setState(pnfsId, ReplicaState.REMOVED);
   } catch (IllegalTransitionException f) {
     LOGGER.warn(
         "File not found in name space, but failed to remove {}: {}", pnfsId, f.getMessage());
   } catch (CacheException f) {
     LOGGER.error(
         "File not found in name space, but failed to remove {}: {}", pnfsId, f.getMessage());
   } catch (InterruptedException f) {
     LOGGER.warn("File not found in name space, but failed to remove {}: {}", pnfsId, f);
   }
 }
예제 #2
0
    private void notifyNamespace(PnfsId pnfsid, FileAttributes fileAttributes)
        throws InterruptedException {
      while (true) {
        try {
          pnfs.fileFlushed(pnfsid, fileAttributes);
          break;
        } catch (CacheException e) {
          if (e.getRc() == CacheException.FILE_NOT_FOUND
              || e.getRc() == CacheException.NOT_IN_TRASH) {
            /* In case the file was deleted, we are presented
             * with the problem that the file is now on tape,
             * however the location has not been registered
             * centrally. Hence the copy on tape will not be
             * removed by the HSM cleaner. The sensible thing
             * seems to be to remove the file from tape here.
             * For now we ignore this issue (REVISIT).
             */
            break;
          }

          /* The message to the PnfsManager failed. There are several
           * possible reasons for this; we may have lost the
           * connection to the PnfsManager; the PnfsManager may have
           * lost its connection to the namespace or otherwise be in
           * trouble; bugs; etc.
           *
           * We keep retrying until we succeed. This will effectively
           * block this thread from flushing any other files, which
           * seems sensible when we have trouble talking to the
           * PnfsManager. If the pool crashes or gets restarted while
           * waiting here, we will end up flushing the file again. We
           * assume that the nearline storage is able to eliminate the
           * duplicate; or at least tolerate the duplicate (given that
           * this situation should be rare, we can live with a little
           * bit of wasted tape).
           */
          LOGGER.error(
              "Error notifying pnfsmanager about a flushed file: {} ({})",
              e.getMessage(),
              e.getRc());
        }
        TimeUnit.MINUTES.sleep(2);
      }
    }