Class AOffset
- java.lang.Object
- 
- org.apache.sysds.runtime.compress.colgroup.offset.AOffset
 
- 
- All Implemented Interfaces:
- Serializable
 - Direct Known Subclasses:
- OffsetByte,- OffsetChar,- OffsetSingle,- OffsetTwo
 
 public abstract class AOffset extends Object implements Serializable Offset list encoder interface. It is assumed that the input is in sorted order, all values are positive and there are no duplicates. The no duplicate is important since 0 values are exploited to encode an offset of max representable value + 1. This gives the ability to encode data, where the offsets are greater than the available highest value that can be represented size.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description AOffset()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcacheIterator(AIterator it, int row)Cache a iterator in use, note that there is no check for if the iterator is correctly positioned at the given rowbooleanequals(AOffset b)abstract longgetExactSizeOnDisk()Remember to include the ordinal of the type of offset list.abstract longgetInMemorySize()Get the in memory size of the Offset objectabstract AIteratorgetIterator()Get an iterator of the offsets while also maintaining the data index pointer.AIteratorgetIterator(int row)Get an iterator that is pointing at a specific offset.abstract AOffsetIteratorgetOffsetIterator()Get an OffsetIterator of current offsets not maintaining the data index.abstract intgetOffsetsLength()Get the length of the underlying offsets lists.abstract intgetOffsetToFirst()Get the offset to the first indexabstract intgetOffsetToLast()Get the offset to the last valueabstract intgetSize()Get the number of contained elements, This method iterate the entire offset list, so it is not constant lookup.voidpreAggregateDenseMap(MatrixBlock m, double[] preAV, int rl, int ru, int cl, int cu, int nVal, AMapToData data)voidpreAggregateSparseMap(SparseBlock sb, double[] preAV, int rl, int ru, int nVal, AMapToData data)StringtoString()abstract voidwrite(DataOutput out)Write the offsets to disk.
 
- 
- 
- 
Method Detail- 
getIteratorpublic abstract AIterator getIterator() Get an iterator of the offsets while also maintaining the data index pointer.- Returns:
- AIterator that iterate through index and dictionary offset values.
 
 - 
getOffsetIteratorpublic abstract AOffsetIterator getOffsetIterator() Get an OffsetIterator of current offsets not maintaining the data index.- Returns:
- AIterator that iterator through the delta offsets.
 
 - 
getIteratorpublic AIterator getIterator(int row) Get an iterator that is pointing at a specific offset.- Parameters:
- row- The row requested.
- Returns:
- AIterator that iterate through index and dictionary offset values.
 
 - 
cacheIteratorpublic void cacheIterator(AIterator it, int row) Cache a iterator in use, note that there is no check for if the iterator is correctly positioned at the given row- Parameters:
- it- The Iterator to cache
- row- The row index to cache the iterator as.
 
 - 
writepublic abstract void write(DataOutput out) throws IOException Write the offsets to disk. If you implement another remember to write the ordinal of the new type to disk as well and add it to the OffsetFactory.- Parameters:
- out- The output to write to
- Throws:
- IOException- Exception that happens if the IO fails to write.
 
 - 
getOffsetToFirstpublic abstract int getOffsetToFirst() Get the offset to the first index- Returns:
- The first index offset
 
 - 
getOffsetToLastpublic abstract int getOffsetToLast() Get the offset to the last value- Returns:
- The last values offset
 
 - 
getInMemorySizepublic abstract long getInMemorySize() Get the in memory size of the Offset object- Returns:
- In memory size as a long.
 
 - 
getExactSizeOnDiskpublic abstract long getExactSizeOnDisk() Remember to include the ordinal of the type of offset list.- Returns:
- the size on disk as a long.
 
 - 
getSizepublic abstract int getSize() Get the number of contained elements, This method iterate the entire offset list, so it is not constant lookup.- Returns:
- The number of indexes.
 
 - 
getOffsetsLengthpublic abstract int getOffsetsLength() Get the length of the underlying offsets lists.- Returns:
- The number of offsets.
 
 - 
preAggregateDenseMappublic final void preAggregateDenseMap(MatrixBlock m, double[] preAV, int rl, int ru, int cl, int cu, int nVal, AMapToData data) 
 - 
preAggregateSparseMappublic final void preAggregateSparseMap(SparseBlock sb, double[] preAV, int rl, int ru, int nVal, AMapToData data) 
 - 
equalspublic boolean equals(AOffset b) 
 
- 
 
-