@Override public void activateOptions() { if(lineLayout != null) { lineLayout.activateOptions(); } if (messageLayout != null) { messageLayout.activateOptions(); } }
rpcClient = RpcClientFactory.getInstance(props); if (layout != null) { layout.activateOptions();
/** * Activate the options set using <tt>setHosts()</tt>, <tt>setSelector</tt> * and <tt>setMaxBackoff</tt> * * @throws FlumeException * if the LoadBalancingRpcClient cannot be instantiated. */ @Override public void activateOptions() throws FlumeException { try { final Properties properties = getProperties(hosts, selector, maxBackoff, getTimeout()); rpcClient = RpcClientFactory.getInstance(properties); if (layout != null) { layout.activateOptions(); } configured = true; } catch (Exception e) { String errormsg = "RPC client creation failed! " + e.getMessage(); LogLog.error(errormsg); if (getUnsafeMode()) { return; } throw new FlumeException(e); } initializeClientAddress(); }
@Override public void activateOptions() { layout.activateOptions(); }
/** * Activate the options set using <tt>setPort()</tt> * and <tt>setHostname()</tt> * @throws FlumeException if the <tt>hostname</tt> and * <tt>port</tt> combination is invalid. */ @Override public void activateOptions() throws FlumeException { Properties props = new Properties(); props.setProperty(RpcClientConfigurationConstants.CONFIG_HOSTS, "h1"); props.setProperty(RpcClientConfigurationConstants.CONFIG_HOSTS_PREFIX + "h1", hostname + ":" + port); props.setProperty(RpcClientConfigurationConstants.CONFIG_CONNECT_TIMEOUT, String.valueOf(timeout)); props.setProperty(RpcClientConfigurationConstants.CONFIG_REQUEST_TIMEOUT, String.valueOf(timeout)); try { rpcClient = RpcClientFactory.getInstance(props); if (layout != null) { layout.activateOptions(); } } catch (FlumeException e) { String errormsg = "RPC client creation failed! " + e.getMessage(); LogLog.error(errormsg); throw e; } }
/** * Activate the options set using <tt>setPort()</tt> * and <tt>setHostname()</tt> * @throws FlumeException if the <tt>hostname</tt> and * <tt>port</tt> combination is invalid. */ @Override public void activateOptions() throws FlumeException { Properties props = new Properties(); props.setProperty(RpcClientConfigurationConstants.CONFIG_HOSTS, "h1"); props.setProperty(RpcClientConfigurationConstants.CONFIG_HOSTS_PREFIX + "h1", hostname + ":" + port); props.setProperty(RpcClientConfigurationConstants.CONFIG_CONNECT_TIMEOUT, String.valueOf(timeout)); props.setProperty(RpcClientConfigurationConstants.CONFIG_REQUEST_TIMEOUT, String.valueOf(timeout)); try { rpcClient = RpcClientFactory.getInstance(props); if (layout != null) { layout.activateOptions(); } } catch (FlumeException e) { String errormsg = "RPC client creation failed! " + e.getMessage(); LogLog.error(errormsg); throw e; } }
public class MultiLayout extends Layout { private Layout layout1; private Layout layout2; public MultiLayout() { layout1 = ....; layout1.activateOptions(); layout2 = ....; layout2.activateOptions(); } public boolean ignoresThrowable() { return layout1.ignoresThrowable(); } public String format(LoggingEvent e) { // choose the appropriate layout, e.g. based on logger name if(e.getLoggerName().startsWith("com.example.")) { return layout1.format(e); } else { return layout2.format(e); } } }
rpcClient = RpcClientFactory.getInstance(props); if (layout != null) { layout.activateOptions();
/** * Activate the options set using <tt>setHosts()</tt>, <tt>setSelector</tt> * and <tt>setMaxBackoff</tt> * * @throws FlumeException * if the LoadBalancingRpcClient cannot be instantiated. */ @Override public void activateOptions() throws FlumeException { try { final Properties properties = getProperties(hosts, selector, maxBackoff, getTimeout()); rpcClient = RpcClientFactory.getInstance(properties); if (layout != null) { layout.activateOptions(); } configured = true; } catch (Exception e) { String errormsg = "RPC client creation failed! " + e.getMessage(); LogLog.error(errormsg); if (getUnsafeMode()) { return; } throw new FlumeException(e); } initializeClientAddress(); }