Class ConfigTransformer


  • public class ConfigTransformer
    extends Object
    Read legacy properties (pre 2.1) from ZooKeeper and transform them into the single node format. The encoded properties are stored in ZooKeeper and then the legacy property ZooKeeper nodes are deleted.
    • Constructor Detail

      • ConfigTransformer

        public ConfigTransformer​(ZooReaderWriter zrw,
                                 VersionedPropCodec codec,
                                 PropStoreWatcher propStoreWatcher)
        Instantiate a transformer instance.
        Parameters:
        zrw - a ZooReaderWriter
        codec - the codec used to encode to the single-node format.
        propStoreWatcher - the watcher registered to receive future notifications of changes to the encoded property node.
    • Method Detail

      • transform

        public VersionedProperties transform​(PropStoreKey<?> propStoreKey,
                                             String legacyPath,
                                             boolean deleteLegacyNode)
        Transform the properties for the provided prop cache key.
        Returns:
        the encoded properties.