public String toLongString() { return getUri().toString() + "/" + getVersion() + "[" + getDescription() + "]"; }
@Override public String toString() { return toShortString(); }
public String toShortString() { return getUri().toString() + "/" + getVersion(); }
Map<String, String> capabilities = (Map<String, String>) topologySpec.getSpecExecutorInstanceProducer().getCapabilities().get(); for (Map.Entry<String, String> capability : capabilities.entrySet()) { log.info(String.format("Evaluating current JobSpec: %s against TopologySpec: %s with " + "capability of source: %s and destination: %s ", jobSpec.getUri(), topologySpec.getUri(), capability.getKey(), capability.getValue())); if (source.equals(capability.getKey()) && destination.equals(capability.getValue())) { specExecutorInstanceMap.put(jobSpec, topologySpec.getSpecExecutorInstanceProducer()); log.info(String.format("Current JobSpec: %s is executable on TopologySpec: %s. Added TopologySpec as candidate.", jobSpec.getUri(), topologySpec.getUri()));
@Override public void put(Spec spec) { try { Preconditions.checkState(state() == Service.State.RUNNING, String.format("%s is not running.", this.getClass().getName())); Preconditions.checkNotNull(spec); log.info(String.format("Adding TopologySpec with URI: %s and Config: %s", spec.getUri(), ((TopologySpec) spec).getConfigAsProperties())); if (specStore.exists(spec.getUri())) { specStore.updateSpec(spec); this.listeners.onUpdateSpec(spec); } else { specStore.addSpec(spec); this.listeners.onAddSpec(spec); } } catch (IOException | SpecNotFoundException e) { throw new RuntimeException("Cannot add Spec to Spec store: " + spec, e); } }
public TopologySpec build() { Preconditions.checkNotNull(this.uri); Preconditions.checkNotNull(this.version); return new TopologySpec(getURI(), getVersion(), getDescription(), getConfig(), getConfigAsProperties(), getSpecExceutorInstanceProducer()); }
.builder(topologyConfig.getString(ServiceConfigKeys.TOPOLOGYSPEC_URI_KEY)) .withConfig(topologyConfig) .withDescription(description)