/** * Returns true if the storage directory on the given directory is already * loaded. * @param location the {@link StorageLocation} * @throws IOException if failed to get canonical path. */ protected boolean containsStorageDir(StorageLocation location) throws IOException { for (StorageDirectory sd : storageDirs) { if (location.matchesStorageDirectory(sd)) { return true; } } return false; }
/** * Returns true if the storage directory on the given location is already * loaded. * @param location the {@link StorageLocation} * @param bpid the block pool id * @return true if the location matches to any existing storage directories * @throws IOException IOException if failed to read location * or storage directory path */ protected boolean containsStorageDir(StorageLocation location, String bpid) throws IOException { for (StorageDirectory sd : storageDirs) { if (location.matchesStorageDirectory(sd, bpid)) { return true; } } return false; }
public boolean matchesStorageDirectory(StorageDirectory sd, String bpid) throws IOException { if (sd.getStorageLocation().getStorageType() == StorageType.PROVIDED && storageType == StorageType.PROVIDED) { return matchesStorageDirectory(sd); } if (sd.getStorageLocation().getStorageType() == StorageType.PROVIDED || storageType == StorageType.PROVIDED) { // only one PROVIDED storage directory can exist; so this cannot match! return false; } // both storage directories are local return this.getBpURI(bpid, Storage.STORAGE_DIR_CURRENT).normalize() .equals(sd.getRoot().toURI().normalize()); }
results.newLocations.iterator(); newLocationItr.hasNext();) { StorageLocation newLocation = newLocationItr.next(); if (newLocation.matchesStorageDirectory(dir)) { StorageLocation oldLocation = existingStorageLocations.get( newLocation.getNormalizedUri().toString());