@Override public void setConf(Configuration conf) { super.setConf(conf); getRawMapping().setConf(conf); }
@Override public void reloadCachedMappings() { super.reloadCachedMappings(); getRawMapping().reloadCachedMappings(); }
/** * {@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); }
/** * Get the socket address for <code>name</code> property as a * <code>InetSocketAddress</code>. * @param name property name. * @param defaultAddress the default value * @param defaultPort the default port * @return InetSocketAddress */ public InetSocketAddress getSocketAddr( String name, String defaultAddress, int defaultPort) { final String address = getTrimmed(name, defaultAddress); return NetUtils.createSocketAddr(address, defaultPort, name); }
/** * Set the socket address a client can use to connect for the * <code>name</code> property as a <code>host:port</code>. The wildcard * address is replaced with the local host's address. * @param name property name. * @param addr InetSocketAddress of a listener to store in the given property * @return InetSocketAddress for clients to connect */ public InetSocketAddress updateConnectAddr(String name, InetSocketAddress addr) { final InetSocketAddress connectAddr = NetUtils.getConnectAddress(addr); setSocketAddr(name, connectAddr); return connectAddr; }
/** * Construct an IPC client for the cluster {@code clusterId} with the default SocketFactory This * method is called with reflection by the RpcClientFactory to create an instance * @param conf configuration * @param clusterId the cluster id * @param localAddr client socket bind address. * @param metrics the connection metrics */ public BlockingRpcClient(Configuration conf, String clusterId, SocketAddress localAddr, MetricsConnection metrics) { super(conf, clusterId, localAddr, metrics); this.socketFactory = NetUtils.getDefaultSocketFactory(conf); }
/** * Set the socket address for the <code>name</code> property as * a <code>host:port</code>. */ public void setSocketAddr(String name, InetSocketAddress addr) { set(name, NetUtils.getHostPortString(addr)); }
/** * {@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 Configuration getConf() { return getRawMapping().getConf(); }
/** * Like {@link DNS#getIPs(String, boolean), but returns all * IPs associated with the given interface and its subinterfaces. */ public static String[] getIPs(String strInterface) throws UnknownHostException { return getIPs(strInterface, true); }
@Override public String toString() { return "script-based mapping with " + getRawMapping().toString(); }
@Override public String toString() { return "script-based mapping with " + getRawMapping().toString(); }
@Override public Configuration getConf() { return getRawMapping().getConf(); }
/** * Create an instance from the given configuration * @param conf configuration */ public ScriptBasedMapping(Configuration conf) { this(); setConf(conf); }
/** * Call * {@link #transferToFully(FileChannel, long, int, MutableRate, MutableRate)} * with null <code>waitForWritableTime</code> and <code>transferToTime</code> */ public void transferToFully(FileChannel fileCh, long position, int count) throws IOException { transferToFully(fileCh, position, count, null, null); }
/** * 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 ScriptBasedMapping() { this(new RawScriptBasedMapping()); }
@Override public int hashCode() { // satisfy findbugs return super.hashCode(); }
@Override public boolean equals(Object to) { return super.equals(to); } }
/** * Get the socket address for <code>name</code> property as a * <code>InetSocketAddress</code>. * @param name property name. * @param defaultAddress the default value * @param defaultPort the default port * @return InetSocketAddress */ public InetSocketAddress getSocketAddr( String name, String defaultAddress, int defaultPort) { final String address = getTrimmed(name, defaultAddress); return NetUtils.createSocketAddr(address, defaultPort, name); }
/** * Set the socket address for the <code>name</code> property as * a <code>host:port</code>. */ public void setSocketAddr(String name, InetSocketAddress addr) { set(name, NetUtils.getHostPortString(addr)); }