Package com.illumon.iris.db.v2.ssms
Class LongSegmentedSortedMultiset
java.lang.Object
com.illumon.iris.db.v2.ssms.LongSegmentedSortedMultiset
- All Implemented Interfaces:
DbArrayBase,DbLongArray,LongSizedDataStructure,SegmentedSortedMultiSet<Long>,ToStringWithElements,Serializable
public final class LongSegmentedSortedMultiset
extends Object
implements SegmentedSortedMultiSet<Long>, DbLongArray
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.tables.dbarrays.DbLongArray
DbLongArray.IndirectNested classes/interfaces inherited from interface com.illumon.iris.db.v2.ssms.SegmentedSortedMultiSet
SegmentedSortedMultiSet.RemoveContext -
Field Summary
Fields inherited from interface com.illumon.iris.db.tables.dbarrays.DbArrayBase
NULL_ELEMENT_STRINGFields inherited from interface com.illumon.iris.db.tables.dbarrays.DbLongArray
serialVersionUIDFields inherited from interface com.illumon.iris.db.v2.ssms.SegmentedSortedMultiSet
SEGMENTED_SORTED_MULTISET_VALIDATIONFields inherited from interface com.illumon.util.format.ToStringWithElements
ARRAY_SIZE_WARNING, DEFAULT_ARRAY_SIZE_COPY, MAX_ARRAY_SIZE_COPY -
Constructor Summary
ConstructorsConstructorDescriptionLongSegmentedSortedMultiset(int leafSize) Create a LongSegmentedSortedArray with the given leafSize. -
Method Summary
Modifier and TypeMethodDescriptionvoidLongChunk<?>booleanvoidfillAddedChunk(WritableLongChunk<? extends Attributes.Values> chunk, int position) voidfillDateChunk(WritableChunk destChunk) voidfillKeyChunk(WritableChunk<?> keyChunk, int offset) voidfillRemovedChunk(WritableLongChunk<? extends Attributes.Values> chunk, int position) longget(long i) intgetAsDate(long i) Return a version of this DbArrayBase that is flattened out to only reference memory.getMax()longlonggetMin()longlongintlonggetPrev(long i) getPrevAsDate(long offset) intinthashCode()booleaninsert(WritableChunk<? extends Attributes.Values> valuesToInsert, WritableIntChunk<Attributes.ChunkLengths> counts) Insert new valuesToInsert into this SSMS.LongChunk<?>keyChunk()voidmoveBackToFront(SegmentedSortedMultiSet untypedDestination, long count) Remove count elements from the back of this SSM and add them to the front of the destination SSM.voidmoveFrontToBack(SegmentedSortedMultiSet untypedDestination, long count) Remove count elements from the front of this SSM and add them to the back of the destination SSM.booleanremove(SegmentedSortedMultiSet.RemoveContext removeContext, WritableChunk<? extends Attributes.Values> valuesToRemove, WritableIntChunk<Attributes.ChunkLengths> counts) Remove valuesToRemove from this SSA.voidsetTrackDeltas(boolean shouldTrackDeltas) longsize()The size of this data structure.subArray(long fromIndex, long toIndex) subArrayAsDate(long fromIndexInclusive, long toIndexExclusive) subArrayByPositions(long[] positions) subArrayByPositionsAsDates(long[] positions) long[]toArray()toString()longvoidvalidate()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.illumon.iris.db.tables.dbarrays.DbArrayBase
isEmptyMethods inherited from interface com.illumon.iris.db.tables.dbarrays.DbLongArray
fillChunk, getComponentType, toChunkMethods inherited from interface com.illumon.iris.db.util.LongSizedDataStructure
intSize, intSizeMethods inherited from interface com.illumon.util.format.ToStringWithElements
toString
-
Constructor Details
-
LongSegmentedSortedMultiset
public LongSegmentedSortedMultiset(int leafSize) Create a LongSegmentedSortedArray with the given leafSize.- Parameters:
leafSize- the maximumSize for any leaf
-
-
Method Details
-
insert
public boolean insert(WritableChunk<? extends Attributes.Values> valuesToInsert, WritableIntChunk<Attributes.ChunkLengths> counts) Description copied from interface:SegmentedSortedMultiSetInsert new valuesToInsert into this SSMS. The valuesToInsert to insert must be sorted, without duplicates. The valuesToInsert and counts chunks will be modified during this call, and the resulting chunks are undefined.- Specified by:
insertin interfaceSegmentedSortedMultiSet<Long>- Parameters:
valuesToInsert- the valuesToInsert to insertcounts- the number of times each value occurs- Returns:
- true if any new values were inserted
-
remove
public boolean remove(SegmentedSortedMultiSet.RemoveContext removeContext, WritableChunk<? extends Attributes.Values> valuesToRemove, WritableIntChunk<Attributes.ChunkLengths> counts) Remove valuesToRemove from this SSA. The valuesToRemove to remove must be sorted.- Specified by:
removein interfaceSegmentedSortedMultiSet<Long>- Parameters:
valuesToRemove- the valuesToRemove to removeremoveContext- removalContext- Returns:
- true if any values were removed.
-
validate
-
totalSize
public long totalSize()- Specified by:
totalSizein interfaceSegmentedSortedMultiSet<Long>- Returns:
- the total size of the set in elements (i.e. if A exists twice, 2 is returned not one)
-
getNodeSize
public int getNodeSize()- Specified by:
getNodeSizein interfaceSegmentedSortedMultiSet<Long>
-
getMin
- Specified by:
getMinin interfaceSegmentedSortedMultiSet<Long>
-
getMax
- Specified by:
getMaxin interfaceSegmentedSortedMultiSet<Long>
-
getMinLong
public long getMinLong() -
getMinCount
public long getMinCount()- Specified by:
getMinCountin interfaceSegmentedSortedMultiSet<Long>- Returns:
- the number of times the minimum value exists in this SSM.
-
getMaxLong
public long getMaxLong() -
getMaxCount
public long getMaxCount()- Specified by:
getMaxCountin interfaceSegmentedSortedMultiSet<Long>- Returns:
- the number of times the maximum value exists in this SSM.
-
moveFrontToBack
Description copied from interface:SegmentedSortedMultiSetRemove count elements from the front of this SSM and add them to the back of the destination SSM.The minimum element of this SSM must be greater than or equal to the maximum of destination.
- Specified by:
moveFrontToBackin interfaceSegmentedSortedMultiSet<Long>- Parameters:
untypedDestination- the SegmentedSortedMultiSet to append count elements tocount- how many elements to move to the destination
-
moveBackToFront
Description copied from interface:SegmentedSortedMultiSetRemove count elements from the back of this SSM and add them to the front of the destination SSM.The minimum element of this SSM must be less than or equal to the maximum of destination.
- Specified by:
moveBackToFrontin interfaceSegmentedSortedMultiSet<Long>- Parameters:
untypedDestination- the SegmentedSortedMultiSet to prepend count elements tocount- how many elements to move to the destination
-
keyChunk
- Specified by:
keyChunkin interfaceSegmentedSortedMultiSet<Long>
-
fillKeyChunk
- Specified by:
fillKeyChunkin interfaceSegmentedSortedMultiSet<Long>
-
countChunk
- Specified by:
countChunkin interfaceSegmentedSortedMultiSet<Long>
-
setTrackDeltas
public void setTrackDeltas(boolean shouldTrackDeltas) - Specified by:
setTrackDeltasin interfaceSegmentedSortedMultiSet<Long>
-
clearDeltas
public void clearDeltas()- Specified by:
clearDeltasin interfaceSegmentedSortedMultiSet<Long>
-
getAddedSize
public int getAddedSize()- Specified by:
getAddedSizein interfaceSegmentedSortedMultiSet<Long>
-
getRemovedSize
public int getRemovedSize()- Specified by:
getRemovedSizein interfaceSegmentedSortedMultiSet<Long>
-
fillRemovedChunk
-
fillAddedChunk
-
getPrevValues
-
get
public long get(long i) - Specified by:
getin interfaceDbLongArray
-
subArray
- Specified by:
subArrayin interfaceDbArrayBase- Specified by:
subArrayin interfaceDbLongArray
-
subArrayByPositions
- Specified by:
subArrayByPositionsin interfaceDbArrayBase- Specified by:
subArrayByPositionsin interfaceDbLongArray
-
toArray
public long[] toArray()- Specified by:
toArrayin interfaceDbArrayBase- Specified by:
toArrayin interfaceDbLongArray
-
size
public long size()Description copied from interface:LongSizedDataStructureThe size of this data structure.- Specified by:
sizein interfaceDbLongArray- Specified by:
sizein interfaceLongSizedDataStructure- Specified by:
sizein interfaceSegmentedSortedMultiSet<Long>- Returns:
- the size of the set (i.e. the number of unique elements).
-
toDbArray
- Specified by:
toDbArrayin interfaceDbArrayBase- Specified by:
toDbArrayin interfaceDbLongArray
-
getPrev
public long getPrev(long i) - Specified by:
getPrevin interfaceDbLongArray
-
getDirect
Description copied from interface:DbLongArrayReturn a version of this DbArrayBase that is flattened out to only reference memory.- Specified by:
getDirectin interfaceDbArrayBase- Specified by:
getDirectin interfaceDbLongArray
-
equals
-
hashCode
public int hashCode() -
toString
-
getAsDate
-
subArrayAsDate
-
subArrayByPositionsAsDates
-
toDateArray
-
getPrevAsDate
-
toDateChunk
-
fillDateChunk
-
getDirectAsDate
-
toDateString
-