Class ZkCopier


  • public class ZkCopier
    extends java.lang.Object

    This class contains methods to 1)migrate Venice-specific metadata from a source ZooKeeper (ZK) to a destination ZK and 2)extract Venice-specific paths from an input text file containing ZK paths to an output text file. We implement a tree data structure to represent ZK paths as nested children and use it to filter out Venice-specific paths efficiently.

    • Constructor Summary

      Constructors 
      Constructor Description
      ZkCopier()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void extractVenicePaths​(java.lang.String inputPath, java.lang.String outputPath, java.util.Set<java.lang.String> clusterNames, java.lang.String basePath)
      Extract Venice-specific paths from an input text file to an output text file.
      static void migrateVenicePaths​(org.apache.helix.zookeeper.impl.client.ZkClient srcZkClient, org.apache.helix.zookeeper.impl.client.ZkClient destZkClient, java.util.Set<java.lang.String> clusterNames, java.lang.String basePath)
      Migrate Venice-specific metadata from a source ZK to a destination ZK.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ZkCopier

        public ZkCopier()
    • Method Detail

      • migrateVenicePaths

        public static void migrateVenicePaths​(org.apache.helix.zookeeper.impl.client.ZkClient srcZkClient,
                                              org.apache.helix.zookeeper.impl.client.ZkClient destZkClient,
                                              java.util.Set<java.lang.String> clusterNames,
                                              java.lang.String basePath)
        Migrate Venice-specific metadata from a source ZK to a destination ZK.
        Parameters:
        srcZkClient - source ZK client
        destZkClient - destination ZK client
        clusterNames - set of cluster names
        basePath - base path for ZK
      • extractVenicePaths

        public static void extractVenicePaths​(java.lang.String inputPath,
                                              java.lang.String outputPath,
                                              java.util.Set<java.lang.String> clusterNames,
                                              java.lang.String basePath)
        Extract Venice-specific paths from an input text file to an output text file.
        Parameters:
        inputPath - absolute path to the ZK snapshot input text file, which contains one path per line
        outputPath - absolute path to output text file with extracted Venice-specific paths, which contains one path per line
        clusterNames - set of cluster names
        basePath - base path for ZK