Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-4716

Do not attempt to cache blocks over max array size

    XMLWordPrintableJSON

Details

    Description

      One might think you could do new byte[Integer.MAX_VALUE] in Java, but as I found when looking into ACCUMULO-4708 suprise you can't.

      According to the stack overflow post new byte[Integer.MAX_VALUE - 8] should be safe. I was able to do up to new byte[Integer.MAX_VALUE - 2] in my local testing.

      When Accumulo caches a block it reads it into a byte array. For example this code in CachableBlockFile.java does this when _currBlock.getRawSize() <= cache.getMaxSize().

      This code should ensure the size is less than min( cache.getMaxSize(), MAX_ARRAY_SIZE) inorder to read it into a byte array.

      Attachments

        Issue Links

          Activity

            People

              jmark99 Mark Owens
              kturner Keith Turner
              Votes:
              1 Vote for this issue
              Watchers:
              3 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