Package cluster

Class StreamListenerForTableKey

java.lang.Object
java.lang.Thread
cluster.StreamListenerForTableKey
All Implemented Interfaces:
Runnable

public class StreamListenerForTableKey extends Thread
StreamListenerForTableKey listens on a redis cluster stream.
  • Constructor Details

    • StreamListenerForTableKey

      public StreamListenerForTableKey(String streamID, BalanceManager balanceManager)
      This thread listen on and update table to slot key change event on given redis cluster stream id
      Parameters:
      streamID - The stream id for listening
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • sendNewKeyAddedMessage

      public void sendNewKeyAddedMessage(String tableName, String slotKey)
      Send a broadcast to redis cluster stream that a new slot key has been assigned to the corresponding tableName
      Parameters:
      tableName - the table name for which slot key has been assigned
      slotKey - the Slot key which has been assigned
    • shutDown

      public void shutDown()