Interface SegmentedBytesStore

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      KeyValueIterator<org.apache.kafka.common.utils.Bytes,​byte[]> all()
      Gets all the key-value pairs in the existing windows.
      KeyValueIterator<org.apache.kafka.common.utils.Bytes,​byte[]> fetch​(org.apache.kafka.common.utils.Bytes key, long from, long to)
      Fetch all records from the segmented store with the provided key and time range from all existing segments
      KeyValueIterator<org.apache.kafka.common.utils.Bytes,​byte[]> fetch​(org.apache.kafka.common.utils.Bytes keyFrom, org.apache.kafka.common.utils.Bytes keyTo, long from, long to)
      Fetch all records from the segmented store in the provided key range and time range from all existing segments
      KeyValueIterator<org.apache.kafka.common.utils.Bytes,​byte[]> fetchAll​(long from, long to)
      Gets all the key-value pairs that belong to the windows within in the given time range.
      byte[] get​(org.apache.kafka.common.utils.Bytes key)
      Get the record from the store with the given key.
      void put​(org.apache.kafka.common.utils.Bytes key, byte[] value)
      Write a new value to the store with the provided key.
      void remove​(org.apache.kafka.common.utils.Bytes key)
      Remove the record with the provided key.
    • Method Detail

      • fetch

        KeyValueIterator<org.apache.kafka.common.utils.Bytes,​byte[]> fetch​(org.apache.kafka.common.utils.Bytes key,
                                                                                 long from,
                                                                                 long to)
        Fetch all records from the segmented store with the provided key and time range from all existing segments
        Parameters:
        key - the key to match
        from - earliest time to match
        to - latest time to match
        Returns:
        an iterator over key-value pairs
      • fetch

        KeyValueIterator<org.apache.kafka.common.utils.Bytes,​byte[]> fetch​(org.apache.kafka.common.utils.Bytes keyFrom,
                                                                                 org.apache.kafka.common.utils.Bytes keyTo,
                                                                                 long from,
                                                                                 long to)
        Fetch all records from the segmented store in the provided key range and time range from all existing segments
        Parameters:
        keyFrom - The first key that could be in the range
        keyTo - The last key that could be in the range
        from - earliest time to match
        to - latest time to match
        Returns:
        an iterator over key-value pairs
      • all

        KeyValueIterator<org.apache.kafka.common.utils.Bytes,​byte[]> all()
        Gets all the key-value pairs in the existing windows.
        Returns:
        an iterator over windowed key-value pairs <Windowed<K>, value>
        Throws:
        InvalidStateStoreException - if the store is not initialized
      • fetchAll

        KeyValueIterator<org.apache.kafka.common.utils.Bytes,​byte[]> fetchAll​(long from,
                                                                                    long to)
        Gets all the key-value pairs that belong to the windows within in the given time range.
        Parameters:
        from - the beginning of the time slot from which to search
        to - the end of the time slot from which to search
        Returns:
        an iterator over windowed key-value pairs <Windowed<K>, value>
        Throws:
        InvalidStateStoreException - if the store is not initialized
        NullPointerException - if null is used for any key
      • remove

        void remove​(org.apache.kafka.common.utils.Bytes key)
        Remove the record with the provided key. The key should be a composite of the record key, and the timestamp information etc as described by the SegmentedBytesStore.KeySchema
        Parameters:
        key - the segmented key to remove
      • put

        void put​(org.apache.kafka.common.utils.Bytes key,
                 byte[] value)
        Write a new value to the store with the provided key. The key should be a composite of the record key, and the timestamp information etc as described by the SegmentedBytesStore.KeySchema
        Parameters:
        key -
        value -
      • get

        byte[] get​(org.apache.kafka.common.utils.Bytes key)
        Get the record from the store with the given key. The key should be a composite of the record key, and the timestamp information etc as described by the SegmentedBytesStore.KeySchema
        Parameters:
        key -
        Returns: