Class AllocationCache

java.lang.Object
org.apache.derby.impl.store.raw.data.AllocationCache

class AllocationCache extends Object
An auxiliary object to cache the allocation information for a file container. Only a FileContainer should use this object

The allocation cache contains an array of AllocExtents and 3 arrays of longs:

  1. ExtentPageNums[i] is the page number of the i'th extent
  2. lowRange[i] is the smallest page number managed by extent i
  3. hiRange[i] is the largest page number managed by extent i

Note thate extentPageNums and lowRange does not change once the extent has been created, but hiRange will change for the last extent as more pages are allocated.

Extents can be individually invalidated or the entire cache (all extends) can be invalidated at once.

MT - unsafe Synrhonized access to all methods must be enforced by the caller of AllocationCache

  • Field Details

    • numExtents

      private int numExtents
    • lowRange

      private long[] lowRange
    • hiRange

      private long[] hiRange
    • isDirty

      private boolean[] isDirty
    • extents

      private AllocExtent[] extents
    • extentPageNums

      private long[] extentPageNums
    • isValid

      private boolean isValid
  • Constructor Details

    • AllocationCache

      protected AllocationCache()
  • Method Details