@Override public ListenableFuture<Void> allocate() { LOGGER.debug("Allocating space for stage of {}.", getFileAttributes().getPnfsId()); return register( executor.submit( () -> { descriptor.allocate(descriptor.getFileAttributes().getSize()); return null; })); }
public FlushRequestImpl(NearlineStorage nearlineStorage, PnfsId pnfsId) throws CacheException, InterruptedException { super(nearlineStorage); infoMsg = new StorageInfoMessage(cellAddress.toString(), pnfsId, false); descriptor = repository.openEntry(pnfsId, NO_FLAGS); String path = descriptor.getFileAttributes().getStorageInfo().getKey("path"); if (path != null) { infoMsg.setBillingPath(path); } LOGGER.debug("Flush request created for {}.", pnfsId); }
private FileAttributes getFileAttributesForNotification(Set<URI> uris) throws CacheException { FileAttributes fileAttributes = descriptor.getFileAttributes(); StorageInfo storageInfo = fileAttributes.getStorageInfo().clone(); for (URI uri : uris) { try { HsmLocationExtractorFactory.validate(uri); storageInfo.addLocation(uri); storageInfo.isSetAddLocation(true); } catch (IllegalArgumentException e) { throw new CacheException(2, e.getMessage(), e); } } FileAttributes fileAttributesForNotification = new FileAttributes(); fileAttributesForNotification.setAccessLatency(fileAttributes.getAccessLatency()); fileAttributesForNotification.setRetentionPolicy(fileAttributes.getRetentionPolicy()); fileAttributesForNotification.setStorageInfo(storageInfo); fileAttributesForNotification.setSize(fileAttributes.getSize()); return fileAttributesForNotification; }
@Override public FileAttributes getFileAttributes() { return descriptor.getFileAttributes(); }