Package org.apache.flume.conf

Examples of org.apache.flume.conf.FlumeConfigurationError


  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());
    }
View Full Code Here


      if (channelList != null) {
        this.channels =
            new HashSet<String>(Arrays.asList(channelList.split("\\s+")));
      }
      if (channels.isEmpty()) {
        errors.add(new FlumeConfigurationError(componentName,
            ComponentType.CHANNEL.getComponentType(),
            FlumeConfigurationErrorType.PROPERTY_VALUE_NULL,
            ErrorOrWarning.ERROR));
        throw new ConfigurationException("No channels set for "
            + this.getComponentName());
      }
      Map<String, String> selectorParams = context.getSubProperties(
              BasicConfigurationConstants.CONFIG_SOURCE_CHANNELSELECTOR_PREFIX);
      String selType;
      if (selectorParams != null && !selectorParams.isEmpty()) {
        selType = selectorParams.get(BasicConfigurationConstants.CONFIG_TYPE);
        System.out.println("Loading selector: " + selType);
      } else {
        selType = ChannelSelectorConfigurationType.REPLICATING.toString();
      }

      if (selType == null || selType.isEmpty()) {
        selType = ChannelSelectorConfigurationType.REPLICATING.toString();

      }
      ChannelSelectorType selectorType =
          this.getKnownChannelSelector(selType);
      Context selectorContext = new Context();
      selectorContext.putAll(selectorParams);
      String config = null;
      if (selectorType == null) {
        config = selectorContext.getString(
            BasicConfigurationConstants.CONFIG_CONFIG);
        if (config == null || config.isEmpty()) {
          config = "OTHER";
        }
      } else {
        config = selectorType.toString().toUpperCase();
      }

      this.selectorConf =
          (ChannelSelectorConfiguration) ComponentConfigurationFactory
              .create(ComponentType.CHANNELSELECTOR.getComponentType(), config,
                  ComponentType.CHANNELSELECTOR);
      selectorConf.setChannels(channels);
      selectorConf.configure(selectorContext);
    } catch (Exception e) {
      errors.add(new FlumeConfigurationError(componentName,
          ComponentType.CHANNELSELECTOR.getComponentType(),
          FlumeConfigurationErrorType.CONFIG_ERROR,
          ErrorOrWarning.ERROR));
      throw new ConfigurationException("Failed to configure component!", e);
    }
View Full Code Here

      if (channelList != null) {
        this.channels =
            new HashSet<String>(Arrays.asList(channelList.split("\\s+")));
      }
      if (channels.isEmpty()) {
        errors.add(new FlumeConfigurationError(componentName,
            ComponentType.CHANNEL.getComponentType(),
            FlumeConfigurationErrorType.PROPERTY_VALUE_NULL,
            ErrorOrWarning.ERROR));
        throw new ConfigurationException("No channels set for "
            + this.getComponentName());
      }
      Map<String, String> selectorParams = context.getSubProperties(
              BasicConfigurationConstants.CONFIG_SOURCE_CHANNELSELECTOR_PREFIX);
      String selType;
      if (selectorParams != null && !selectorParams.isEmpty()) {
        selType = selectorParams.get(BasicConfigurationConstants.CONFIG_TYPE);
      } else {
        selType = ChannelSelectorConfigurationType.REPLICATING.toString();
      }

      if (selType == null || selType.isEmpty()) {
        selType = ChannelSelectorConfigurationType.REPLICATING.toString();

      }
      ChannelSelectorType selectorType =
          this.getKnownChannelSelector(selType);
      Context selectorContext = new Context();
      selectorContext.putAll(selectorParams);
      String config = null;
      if (selectorType == null) {
        config = selectorContext.getString(
            BasicConfigurationConstants.CONFIG_CONFIG);
        if (config == null || config.isEmpty()) {
          config = "OTHER";
        }
      } else {
        config = selectorType.toString().toUpperCase(Locale.ENGLISH);
      }

      this.selectorConf =
          (ChannelSelectorConfiguration) ComponentConfigurationFactory
              .create(ComponentType.CHANNELSELECTOR.getComponentType(), config,
                  ComponentType.CHANNELSELECTOR);
      selectorConf.setChannels(channels);
      selectorConf.configure(selectorContext);
    } catch (Exception e) {
      errors.add(new FlumeConfigurationError(componentName,
          ComponentType.CHANNELSELECTOR.getComponentType(),
          FlumeConfigurationErrorType.CONFIG_ERROR,
          ErrorOrWarning.ERROR));
      throw new ConfigurationException("Failed to configure component!", e);
    }
View Full Code Here

  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());
    }
View Full Code Here

      if (channelList != null) {
        this.channels =
            new HashSet<String>(Arrays.asList(channelList.split("\\s+")));
      }
      if (channels.isEmpty()) {
        errors.add(new FlumeConfigurationError(componentName,
            ComponentType.CHANNEL.getComponentType(),
            FlumeConfigurationErrorType.PROPERTY_VALUE_NULL,
            ErrorOrWarning.ERROR));
        throw new ConfigurationException("No channels set for "
            + this.getComponentName());
      }
      Map<String, String> selectorParams = context.getSubProperties(
              BasicConfigurationConstants.CONFIG_SOURCE_CHANNELSELECTOR_PREFIX);
      String selType;
      if (selectorParams != null && !selectorParams.isEmpty()) {
        selType = selectorParams.get(BasicConfigurationConstants.CONFIG_TYPE);
        System.out.println("Loading selector: " + selType);
      } else {
        selType = ChannelSelectorConfigurationType.REPLICATING.toString();
      }

      if (selType == null || selType.isEmpty()) {
        selType = ChannelSelectorConfigurationType.REPLICATING.toString();

      }
      ChannelSelectorType selectorType =
          this.getKnownChannelSelector(selType);
      Context selectorContext = new Context();
      selectorContext.putAll(selectorParams);
      String config = null;
      if (selectorType == null) {
        config = selectorContext.getString(
            BasicConfigurationConstants.CONFIG_CONFIG);
        if (config == null || config.isEmpty()) {
          config = "OTHER";
        }
      } else {
        config = selectorType.toString().toUpperCase();
      }

      this.selectorConf =
          (ChannelSelectorConfiguration) ComponentConfigurationFactory
              .create(ComponentType.CHANNELSELECTOR.getComponentType(), config,
                  ComponentType.CHANNELSELECTOR);
      selectorConf.setChannels(channels);
      selectorConf.configure(selectorContext);
    } catch (Exception e) {
      errors.add(new FlumeConfigurationError(componentName,
          ComponentType.CHANNELSELECTOR.getComponentType(),
          FlumeConfigurationErrorType.CONFIG_ERROR,
          ErrorOrWarning.ERROR));
      throw new ConfigurationException("Failed to configure component!", e);
    }
View Full Code Here

  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());
    }
View Full Code Here

      if (channelList != null) {
        this.channels =
            new HashSet<String>(Arrays.asList(channelList.split("\\s+")));
      }
      if (channels.isEmpty()) {
        errors.add(new FlumeConfigurationError(componentName,
            ComponentType.CHANNEL.getComponentType(),
            FlumeConfigurationErrorType.PROPERTY_VALUE_NULL,
            ErrorOrWarning.ERROR));
        throw new ConfigurationException("No channels set for "
            + this.getComponentName());
      }
      Map<String, String> selectorParams = context.getSubProperties(
              BasicConfigurationConstants.CONFIG_SOURCE_CHANNELSELECTOR_PREFIX);
      String selType;
      if (selectorParams != null && !selectorParams.isEmpty()) {
        selType = selectorParams.get(BasicConfigurationConstants.CONFIG_TYPE);
      } else {
        selType = ChannelSelectorConfigurationType.REPLICATING.toString();
      }

      if (selType == null || selType.isEmpty()) {
        selType = ChannelSelectorConfigurationType.REPLICATING.toString();

      }
      ChannelSelectorType selectorType =
          this.getKnownChannelSelector(selType);
      Context selectorContext = new Context();
      selectorContext.putAll(selectorParams);
      String config = null;
      if (selectorType == null) {
        config = selectorContext.getString(
            BasicConfigurationConstants.CONFIG_CONFIG);
        if (config == null || config.isEmpty()) {
          config = "OTHER";
        }
      } else {
        config = selectorType.toString().toUpperCase();
      }

      this.selectorConf =
          (ChannelSelectorConfiguration) ComponentConfigurationFactory
              .create(ComponentType.CHANNELSELECTOR.getComponentType(), config,
                  ComponentType.CHANNELSELECTOR);
      selectorConf.setChannels(channels);
      selectorConf.configure(selectorContext);
    } catch (Exception e) {
      errors.add(new FlumeConfigurationError(componentName,
          ComponentType.CHANNELSELECTOR.getComponentType(),
          FlumeConfigurationErrorType.CONFIG_ERROR,
          ErrorOrWarning.ERROR));
      throw new ConfigurationException("Failed to configure component!", e);
    }
View Full Code Here

  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());
    }
View Full Code Here

          BasicConfigurationConstants.CONFIG_CHANNELS);
      if (channelList != null) {
        this.channels =
            new HashSet<String>(Arrays.asList(channelList.split("\\s+")));
        if (channels.isEmpty()) {
          errors.add(new FlumeConfigurationError(componentName,
              ComponentType.CHANNEL.getComponentType(),
              FlumeConfigurationErrorType.PROPERTY_VALUE_NULL,
              ErrorOrWarning.ERROR));
          throw new ConfigurationException("No channels set for "
              + this.getComponentName());
        }
      }
      Map<String, String> selectorParams = context.getSubProperties(
              BasicConfigurationConstants.CONFIG_SOURCE_CHANNELSELECTOR_PREFIX);
      String selType;
      if (selectorParams != null && !selectorParams.isEmpty()) {
        selType = selectorParams.get(BasicConfigurationConstants.CONFIG_TYPE);
        System.out.println("Loading selector: " + selType);
      } else {
        selType = ChannelSelectorConfigurationType.REPLICATING.toString();
      }

      if (selType == null || selType.isEmpty()) {
        selType = ChannelSelectorConfigurationType.REPLICATING.toString();

      }
      ChannelSelectorType selectorType =
          this.getKnownChannelSelector(selType);
      Context selectorContext = new Context();
      selectorContext.putAll(selectorParams);
      String config = null;
      if (selectorType == null) {
        config = selectorContext.getString(
            BasicConfigurationConstants.CONFIG_CONFIG);
        if (config == null || config.isEmpty()) {
          config = "OTHER";
        }
      } else {
        config = selectorType.toString().toUpperCase();
      }

      this.selectorConf =
          (ChannelSelectorConfiguration) ComponentConfigurationFactory
              .create(ComponentType.CHANNELSELECTOR.getComponentType(), config,
                  ComponentType.CHANNELSELECTOR);
      selectorConf.setChannels(channels);
      selectorConf.configure(selectorContext);
    } catch (Exception e) {
      errors.add(new FlumeConfigurationError(componentName,
          ComponentType.CHANNELSELECTOR.getComponentType(),
          FlumeConfigurationErrorType.CONFIG_ERROR,
          ErrorOrWarning.ERROR));
      throw new ConfigurationException("Failed to configure component!", e);
    }
View Full Code Here

TOP

Related Classes of org.apache.flume.conf.FlumeConfigurationError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.