Search in sources :

Example 1 with UpdateTopologyManager

use of org.apache.heron.scheduler.UpdateTopologyManager in project heron by twitter.

the class AuroraScheduler method initialize.

@Override
public void initialize(Config mConfig, Config mRuntime) {
    this.config = Config.toClusterMode(mConfig);
    this.runtime = mRuntime;
    try {
        this.controller = getController();
    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
        LOG.severe("AuroraController initialization failed " + e.getMessage());
    }
    this.updateTopologyManager = new UpdateTopologyManager(config, runtime, Optional.<IScalable>of(this));
}
Also used : UpdateTopologyManager(org.apache.heron.scheduler.UpdateTopologyManager) IScalable(org.apache.heron.spi.scheduler.IScalable)

Example 2 with UpdateTopologyManager

use of org.apache.heron.scheduler.UpdateTopologyManager in project heron by twitter.

the class LocalScheduler method initialize.

@Override
public void initialize(Config mConfig, Config mRuntime) {
    this.config = mConfig;
    this.runtime = mRuntime;
    this.updateTopologyManager = new UpdateTopologyManager(config, runtime, Optional.<IScalable>of(this));
}
Also used : UpdateTopologyManager(org.apache.heron.scheduler.UpdateTopologyManager) IScalable(org.apache.heron.spi.scheduler.IScalable)

Example 3 with UpdateTopologyManager

use of org.apache.heron.scheduler.UpdateTopologyManager in project heron by twitter.

the class NomadScheduler method initialize.

@Override
public void initialize(Config config, Config runtime) {
    this.localConfig = config;
    this.clusterConfig = Config.toClusterMode(Config.newBuilder().putAll(config).putAll(ConfigLoader.loadConfig(Context.heronHome(config), Context.heronConf(config), null, Context.apiserverOverrideFile(config) != null ? Context.apiserverOverrideFile(config) : Context.overrideFile(config))).build());
    this.runtimeConfig = runtime;
    this.updateTopologyManager = new UpdateTopologyManager(config, runtime, Optional.absent());
}
Also used : UpdateTopologyManager(org.apache.heron.scheduler.UpdateTopologyManager)

Example 4 with UpdateTopologyManager

use of org.apache.heron.scheduler.UpdateTopologyManager in project heron by twitter.

the class KubernetesScheduler method initialize.

@Override
public void initialize(Config config, Config runtime) {
    // validate the topology name before moving forward
    if (!topologyNameIsValid(Runtime.topologyName(runtime))) {
        throw new RuntimeException(getInvalidTopologyNameMessage(Runtime.topologyName(runtime)));
    }
    // validate that the image pull policy has been set correctly
    if (!imagePullPolicyIsValid(KubernetesContext.getKubernetesImagePullPolicy(config))) {
        throw new RuntimeException(getInvalidImagePullPolicyMessage(KubernetesContext.getKubernetesImagePullPolicy(config)));
    }
    final Config.Builder builder = Config.newBuilder().putAll(config);
    if (config.containsKey(Key.TOPOLOGY_BINARY_FILE)) {
        builder.put(Key.TOPOLOGY_BINARY_FILE, FileUtils.getBaseName(Context.topologyBinaryFile(config)));
    }
    this.configuration = builder.build();
    this.runtimeConfiguration = runtime;
    this.controller = getController();
    this.updateTopologyManager = new UpdateTopologyManager(configuration, runtimeConfiguration, Optional.<IScalable>of(this));
}
Also used : UpdateTopologyManager(org.apache.heron.scheduler.UpdateTopologyManager) Config(org.apache.heron.spi.common.Config) IScalable(org.apache.heron.spi.scheduler.IScalable)

Aggregations

UpdateTopologyManager (org.apache.heron.scheduler.UpdateTopologyManager)4 IScalable (org.apache.heron.spi.scheduler.IScalable)3 Config (org.apache.heron.spi.common.Config)1