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

Routine "makeIntPair" is Not Correct

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            belugabehr David Mollitor Assign to me
            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

              Slack

                Issue deployment