Class RocksDBSessionStore

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      KeyValueIterator<Windowed<org.apache.kafka.common.utils.Bytes>,​byte[]> fetch​(org.apache.kafka.common.utils.Bytes key)
      Retrieve all aggregated sessions for the provided key.
      KeyValueIterator<Windowed<org.apache.kafka.common.utils.Bytes>,​byte[]> fetch​(org.apache.kafka.common.utils.Bytes from, org.apache.kafka.common.utils.Bytes to)
      Retrieve all aggregated sessions for the given range of keys.
      byte[] fetchSession​(org.apache.kafka.common.utils.Bytes key, long startTime, long endTime)
      Get the value of key from a single session.
      KeyValueIterator<Windowed<org.apache.kafka.common.utils.Bytes>,​byte[]> findSessions​(org.apache.kafka.common.utils.Bytes key, long earliestSessionEndTime, long latestSessionStartTime)
      Fetch any sessions with the matching key and the sessions end is ≥ earliestSessionEndTime and the sessions start is ≤ latestSessionStartTime This iterator must be closed after use.
      KeyValueIterator<Windowed<org.apache.kafka.common.utils.Bytes>,​byte[]> findSessions​(org.apache.kafka.common.utils.Bytes keyFrom, org.apache.kafka.common.utils.Bytes keyTo, long earliestSessionEndTime, long latestSessionStartTime)
      Fetch any sessions in the given range of keys and the sessions end is ≥ earliestSessionEndTime and the sessions start is ≤ latestSessionStartTime This iterator must be closed after use.
      void put​(Windowed<org.apache.kafka.common.utils.Bytes> sessionKey, byte[] aggregate)
      Write the aggregated value for the provided key to the store
      void remove​(Windowed<org.apache.kafka.common.utils.Bytes> key)
      Remove the session aggregated with provided Windowed key from the store
    • Method Detail

      • findSessions

        public KeyValueIterator<Windowed<org.apache.kafka.common.utils.Bytes>,​byte[]> findSessions​(org.apache.kafka.common.utils.Bytes key,
                                                                                                         long earliestSessionEndTime,
                                                                                                         long latestSessionStartTime)
        Description copied from interface: SessionStore
        Fetch any sessions with the matching key and the sessions end is ≥ earliestSessionEndTime and the sessions start is ≤ latestSessionStartTime This iterator must be closed after use.
        Specified by:
        findSessions in interface SessionStore<org.apache.kafka.common.utils.Bytes,​byte[]>
        Parameters:
        key - the key to return sessions for
        earliestSessionEndTime - the end timestamp of the earliest session to search for
        latestSessionStartTime - the end timestamp of the latest session to search for
        Returns:
        iterator of sessions with the matching key and aggregated values
      • findSessions

        public KeyValueIterator<Windowed<org.apache.kafka.common.utils.Bytes>,​byte[]> findSessions​(org.apache.kafka.common.utils.Bytes keyFrom,
                                                                                                         org.apache.kafka.common.utils.Bytes keyTo,
                                                                                                         long earliestSessionEndTime,
                                                                                                         long latestSessionStartTime)
        Description copied from interface: SessionStore
        Fetch any sessions in the given range of keys and the sessions end is ≥ earliestSessionEndTime and the sessions start is ≤ latestSessionStartTime This iterator must be closed after use.
        Specified by:
        findSessions in interface SessionStore<org.apache.kafka.common.utils.Bytes,​byte[]>
        Parameters:
        keyFrom - The first key that could be in the range
        keyTo - The last key that could be in the range
        earliestSessionEndTime - the end timestamp of the earliest session to search for
        latestSessionStartTime - the end timestamp of the latest session to search for
        Returns:
        iterator of sessions with the matching keys and aggregated values
      • fetchSession

        public byte[] fetchSession​(org.apache.kafka.common.utils.Bytes key,
                                   long startTime,
                                   long endTime)
        Description copied from interface: SessionStore
        Get the value of key from a single session.
        Specified by:
        fetchSession in interface SessionStore<org.apache.kafka.common.utils.Bytes,​byte[]>
        Parameters:
        key - the key to fetch
        startTime - start timestamp of the session
        endTime - end timestamp of the session
        Returns:
        The value or null if no session associated with the key can be found
      • fetch

        public KeyValueIterator<Windowed<org.apache.kafka.common.utils.Bytes>,​byte[]> fetch​(org.apache.kafka.common.utils.Bytes key)
        Description copied from interface: ReadOnlySessionStore
        Retrieve all aggregated sessions for the provided key. This iterator must be closed after use. For each key, the iterator guarantees ordering of sessions, starting from the oldest/earliest available session to the newest/latest session.
        Specified by:
        fetch in interface ReadOnlySessionStore<org.apache.kafka.common.utils.Bytes,​byte[]>
        Parameters:
        key - record key to find aggregated session values for
        Returns:
        KeyValueIterator containing all sessions for the provided key.
      • fetch

        public KeyValueIterator<Windowed<org.apache.kafka.common.utils.Bytes>,​byte[]> fetch​(org.apache.kafka.common.utils.Bytes from,
                                                                                                  org.apache.kafka.common.utils.Bytes to)
        Description copied from interface: ReadOnlySessionStore
        Retrieve all aggregated sessions for the given range of keys. This iterator must be closed after use. For each key, the iterator guarantees ordering of sessions, starting from the oldest/earliest available session to the newest/latest session.
        Specified by:
        fetch in interface ReadOnlySessionStore<org.apache.kafka.common.utils.Bytes,​byte[]>
        Parameters:
        from - first key in the range to find aggregated session values for
        to - last key in the range to find aggregated session values for
        Returns:
        KeyValueIterator containing all sessions for the provided key.
      • remove

        public void remove​(Windowed<org.apache.kafka.common.utils.Bytes> key)
        Description copied from interface: SessionStore
        Remove the session aggregated with provided Windowed key from the store
        Specified by:
        remove in interface SessionStore<org.apache.kafka.common.utils.Bytes,​byte[]>
        Parameters:
        key - key of the session to remove
      • put

        public void put​(Windowed<org.apache.kafka.common.utils.Bytes> sessionKey,
                        byte[] aggregate)
        Description copied from interface: SessionStore
        Write the aggregated value for the provided key to the store
        Specified by:
        put in interface SessionStore<org.apache.kafka.common.utils.Bytes,​byte[]>
        Parameters:
        sessionKey - key of the session to write
        aggregate - the aggregated value for the session, it can be null; if the serialized bytes are also null it is interpreted as deletes