kafka.server

TopicConfigManager

class TopicConfigManager extends Logging

This class initiates and carries out topic config changes.

It works as follows.

Config is stored under the path /brokers/topics/<topic_name>/config This znode stores the topic-overrides for this topic (but no defaults) in properties format.

To avoid watching all topics for changes instead we have a notification path /brokers/config_changes The TopicConfigManager has a child watch on this path.

To update a topic config we first update the topic config properties. Then we create a new sequential znode under the change path which contains the name of the topic that was updated, say /brokers/config_changes/config_change_13321 This is just a notification--the actual config change is stored only once under the /brokers/topics/<topic_name>/config path.

This will fire a watcher on all brokers. This watcher works as follows. It reads all the config change notifications. It keeps track of the highest config change suffix number it has applied previously. For any previously applied change it finds it checks if this notification is larger than a static expiration time (say 10mins) and if so it deletes this notification. For any new changes it reads the new configuration, combines it with the defaults, and updates the log config for all logs for that topic (if any) that it has.

Note that config is always read from the config path in zk, the notification is just a trigger to do so. So if a broker is down and misses a change that is fine--when it restarts it will be loading the full config anyway. Note also that if there are two consecutive config changes it is possible that only the last one will be applied (since by the time the broker reads the config the both changes may have been made). In this case the broker would needlessly refresh the config twice, but that is harmless.

On restart the config manager re-processes all notifications. This will usually be wasted work, but avoids any race conditions on startup where a change might be missed between the initial config load and registering for change notifications.

Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TopicConfigManager
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TopicConfigManager(zkClient: ZkClient, logManager: LogManager, changeExpirationMs: Long = 15.*(60).*(1000).toLong, time: Time = kafka.utils.SystemTime)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object ConfigChangeListener extends IZkChildListener

    A listener that applies config changes to logs

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def debug(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  10. def debug(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  11. def debug(msg: ⇒ String): Unit

    Definition Classes
    Logging
  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def error(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  15. def error(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  16. def error(msg: ⇒ String): Unit

    Definition Classes
    Logging
  17. def fatal(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  18. def fatal(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  19. def fatal(msg: ⇒ String): Unit

    Definition Classes
    Logging
  20. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  23. def info(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  24. def info(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  25. def info(msg: ⇒ String): Unit

    Definition Classes
    Logging
  26. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  27. var logIdent: String

    Attributes
    protected
    Definition Classes
    Logging
  28. lazy val logger: Logger

    Definition Classes
    Logging
  29. val loggerName: String

    Definition Classes
    Logging
  30. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  31. final def notify(): Unit

    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  33. def startup(): Unit

    Begin watching for config changes

  34. def swallow(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  35. def swallowDebug(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  36. def swallowError(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  37. def swallowInfo(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  38. def swallowTrace(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  39. def swallowWarn(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  41. def toString(): String

    Definition Classes
    AnyRef → Any
  42. def trace(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  43. def trace(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  44. def trace(msg: ⇒ String): Unit

    Definition Classes
    Logging
  45. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. def warn(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  49. def warn(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  50. def warn(msg: ⇒ String): Unit

    Definition Classes
    Logging

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped