public static CatalogAndDeployment getCatalogFromZK(ZooKeeper zk)
            throws KeeperException, InterruptedException {
        ByteBuffer catalogDeploymentBytes =
                ByteBuffer.wrap(zk.getData(VoltZK.catalogbytes, false, null));
        int version = catalogDeploymentBytes.getInt();
        long genId = catalogDeploymentBytes.getLong();
        int catalogLength = catalogDeploymentBytes.getInt();
        byte[] catalogBytes = new byte[catalogLength];
        catalogDeploymentBytes.get(catalogBytes);
        byte[] catalogHash = new byte[20]; // sha-1 hash size
        catalogDeploymentBytes.get(catalogHash);
        int deploymentLength = catalogDeploymentBytes.getInt();
        byte[] deploymentBytes = new byte[deploymentLength];
        catalogDeploymentBytes.get(deploymentBytes);
        catalogDeploymentBytes = null;

        return new CatalogAndDeployment(version, genId, catalogBytes, catalogHash, deploymentBytes);
    }
public static CatalogAndDeployment getCatalogFromZK ( ZooKeeper zk ) throws KeeperException , InterruptedException { ByteBuffer catalogDeploymentBytes = ByteBuffer . wrap ( zk . getData ( VoltZK . catalogbytes , false , null ) ) ; int version = catalogDeploymentBytes . getInt ( ) ; long genId = catalogDeploymentBytes . getLong ( ) ; int catalogLength = catalogDeploymentBytes . getInt ( ) ; byte [ ] catalogBytes = new byte [ catalogLength ] ; catalogDeploymentBytes . get ( catalogBytes ) ; byte [ ] catalogHash = new byte [ 20 ] ; catalogDeploymentBytes . get ( catalogHash ) ; int deploymentLength = catalogDeploymentBytes . getInt ( ) ; byte [ ] deploymentBytes = new byte [ deploymentLength ] ; catalogDeploymentBytes . get ( deploymentBytes ) ; catalogDeploymentBytes = null ; return new CatalogAndDeployment ( version , genId , catalogBytes , catalogHash , deploymentBytes ) ; }
Retrieve the catalog and deployment configuration from zookeeper.
NOTE: In general, people who want the catalog and/or deployment should
be getting it from the current CatalogContext, available from
VoltDB.instance().  This is primarily for startup and for use by
@UpdateCore.