private void runFiltersThroughConfigs() { runFiltersOnContextMaps( sourceContextMap, channelContextMap, sinkContextMap, sinkGroupContextMap ); }
private boolean addAsSinkGroupConfig(String key, String value) { return addComponentConfig( key, value, CONFIG_SINKGROUPS_PREFIX, sinkGroupContextMap ); }
protected void failIfConfigured() throws ConfigurationException { if (configured) { throw new ConfigurationException("Already configured component." + componentName); } }
public void configure(Context context) throws ConfigurationException { super.configure(context); this.channel = context.getString("channel"); if (this.channel == null || this.channel.isEmpty()) { errors .add(new FlumeConfigurationError(componentName, "channel", FlumeConfigurationErrorType.PROPERTY_VALUE_NULL, ErrorOrWarning.ERROR)); throw new ConfigurationException("No channel configured for sink: " + this.getComponentName()); } }
@Override public void configure(Context context) { Configurables.ensureRequiredNonNull( context, CONFIG_PORT); port = context.getInteger(CONFIG_PORT); host = context.getString(CONFIG_HOST); remoteHostHeader = context.getString(REMOTE_ADDRESS_HEADER); }
@Override protected FlumeConfiguration getFlumeConfiguration() { return new FlumeConfiguration(properties); }
public SinkGroupConfiguration(String name) { super(name); setType(ComponentType.SINKGROUP.getComponentType()); }
private SourceType getKnownSource(String type) { return getKnownComponent(type, SourceType.values()); }
public String toString() { return toString(0); }
public static boolean configure(Object target, ComponentConfiguration conf) { if (target instanceof ConfigurableComponent) { ((ConfigurableComponent) target).configure(conf); return true; } return false; }
/** * Check that {@code target} implements {@link Configurable} and, if so, ask * it to configure itself using the supplied {@code context}. * * @param target * An object that potentially implements Configurable. * @param context * The configuration context * @return true if {@code target} implements Configurable, false otherwise. */ public static boolean configure(Object target, Context context) { if (target instanceof Configurable) { ((Configurable) target).configure(context); return true; } return false; }
private void addError( String component, FlumeConfigurationErrorType errorType, ErrorOrWarning level ) { errors.add(new FlumeConfigurationError(component, "", errorType, level)); }
@Override public void configure(Context context) { this.maxBlobLength = context.getInteger(MAX_BLOB_LENGTH_KEY, MAX_BLOB_LENGTH_DEFAULT); if (this.maxBlobLength <= 0) { throw new ConfigurationException("Configuration parameter " + MAX_BLOB_LENGTH_KEY + " must be greater than zero: " + maxBlobLength); } }
private boolean addAsChannelValue(String key, String value) { return addComponentConfig( key, value, CONFIG_CHANNELS_PREFIX, channelContextMap ); }
@Override public String toString(int indentCount) { String basicStr = super.toString(indentCount); StringBuilder sb = new StringBuilder(); sb.append(basicStr).append(FlumeConfiguration.INDENTSTEP).append( "CHANNEL:").append(this.channel).append( FlumeConfiguration.NEWLINE); return sb.toString(); }
protected BlobDeserializer(Context context, ResettableInputStream in) { this.in = in; this.maxBlobLength = context.getInteger(MAX_BLOB_LENGTH_KEY, MAX_BLOB_LENGTH_DEFAULT); if (this.maxBlobLength <= 0) { throw new ConfigurationException("Configuration parameter " + MAX_BLOB_LENGTH_KEY + " must be greater than zero: " + maxBlobLength); } this.isOpen = true; }
private boolean addAsConfigFilterConfig(String key, String value) { return addComponentConfig( key, value, CONFIG_CONFIGFILTERS_PREFIX, configFilterContextMap ); }
@Override public String toString(int indentCount) { String basicStr = super.toString(indentCount); StringBuilder sb = new StringBuilder(); sb.append(basicStr).append("CHANNELS:"); for (String channel : this.channels) { sb.append(FlumeConfiguration.INDENTSTEP).append( channel).append(FlumeConfiguration.NEWLINE); } return sb.toString(); }
private boolean addAsSinkConfig(String key, String value) { return addComponentConfig( key, value, CONFIG_SINKS_PREFIX, sinkContextMap ); }
private boolean addAsSourceConfig(String key, String value) { return addComponentConfig( key, value, CONFIG_SOURCES_PREFIX, sourceContextMap ); }