/** * Get dependencies in the topology for a given host * @param name - host name for which we are getting dependency * @return a list of hosts dependent on the provided host name */ @Override public List<String> getDependency(String name) { //normalize all input names to be in the form of IP addresses name = NetUtils.normalizeHostName(name); if (name==null) { return Collections.emptyList(); } List<String> dependencies = dependencyCache.get(name); if (dependencies == null) { //not cached dependencies = getRawMapping().getDependency(name); if(dependencies != null) { dependencyCache.put(name, dependencies); } } return dependencies; }
@Override public List<String> getDependency(String name) { if (name==null || dependencyScriptName==null) { return Collections.emptyList(); } List <String> m = new LinkedList<String>(); List <String> args = new ArrayList<String>(1); args.add(name); String output = runResolveCommand(args,dependencyScriptName); if (output != null) { StringTokenizer allSwitchInfo = new StringTokenizer(output); while (allSwitchInfo.hasMoreTokens()) { String switchInfo = allSwitchInfo.nextToken(); m.add(switchInfo); } } else { // an error occurred. return null to signify this. // (exn was already logged in runResolveCommand) return null; } return m; }
@Override public List<String> getDependency(String name) { if (name==null || dependencyScriptName==null) { return Collections.emptyList(); } List <String> m = new LinkedList<String>(); List <String> args = new ArrayList<String>(1); args.add(name); String output = runResolveCommand(args,dependencyScriptName); if (output != null) { StringTokenizer allSwitchInfo = new StringTokenizer(output); while (allSwitchInfo.hasMoreTokens()) { String switchInfo = allSwitchInfo.nextToken(); m.add(switchInfo); } } else { // an error occurred. return null to signify this. // (exn was already logged in runResolveCommand) return null; } return m; }
@Override public List<String> getDependency(String name) { if (name==null || dependencyScriptName==null) { return Collections.emptyList(); } List <String> m = new LinkedList<String>(); List <String> args = new ArrayList<String>(1); args.add(name); String output = runResolveCommand(args,dependencyScriptName); if (output != null) { StringTokenizer allSwitchInfo = new StringTokenizer(output); while (allSwitchInfo.hasMoreTokens()) { String switchInfo = allSwitchInfo.nextToken(); m.add(switchInfo); } } else { // an error occurred. return null to signify this. // (exn was already logged in runResolveCommand) return null; } return m; }
/** * Get dependencies in the topology for a given host * @param name - host name for which we are getting dependency * @return a list of hosts dependent on the provided host name */ @Override public List<String> getDependency(String name) { //normalize all input names to be in the form of IP addresses name = NetUtils.normalizeHostName(name); if (name==null) { return Collections.emptyList(); } List<String> dependencies = dependencyCache.get(name); if (dependencies == null) { //not cached dependencies = getRawMapping().getDependency(name); if(dependencies != null) { dependencyCache.put(name, dependencies); } } return dependencies; }
@Override public List<String> getDependency(String name) { if (name==null || dependencyScriptName==null) { return Collections.emptyList(); } List <String> m = new LinkedList<String>(); List <String> args = new ArrayList<String>(1); args.add(name); String output = runResolveCommand(args,dependencyScriptName); if (output != null) { StringTokenizer allSwitchInfo = new StringTokenizer(output); while (allSwitchInfo.hasMoreTokens()) { String switchInfo = allSwitchInfo.nextToken(); m.add(switchInfo); } } else { // an error occurred. return null to signify this. // (exn was already logged in runResolveCommand) return null; } return m; }
/** * Get dependencies in the topology for a given host * @param name - host name for which we are getting dependency * @return a list of hosts dependent on the provided host name */ @Override public List<String> getDependency(String name) { //normalize all input names to be in the form of IP addresses name = NetUtils.normalizeHostName(name); if (name==null) { return Collections.emptyList(); } List<String> dependencies = dependencyCache.get(name); if (dependencies == null) { //not cached dependencies = getRawMapping().getDependency(name); if(dependencies != null) { dependencyCache.put(name, dependencies); } } return dependencies; }
/** * Get dependencies in the topology for a given host * @param name - host name for which we are getting dependency * @return a list of hosts dependent on the provided host name */ @Override public List<String> getDependency(String name) { //normalize all input names to be in the form of IP addresses name = NetUtils.normalizeHostName(name); if (name==null) { return Collections.emptyList(); } List<String> dependencies = dependencyCache.get(name); if (dependencies == null) { //not cached dependencies = getRawMapping().getDependency(name); if(dependencies != null) { dependencyCache.put(name, dependencies); } } return dependencies; }
/** * Get dependencies in the topology for a given host * @param name - host name for which we are getting dependency * @return a list of hosts dependent on the provided host name */ @Override public List<String> getDependency(String name) { //normalize all input names to be in the form of IP addresses name = NetUtils.normalizeHostName(name); if (name==null) { return Collections.emptyList(); } List<String> dependencies = dependencyCache.get(name); if (dependencies == null) { //not cached dependencies = getRawMapping().getDependency(name); if(dependencies != null) { dependencyCache.put(name, dependencies); } } return dependencies; }
@Override public List<String> getDependency(String name) { if (name==null || dependencyScriptName==null) { return Collections.emptyList(); } List <String> m = new LinkedList<String>(); List <String> args = new ArrayList<String>(1); args.add(name); String output = runResolveCommand(args,dependencyScriptName); if (output != null) { StringTokenizer allSwitchInfo = new StringTokenizer(output); while (allSwitchInfo.hasMoreTokens()) { String switchInfo = allSwitchInfo.nextToken(); m.add(switchInfo); } } else { // an error occurred. return null to signify this. // (exn was already logged in runResolveCommand) return null; } return m; }
@Override public String toString() { return "script-based mapping with " + getRawMapping().toString(); }
/** * {@inheritDoc} * <p/> * This will get called in the superclass constructor, so a check is needed * to ensure that the raw mapping is defined before trying to relaying a null * configuration. * @param conf */ @Override public void setConf(Configuration conf) { super.setConf(conf); getRawMapping().setConf(conf); }
/** * {@inheritDoc} * <p/> * This will get called in the superclass constructor, so a check is needed * to ensure that the raw mapping is defined before trying to relaying a null * configuration. * @param conf */ @Override public void setConf(Configuration conf) { super.setConf(conf); getRawMapping().setConf(conf); }
@Override public String toString() { return "script-based mapping with " + getRawMapping().toString(); }
/** * {@inheritDoc} * <p/> * This will get called in the superclass constructor, so a check is needed * to ensure that the raw mapping is defined before trying to relaying a null * configuration. * @param conf */ @Override public void setConf(Configuration conf) { super.setConf(conf); getRawMapping().setConf(conf); }
/** * Create an instance with the default configuration. * </p> * Calling {@link #setConf(Configuration)} will trigger a * re-evaluation of the configuration settings and so be used to * set up the mapping script. */ public ScriptBasedMappingWithDependency() { super(new RawScriptBasedMappingWithDependency()); }
@Override public String toString() { return "script-based mapping with " + getRawMapping().toString(); }
@Override public String toString() { return "script-based mapping with " + getRawMapping().toString(); }
/** * {@inheritDoc} * <p/> * This will get called in the superclass constructor, so a check is needed * to ensure that the raw mapping is defined before trying to relaying a null * configuration. * @param conf */ @Override public void setConf(Configuration conf) { super.setConf(conf); getRawMapping().setConf(conf); }
/** * Create an instance with the default configuration. * </p> * Calling {@link #setConf(Configuration)} will trigger a * re-evaluation of the configuration settings and so be used to * set up the mapping script. */ public ScriptBasedMappingWithDependency() { super(new RawScriptBasedMappingWithDependency()); }