@Override
    public void completed(Set<URI> uris) {
      try {
        descriptor.close();

        FileAttributes fileAttributesForNotification = getFileAttributesForNotification(uris);

        infoMsg.setStorageInfo(fileAttributesForNotification.getStorageInfo());

        PnfsId pnfsId = getFileAttributes().getPnfsId();
        notifyNamespace(pnfsId, fileAttributesForNotification);

        try {
          repository.setState(pnfsId, ReplicaState.CACHED);
        } catch (IllegalTransitionException ignored) {
          /* Apparently the file is no longer precious. Most
           * likely it got deleted, which is fine, since the
           * flush already succeeded.
           */
        }
        done(null);

        LOGGER.info("Flushed {} to nearline storage: {}", pnfsId, Joiner.on(' ').join(uris));
      } catch (Exception e) {
        done(e);
      }
    }
 @Override
 public void completed(Set<Checksum> checksums) {
   Throwable error = null;
   try {
     if (checksumModule.hasPolicy(ChecksumModule.PolicyFlag.GET_CRC_FROM_HSM)) {
       LOGGER.info(
           "Obtained checksums {} for {} from HSM", checksums, getFileAttributes().getPnfsId());
       descriptor.addChecksums(checksums);
     }
     checksumModule.enforcePostRestorePolicy(descriptor);
     descriptor.commit();
     LOGGER.info("Staged {} from nearline storage.", getFileAttributes().getPnfsId());
   } catch (InterruptedException | CacheException | RuntimeException | Error e) {
     error = e;
   } catch (NoSuchAlgorithmException e) {
     error = new CacheException(1010, "Checksum calculation failed: " + e.getMessage(), e);
   } catch (IOException e) {
     error =
         new DiskErrorCacheException(
             "Checksum calculation failed due to I/O error: " + e.getMessage(), e);
   } finally {
     done(error);
   }
 }
 public void completed(Void result) {
   LOGGER.info("Removed {} from nearline storage.", uri);
   removeRequests.removeAndCallback(uri, null);
 }