Revert "HDFS-15884. RBF: Remove unused method getCreateLocation in RouterRpcServer (#2754). Contributed by tomscut."

This reverts commit e565b05c80.

The removed method needs to be used in HDFS-15423.
This commit is contained in:
Ayush Saxena 2021-04-13 23:28:42 +05:30
parent b088f46b68
commit 7d6f0ca0bd

View File

@ -776,6 +776,20 @@ public HdfsFileStatus create(String src, FsPermission masked,
replication, blockSize, supportedVersions, ecPolicyName, storagePolicy);
}
/**
* Get the location to create a file. It checks if the file already existed
* in one of the locations.
*
* @param src Path of the file to check.
* @return The remote location for this file.
* @throws IOException If the file has no creation location.
*/
RemoteLocation getCreateLocation(final String src) throws IOException {
final List<RemoteLocation> locations = getLocationsForPath(src, true);
return getCreateLocation(src, locations);
}
/**
* Get the location to create a file. It checks if the file already existed
* in one of the locations.