Class OpenSearchJournalStateStore

    • Constructor Detail

      • OpenSearchJournalStateStore

        public OpenSearchJournalStateStore​(org.opensearch.client.opensearch.OpenSearchClient openSearchClient,
                                           OpenSearchConfig openSearchConfig)
    • Method Detail

      • createJournalIndex

        @PostConstruct
        public void createJournalIndex()
        Create journal index after store is created Will raise Johnson event on error
      • setMostRecentId

        public void setMostRecentId​(@NonNull JournalIdentifier journalId,
                                    long id)
                             throws org.springframework.dao.DataAccessException
        Description copied from interface: JournalStateStore
        Set the most recent identifier for a journal.

        New journal is automatically created if a journal with the given name does not exists.

        Only positive identifiers (e.g. > 0) can be stored.

        Specified by:
        setMostRecentId in interface JournalStateStore
        Parameters:
        journalId - id of the journal
        id - identifier to store as the most recent id
        Throws:
        org.springframework.dao.DataAccessException - if persisting the id failed.
      • getMostRecentId

        public long getMostRecentId​(@NonNull JournalIdentifier journalId)
                             throws org.springframework.dao.DataAccessException
        Description copied from interface: JournalStateStore
        Returns the most recent id for a journal or 0 if no id has been stored yet.

        New journal is automatically created if a journal with the given name does not exists.

        Specified by:
        getMostRecentId in interface JournalStateStore
        Parameters:
        journalId - id of the journal
        Returns:
        most recent id for a journal or 0 if no id has been stored yet
        Throws:
        org.springframework.dao.DataAccessException - if reading the id failed