Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-14267

Add test_libhdfs_ops to libhdfs tests, mark libhdfs_read/write.c as examples

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0
    • Component/s: libhdfs, native, test
    • Labels:
      None

      Description

      test_libhdfs_ops.c provides test coverage for basic operations against libhdfs, but currently has to be run manually (e.g. mvn install does not run these tests). The goal of this patch is to add test_libhdfs_ops.c to the list of tests that are automatically run for libhdfs.

      It looks like test_libhdfs_ops.c was used in conjunction with hadoop-hdfs-project/hadoop-hdfs/src/main/native/tests/test-libhdfs.sh to run some tests against a mini DFS cluster. Now that the NativeMiniDfsCluster exists, it makes more sense to use that rather than rely on an external bash script to start a mini DFS cluster.

      The libhdfs-tests directory (which contains test_libhdfs_ops.c) contains two other files: test_libhdfs_read.c and test_libhdfs_write.c. At some point, these files might have been used in conjunction with test-libhdfs.sh to run some tests manually. However, they (1) largely overlap with the test coverage provided by test_libhdfs_ops.c and (2) are not designed to be run as unit tests. Thus I suggest we move these two files into a new folder called libhdfs-examples and use them to further document how users of libhdfs can use the API. We can move test-libhdfs.sh into the examples folder as well given that example files probably require the script to actually work.

        Attachments

        1. HDFS-14267.001.patch
          19 kB
          Sahil Takiar
        2. HDFS-14267.002.patch
          23 kB
          Sahil Takiar

          Activity

            People

            • Assignee:
              stakiar Sahil Takiar
              Reporter:
              stakiar Sahil Takiar
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: