Search in sources :

Example 1 with SKFSNamespaceCreator

use of com.ms.silverking.cloud.skfs.management.SKFSNamespaceCreator in project SilverKing by Morgan-Stanley.

the class SKAdmin method execCreateSKFSns.

private boolean execCreateSKFSns() throws IOException, ClientException, KeeperException {
    SKFSNamespaceCreator nsCreator;
    String preferredServer;
    Pair<RingConfiguration, InstantiatedRingTree> ringConfigAndTree;
    HostGroupTable hostGroupTable;
    String hostGroupTableName;
    ringConfigAndTree = getRing(dhtConfig, dhtMC);
    Log.warning("ringConfig: ", ringConfigAndTree.getV1());
    hostGroupTableName = ringConfigAndTree.getV1().getCloudConfiguration().getHostGroupTableName();
    Log.warning("hostGroupTableName: ", hostGroupTableName);
    hostGroupTable = getHostGroupTable(hostGroupTableName, dhtMC.getZooKeeper().getZKConfig());
    if (options.preferredServer == null) {
        preferredServer = findArbitraryActiveServer(dhtConfig.getHostGroups(), hostGroupTable);
    } else {
        preferredServer = options.preferredServer;
    }
    Log.warning("Using preferredServer ", preferredServer);
    nsCreator = new SKFSNamespaceCreator(gc.getClientDHTConfiguration(), preferredServer);
    nsCreator.createNamespaces(skfsNamespaces, skfsNSOptions);
    nsCreator.createNamespaces(skfsMutableNamespaces, skfsMutableNSOptions);
    nsCreator.createNamespaces(skfsFileBlockNamespaces, skfsFileBlockNSOptions);
    nsCreator.createNamespaces(skfsDirNamespaces, skfsDirNSOptions);
    return true;
}
Also used : SKFSNamespaceCreator(com.ms.silverking.cloud.skfs.management.SKFSNamespaceCreator) RingConfiguration(com.ms.silverking.cloud.toporing.meta.RingConfiguration) NamedRingConfiguration(com.ms.silverking.cloud.toporing.meta.NamedRingConfiguration) HostGroupTable(com.ms.silverking.cloud.config.HostGroupTable) InstantiatedRingTree(com.ms.silverking.cloud.toporing.InstantiatedRingTree)

Aggregations

HostGroupTable (com.ms.silverking.cloud.config.HostGroupTable)1 SKFSNamespaceCreator (com.ms.silverking.cloud.skfs.management.SKFSNamespaceCreator)1 InstantiatedRingTree (com.ms.silverking.cloud.toporing.InstantiatedRingTree)1 NamedRingConfiguration (com.ms.silverking.cloud.toporing.meta.NamedRingConfiguration)1 RingConfiguration (com.ms.silverking.cloud.toporing.meta.RingConfiguration)1