Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-23592

Routine "makeIntPair" is Not Correct

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 4.0.0
    • Component/s: llap
    • Target Version/s:

      Description

      BuddyAllocator.java
        // Utility methods used to store pairs of ints as long.
        private static long makeIntPair(int first, int second) {
          return ((long)first) << 32 | second;
        }
        private static int getFirstInt(long result) {
          return (int) (result >>> 32);
        }
        private static int getSecondInt(long result) {
          return (int) (result & ((1L << 32) - 1));
        }
      
          long result = LLAP.makeIntPair(Integer.MIN_VALUE, Integer.MIN_VALUE);
          if (LLAP.getFirstInt(result) != Integer.MIN_VALUE) {
             throw new Exception();
          }
          if (LLAP.getSecondInt(result) != Integer.MIN_VALUE) {
            throw new Exception();
         }
      /*
       * Exception in thread "main" java.lang.Exception
       * 	at org.test.TestMe.main(TestMe.java:19)
       */
      

      https://github.com/apache/hive/blob/4b670877c280b37c5776046f66d766079489b2a8/llap-server/src/java/org/apache/hadoop/hive/llap/cache/BuddyAllocator.java#L1677

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                belugabehr David Mollitor
                Reporter:
                belugabehr David Mollitor
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m