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

TestGridmixRecord unit tests failure on PowerPC

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0, 2.3.0, 2.4.0, 2.4.1
    • Fix Version/s: 2.6.0
    • Component/s: test, tools
    • Labels:
      None
    • Target Version/s:

      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.1.patch
          2 kB
          Jinghui Wang
        2. HADOOP-10843.2.patch
          2 kB
          Jinghui Wang
        3. HADOOP-10843.3.patch
          2 kB
          Jinghui Wang

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: