Class

kafka.server

DynamicConfigManager

Related Doc: package server

Permalink

class DynamicConfigManager extends Logging

This class initiates and carries out config changes for all entities defined in ConfigType.

It works as follows.

Config is stored under the path: /config/entityType/entityName E.g. /config/topics/<topic_name> and /config/clients/<clientId> This znode stores the overrides for this entity (but no defaults) in properties format.

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

To update a config we first update the config properties. Then we create a new sequential znode under the change path which contains the name of the entityType and entityName that was updated, say /config/changes/config_change_13321 The sequential znode contains data in this format: {"version" : 1, "entityType":"topic/client", "entityName" : "topic_name/client_id"} This is just a notification--the actual config change is stored only once under the /config/entityType/entityName 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 existing config.

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. DynamicConfigManager
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DynamicConfigManager(zkUtils: ZkUtils, configHandlers: Map[String, ConfigHandler], changeExpirationMs: Long = 15*60*1000, time: Time = SystemTime)

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. object ConfigChangeListener extends IZkChildListener

    Permalink

    A listener that applies config changes to logs

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

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

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

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    Logging
  18. def finalize(): Unit

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  25. var logIdent: String

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  26. lazy val logger: Logger

    Permalink
    Definition Classes
    Logging
  27. val loggerName: String

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

    Permalink
    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. def processNotification(jsonOpt: Option[String]): Unit

    Permalink
  32. def startup(): Unit

    Permalink

    Begin watching for config changes

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  40. def toString(): String

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

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

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

    Permalink
    Definition Classes
    Logging
  44. final def wait(): Unit

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

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

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

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

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

    Permalink
    Definition Classes
    Logging

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped