Class SliceWithPagesSyncToDisk<A>

java.lang.Object
org.aksw.commons.io.slice.SliceBase<A>
org.aksw.commons.io.slice.SliceWithPagesSyncToDisk<A>
Type Parameters:
A - The collection type of what to store in the pages. Usually an an array such as Binding[] or byte[].
All Implemented Interfaces:
Slice<A>, SliceMetaDataBasic, SliceWithPages<A>, org.aksw.commons.io.util.Sync, org.aksw.commons.util.range.PageHelper

public class SliceWithPagesSyncToDisk<A> extends SliceBase<A> implements SliceWithPages<A>
A file-based slice implementation. The is one metadata file and one 'content' file for each page. The metadata file holds the information about which ranges of data have been loaded in the content files. Whenever a set of pages is updated, the metadata needs to be updated as well.
  • Field Details

    • logger

      protected org.slf4j.Logger logger
    • objectStore

      protected org.aksw.commons.store.object.key.api.ObjectStore objectStore
    • objectStoreBasePath

      protected org.aksw.commons.path.core.Path<String> objectStoreBasePath
    • pageCache

      protected org.aksw.commons.cache.async.AsyncClaimingCache<Long,BufferView<A>> pageCache
    • pageSize

      protected int pageSize
    • baseRanges

      protected org.aksw.commons.collection.rangeset.RangeSetDelegateMutable<Long> baseRanges
    • baseMetaData

      protected SliceMetaDataWithPages baseMetaData
    • baseMetaDataStatus

      protected org.aksw.commons.txn.impl.PathDiffState baseMetaDataStatus
    • liveMetaData

      protected SliceMetaDataWithPages liveMetaData
    • liveMetaDataLoadedRangesView

      protected com.google.common.collect.RangeSet<Long> liveMetaDataLoadedRangesView
      Cached view of the most recent loaded ranges Changing the value of 'this.liveMetaData' also changes this view's delegate
    • syncMetaData

      protected SliceMetaDataWithPages syncMetaData
    • metaDataIdentity

      protected org.aksw.commons.txn.impl.PathState metaDataIdentity
    • syncScheduler

      protected org.aksw.commons.util.concurrent.ScheduleOnce syncScheduler
    • liveGeneration

      protected int liveGeneration
      Attribute for advertising detection of external changes to the base data. Modification demands the global write lock. Whenever a change to the base data is detected (during sync) then the generation is incremented. All clients should then re-schedule their read/writes.
    • liveChanges

      protected RangeBufferDelegateMutable<A> liveChanges
    • syncChanges

      protected RangeBufferDelegateMutable<A> syncChanges
    • pageIdToFileName

      protected LongFunction<String> pageIdToFileName
  • Constructor Details

    • SliceWithPagesSyncToDisk

      public SliceWithPagesSyncToDisk(ArrayOps<A> arrayOps, org.aksw.commons.store.object.key.api.ObjectStore objectStore, org.aksw.commons.path.core.Path<String> objectStoreBasePath, int pageSize, Duration syncDelay)
  • Method Details