public static boolean isSameOzoneBucket(Path src, Path dst) {
    String[] src1 = getVolumeAndBucket(src);
    String[] dst1 = getVolumeAndBucket(dst);

    return ((src1[0] == null && dst1[0] == null) || (src1[0] != null && src1[0].equalsIgnoreCase(dst1[0]))) &&
        ((src1[1] == null && dst1[1] == null) || (src1[1] != null && src1[1].equalsIgnoreCase(dst1[1])));
  }
Checks whether the filesystem are equal, if they are equal and belongs to ozone then check if they belong to
same bucket and volume.
@param srcFs source filesystem
@param destFs target filesystem
@param src source path
@param dest target path
@return true if filesystems are equal, if Ozone fs, then the path belongs to same bucket-volume.
common/src/java/org/apache/hadoop/hive/common/FileUtils.java