Interface DataChunk<P extends AbstractPoint,​A extends DataChunk<P,​A>>

    • Method Detail

      • getOffset

        int getOffset()
        Get data chunk offset.
        Returns:
        data chunk offset
      • getLength

        int getLength()
        Get data chunk length
        Returns:
        data chunk length
      • getEstimatedSize

        int getEstimatedSize()
        Get estimated size in bytes.
        Returns:
        estimated size in bytes
      • getCompressionFactor

        double getCompressionFactor()
        Get compression factor. 1 means no compression.
        Returns:
        the compression factor
      • isCompressed

        boolean isCompressed()
        Check if chunk is in compressed form.
        Returns:
        true if chunk is in compressed form, false otherwise
      • stream

        Stream<P> stream​(TimeSeriesIndex index)
        Get a point stream.
        Parameters:
        index - the time series index
        Returns:
        a point stream
      • iterator

        Iterator<P> iterator​(TimeSeriesIndex index)
        Get a point iterator.
        Parameters:
        index - the time series index
        Returns:
        a point iterator
      • tryToCompress

        A tryToCompress()
        Try to compress the chunk.
        Returns:
        the compressed chunk or itself if compression is not efficient enough
      • splitAt

        DataChunk.Split<P,​A> splitAt​(int splitIndex)
        Split the chunk in two parts.
        Parameters:
        splitIndex - the split index
        Returns:
        both chunks
      • append

        A append​(A otherChunk)
        Append the chunk with the one given in argument, and return the result. "This" dataChunk and the one in argument remain unchanged. The two chunks have to be successive, i.e : this.getOffset() + this.length() = otherChunk.getOffset()
        Parameters:
        otherChunk - : the chunk to append with this object. It has to be the same implementation as this object.
        Returns:
      • writeJson

        void writeJson​(com.fasterxml.jackson.core.JsonGenerator generator)
        Serialize this data chunk to json.
        Parameters:
        generator - a json generator (jackson)
        Throws:
        IOException - in case of json writing error
      • writeJson

        static void writeJson​(com.fasterxml.jackson.core.JsonGenerator generator,
                              List<? extends DataChunk> chunks)
        Serialize a chunk list to json
        Parameters:
        generator - a json generator (jackson)
        chunks - the chunk list