You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "JiangHua Zhu (Jira)" <ji...@apache.org> on 2022/10/19 11:07:00 UTC

[jira] [Created] (HDFS-16807) Improve legacy ClientProtocol#rename2() interface

JiangHua Zhu created HDFS-16807:
-----------------------------------

             Summary: Improve legacy ClientProtocol#rename2() interface
                 Key: HDFS-16807
                 URL: https://issues.apache.org/jira/browse/HDFS-16807
             Project: Hadoop HDFS
          Issue Type: Improvement
          Components: dfsclient
    Affects Versions: 3.3.3
            Reporter: JiangHua Zhu


In HDFS-2298, rename2() replaced rename(), which is a very meaningful improvement. It looks like some old customs are still preserved, they are:
1. When using the shell to execute the mv command, rename() is still used.
./bin/hdfs dfs -mv [source] [target]
{code:java}
In MoveCommands#Rename:
    protected void processPath(PathData src, PathData target) throws IOException {
      ......
      if (!target.fs.rename(src.path, target.path)) {
        // we have no way to know the actual error...
        throw new PathIOException(src.toString());
      }
    }
{code}

2. When NNThroughputBenchmark verifies the rename.
In NNThroughputBenchmark#RenameFileStats:
{code:java}
long executeOp(int daemonId, int inputIdx, String ignore)
    throws IOException {
      long start = Time.now();
      clientProto.rename(fileNames[daemonId][inputIdx],
                      destNames[daemonId][inputIdx]);
      long end = Time.now();
      return end-start;
    }
{code}

I think the interface should be kept uniform since rename() is deprecated. For NNThroughputBenchmark, it's easy. But it is not easy to improve MoveCommands, because it involves the transformation of FileSystem.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org