private void testLinkReadDuringRename(FileSystem fs, Path rootDir) throws IOException {
    Path originalPath = new Path(rootDir, "test.file");
    Path archivedPath = new Path(rootDir, "archived.file");

    writeSomeData(fs, originalPath, 256 << 20, (byte) 2);

    List<Path> files = new ArrayList<>();
    files.add(originalPath);
    files.add(archivedPath);

    FileLink link = new FileLink(files);
    FSDataInputStream in = link.open(fs);
    try {
      byte[] data = new byte[8192];
      long size = 0;

      // Read from origin
      int n = in.read(data);
      dataVerify(data, n, (byte) 2);
      size += n;

      if (FSUtils.WINDOWS) {
        in.close();
      }

      // Move origin to archive
      assertFalse(fs.exists(archivedPath));
      fs.rename(originalPath, archivedPath);
      assertFalse(fs.exists(originalPath));
      assertTrue(fs.exists(archivedPath));

      if (FSUtils.WINDOWS) {
        in = link.open(fs); // re-read from beginning
        in.read(data);
      }

      // Try to read to the end
      while ((n = in.read(data)) > 0) {
        dataVerify(data, n, (byte) 2);
        size += n;
      }

      assertEquals(256 << 20, size);
    } finally {
      in.close();
      if (fs.exists(originalPath)) fs.delete(originalPath, true);
      if (fs.exists(archivedPath)) fs.delete(archivedPath, true);
    }
  }
Test that link is still readable even when the current file gets renamed.
hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java