Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-10843

TestGridmixRecord unit tests failure on PowerPC

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0, 2.3.0, 2.4.0, 2.4.1
    • 2.6.0
    • test, tools
    • None

    Description

      In TestGridmixRecord#binSortTest, the test expects the comparison result of WritableComparator.compareBytes, which uses UnsafeComparer, to be the integer difference rather than the documented "@return 0 if equal, < 0 if left is less than right, etc.".

      TestGridmixRecord#binSortTest code snippet

            final int chk = WritableComparator.compareBytes(
                out1.getData(), 0, out1.getLength(),
                out2.getData(), 0, out2.getLength());
            assertEquals(chk, x.compareTo(y));
            assertEquals(chk, cmp.compare(
                  out1.getData(), 0, out1.getLength(),
                  out2.getData(), 0, out2.getLength()));
      

      The code snippet below shows the Unsafe comparator behavior for non-little-endian machines.

      	if (!littleEndian) {
      	  return lessThanUnsigned(lw, rw) ? -1 : 1;
      	}
      

      Attachments

        1. HADOOP-10843.3.patch
          2 kB
          Jinghui Wang
        2. HADOOP-10843.2.patch
          2 kB
          Jinghui Wang
        3. HADOOP-10843.1.patch
          2 kB
          Jinghui Wang

        Activity

          People

            jwang302 Jinghui Wang
            jwang302 Jinghui Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: