Class Index

java.lang.Object
de.otto.synapse.messagestore.Index

@Beta
public class Index
extends java.lang.Object
Identifies a single Index used by a MessageStore to index messages using some Indexer

Indexes could be used to access messages in the store that share some common properties. For example, the partition-key index is used to retrieve all messages that have the same partition key.

You can introduce your own index by 1. introduce an instance of Index and 2. implement an Indexer that is supporting the new Index.

  • Field Details

    • CHANNEL_NAME

      public static final Index CHANNEL_NAME
      Index that is used to access messages in a MessageStore by MessageStoreEntry.getChannelName()
    • ORIGIN

      public static final Index ORIGIN
      Index that is used to specify the origin of the MessageStoreEntry. Depending on the use-case, this might be a simple hint like, for example, "origin" : "Snapshot", or the name of the originating service.
    • SERVICE_INSTANCE

      public static final Index SERVICE_INSTANCE
      Index that is used to specify the service instance that has added the MessageStoreEntry to the MessageStore. The value can be something like hostname:port or some other identfier used to distinguish different instances of single service.
    • PARTITION_KEY

      public static final Index PARTITION_KEY
      Index that is used to access messages in a MessageStore by Key.partitionKey()

      The name of the index is 'partitionKey'

    • JOURNAL_KEY

      public static final Index JOURNAL_KEY
  • Constructor Details

    • Index

      public Index​(java.lang.String name)
  • Method Details

    • valueOf

      public static Index valueOf​(java.lang.String name)
    • getName

      @Nonnull public java.lang.String getName()
      Returns the field name used to store the indexed value.

      The name is used by MessageStore implementations to generate datastructures used for the Index.

      Returns:
      field name
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object