Package org.aksw.commons.io.slice
Class SliceInMemory<A>
java.lang.Object
org.aksw.commons.io.slice.SliceBase<A>
org.aksw.commons.io.slice.SliceInMemory<A>
- Type Parameters:
A-
- All Implemented Interfaces:
Slice<A>,SliceMetaDataBasic,org.aksw.commons.io.util.Sync
Slice implementation backed only by a single
Buffer.
This implementation never evicts data hence using it with large
amounts of data is subject to out of memory issues.- Author:
- raven
-
Field Summary
FieldsFields inherited from class org.aksw.commons.io.slice.SliceBase
arrayOps, hasDataCondition, readWriteLock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEvictionGuard(com.google.common.collect.RangeSet<Long> range) Protect a set of ranges from eviction.static <A> SliceInMemory<A>protected SliceMetaDataBasicAn accessor which allows for 'claiming' a sub-range of this slice.voidsync()Methods inherited from class org.aksw.commons.io.slice.SliceBase
getArrayOps, getFailedRanges, getHasDataCondition, getLoadedRanges, getMaximumKnownSize, getMinimumKnownSize, getReadWriteLock, setMaximumKnownSize, setMinimumKnownSizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aksw.commons.io.slice.Slice
computeFromMetaData, isComplete, mutateMetaData, readMetaDataMethods inherited from interface org.aksw.commons.io.slice.SliceMetaDataBasic
getGaps, getKnownSize, setKnownSize, updateMaximumKnownSize, updateMinimumKnownSize
-
Field Details
-
metaData
-
buffer
-
-
Constructor Details
-
SliceInMemory
-
-
Method Details
-
create
-
getMetaData
- Specified by:
getMetaDatain classSliceBase<A>
-
newSliceAccessor
Description copied from interface:SliceAn accessor which allows for 'claiming' a sub-range of this slice. The claimed range can be incrementally modified which may re-use already allocated resources (e.g. claimed pages) and thus improve performance. Sub-ranges of a slice can be loaded and iterated or inserted into. The sub-ranges can be modified dynamically. -
sync
- Throws:
IOException
-
addEvictionGuard
Description copied from interface:SliceProtect a set of ranges from eviction. If the slice does make use of eviction then this method can return null. Otherwise, a disposable must be returned. As long as it is not disposed no data in the range may get lost due to eviction. This method should not be used directly but via {@link SliceAccessor#addEvictionGuard(RangeSet))}.
-