Class ZkCopier

java.lang.Object
com.linkedin.venice.ZkCopier

public class ZkCopier extends 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 Details

    • ZkCopier

      public ZkCopier()
  • Method Details

    • migrateVenicePaths

      public static void migrateVenicePaths(org.apache.helix.zookeeper.impl.client.ZkClient srcZkClient, org.apache.helix.zookeeper.impl.client.ZkClient destZkClient, Set<String> clusterNames, 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(String inputPath, String outputPath, Set<String> clusterNames, 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