get topology configuration

@param id String: topology id
@return String
322950
@Override
    public String getTopologyConf(String id) throws TException {
        String rtn;
        try {
            Map<Object, Object> topologyConf = StormConfig.read_nimbus_topology_conf(id, data.getBlobStore());
            rtn = JStormUtils.to_json(topologyConf);
        } catch (IOException e) {
            LOG.info("Failed to get configuration of " + id, e);
            throw new TException(e);
        }
        return rtn;
    }
827110
private HashSet<String> getComponents(Nimbus.Client client, String topology) throws Exception {
        HashSet<String> components = new HashSet<String>();
        ClusterSummary clusterSummary = client.getClusterInfo();
        TopologySummary topologySummary = null;
        for (TopologySummary ts : clusterSummary.get_topologies()) {
            if (topology.equals(ts.get_name())) {
                topologySummary = ts;
                break;
            }
        }
        if (topologySummary == null) {
            throw new IllegalArgumentException("topology: " + topology + " not found");
        } else {
            String id = topologySummary.get_id();
            // GetInfoOptions getInfoOpts = new GetInfoOptions();
            // getInfoOpts.set_num_err_choice(NumErrorsChoice.NONE);
            // TopologyInfo info = client.getTopologyInfoWithOpts(id, getInfoOpts);
            // for (ExecutorSummary es: info.get_executors()) {
            // components.add(es.get_component_id());
            // }
        }
        return components;
    }
314043
public static Map<String, Double> getComponentCpuMapConfig(TopologyAPI.Topology topology)
      throws RuntimeException {
    Map<String, String> configMap =
        getComponentConfigMap(topology, Config.TOPOLOGY_COMPONENT_CPUMAP);
    Map<String, Double> cpuMap = new HashMap<>();

    for (Map.Entry<String, String> entry : configMap.entrySet()) {
      Double requiredCpu = Double.parseDouble(entry.getValue());
      cpuMap.put(entry.getKey(), requiredCpu);
    }
    return cpuMap;
  }
897957
public String commitId(final String id) {
        return new StringBuilder().append(baseUrl).append("commit/").append(id).toString();
    }
624587
public String toIdString(Object id) {
        if (id == null) {
            return null;
        }
        return idStringMapper.toString(id);
    }
751421
public function getConfig(string $id): Config
    {
        // TODO: Use null coalescing assignment operator.
        $this->configs[$id] = $this->configs[$id] ?? $this->registerConfig($id);

        return $this->configs[$id];
    }
1129428
public INDArray getById(int id) {
        return map.get(NodeDescriptor.builder().id(id).build());
    }
406799
def _get_topology(self):
        
        self._topology.open()
        with self.__lock:
            self._kill_cursors_executor.open()
        return self._topology
740923
@Override
    public String getTopologyJsonPayload(Set<Host> activeHosts) {
		int count = NUM_RETRIER_ACROSS_NODES;
		String response;
		Exception lastEx = null;

		do {
			try {
				response = getTopologyFromRandomNodeWithRetry(activeHosts);
				if (response != null) {
					return response;
				}
			} catch (Exception e) {
				lastEx = e;
			} finally {
				count--;
			}
		} while ((count > 0));

		if (lastEx != null) {
			if (lastEx instanceof ConnectTimeoutException) {
				throw new TimeoutException("Unable to obtain topology", lastEx);
			}
			throw new DynoException(lastEx);
		} else {
			throw new DynoException("Could not contact dynomite for token map");
		}

    }
635054
public function get($id)
    {
        if (!$this->has($id)) {
            throw new \InvalidArgumentException(sprintf('Configuration "%s" not found.', $id));
        }

        return $this->configurations[$id];
    }
716978
protected static Map<String, String> getComponentConfigMap(TopologyAPI.Topology topology,
                                                             String key) throws RuntimeException {
    List<TopologyAPI.Config.KeyValue> topologyConfig = topology.getTopologyConfig().getKvsList();
    Map<String, String> configMap = new HashMap<>();

    // Get the set of component names to make sure the config only specifies valid component name
    Set<String> componentNames = getComponentParallelism(topology).keySet();

    // Parse the config value
    String mapStr = getConfigWithDefault(topologyConfig, key, (String) null);
    if (mapStr != null) {
      String[] mapTokens = mapStr.split(",");
      // Each token should be in this format: component:value
      for (String token : mapTokens) {
        if (token.trim().isEmpty()) {
          continue;
        }
        String[] componentAndValue = token.split(":");
        if (componentAndValue.length != 2) {
          throw new RuntimeException("Malformed component config " + key);
        }
        if (!componentNames.contains(componentAndValue[0])) {
          throw new RuntimeException("Invalid component. " + componentAndValue[0] + " not found");
        }
        configMap.put(componentAndValue[0], componentAndValue[1]);
      }
    }
    return configMap;
  }
1186907
function idToPath(id, config) {
    var alias = config.alias || {};
    return alias.hasOwnProperty(id) ?
        path.resolve(alias[id]) :
        path.resolve(config.base, id) + '.js';
}
1270511
private Path getHost( String id, long version ) {
        Path ret = root;
        for( String part : id.split( "-" ) ) {
            ret = ret.resolve( part );
        }

        return ret.resolve( "" + version );
    }
831431
@SuppressWarnings("unchecked")
    public static Map component_conf(TopologyContext topology_context, String component_id) {
        Map<Object, Object> componentConf = new HashMap<>();
        String jconf = topology_context.getComponentCommon(component_id).get_json_conf();
        if (jconf != null) {
            componentConf = (Map<Object, Object>) JStormUtils.from_json(jconf);
        }

        return componentConf;
    }
185306
public static String get_topology_id(StormClusterState zkCluster, String storm_name) throws Exception {
        List<String> active_storms = zkCluster.active_storms();
        String rtn = null;
        if (active_storms != null) {
            for (String topology_id : active_storms) {

                if (!topology_id.contains(storm_name)) {
                    continue;
                }
                StormBase base = zkCluster.storm_base(topology_id, null);
                if (base != null && storm_name.equals(Common.getTopologyNameById(topology_id))) {
                    rtn = topology_id;
                    break;
                }
            }
        }
        return rtn;
    }
387626
public E getById(String id) {
        if (id == null) {
            for (E element : this) {
                if (element != null && element.getId() == null) {
                    return element;
                }
            }
        } else {
            for (E element : this) {
                if (element != null && id.equals(element.getId())) {
                    return element;
                }
            }
        }
        return null;
    }
394744
public static Map<String, ByteAmount> getComponentDiskMapConfig(TopologyAPI.Topology topology)
      throws RuntimeException {
    Map<String, String> configMap =
        getComponentConfigMap(topology, Config.TOPOLOGY_COMPONENT_DISKMAP);
    Map<String, ByteAmount> diskMap = new HashMap<>();

    for (Map.Entry<String, String> entry : configMap.entrySet()) {
      long requiredDisk = Long.parseLong(entry.getValue());
      diskMap.put(entry.getKey(), ByteAmount.fromBytes(requiredDisk));
    }
    return diskMap;
  }