Examples of SinkProcessorType


Examples of org.apache.flume.SinkProcessorType

  public static SinkProcessor getProcessor(Context context,
List<Sink> sinks) {
    Map<String, String> params = context.getParameters();
    SinkProcessor processor;
    String typeStr = (String) params.get(TYPE);
    SinkProcessorType type = SinkProcessorType.DEFAULT;
    try {
      type = SinkProcessorType.valueOf(typeStr.toUpperCase());
    } catch (Exception ex) {
      logger.warn("Sink type {} does not exist, using default", typeStr);
    }

    Class<? extends SinkProcessor> processorClass = null;
    try {
      processorClass = (Class<? extends SinkProcessor>) Class.forName(
          type.getSinkProcessorClassName());
    } catch (Exception ex) {
      throw new FlumeException("Unable to load sink processor type: " + typeStr
          + ", class: " + type.getSinkProcessorClassName(), ex);
    }
    try {
      processor = processorClass.newInstance();
    } catch (Exception e) {
      throw new FlumeException("Unable to create processor, type: " + typeStr
          + ", class: " + type.getSinkProcessorClassName(), e);
    }

    processor.setSinks(sinks);
    processor.configure(context);
    return processor;
View Full Code Here

Examples of org.apache.flume.conf.sink.SinkProcessorType

    Preconditions.checkNotNull(sinks);
    Preconditions.checkArgument(!sinks.isEmpty());
    Map<String, String> params = context.getParameters();
    SinkProcessor processor;
    String typeStr = params.get(TYPE);
    SinkProcessorType type = SinkProcessorType.OTHER;
    String processorClassName = typeStr;
    try {
      type = SinkProcessorType.valueOf(typeStr.toUpperCase());
    } catch (Exception ex) {
      logger.warn("Sink type {} is a custom type", typeStr);
    }

    if(!type.equals(SinkProcessorType.OTHER)) {
      processorClassName = type.getSinkProcessorClassName();
    }

    logger.debug("Creating instance of sink processor type {}, class {}",
            typeStr, processorClassName);
    Class<? extends SinkProcessor> processorClass = null;
    try {
      processorClass = (Class<? extends SinkProcessor>) Class.forName(
          processorClassName);
    } catch (Exception ex) {
      throw new FlumeException("Unable to load sink processor type: " + typeStr
          + ", class: " + type.getSinkProcessorClassName(), ex);
    }
    try {
      processor = processorClass.newInstance();
    } catch (Exception e) {
      throw new FlumeException("Unable to create sink processor, type: " + typeStr
View Full Code Here

Examples of org.apache.flume.conf.sink.SinkProcessorType

  @SuppressWarnings("unchecked")
  public static SinkProcessor getProcessor(ComponentConfiguration conf,
      List<Sink> sinks) {
    String typeStr = conf.getType();
    SinkProcessor processor;
    SinkProcessorType type = SinkProcessorType.DEFAULT;
    try {
      type = SinkProcessorType.valueOf(typeStr.toUpperCase());
    } catch (Exception ex) {
      logger.warn("Sink type {} does not exist, using default", typeStr);
    }

    Class<? extends SinkProcessor> processorClass = null;
    try {
      processorClass =
          (Class<? extends SinkProcessor>) Class.forName(type
              .getSinkProcessorClassName());
    } catch (Exception ex) {
      throw new FlumeException("Unable to load sink processor type: " + typeStr
          + ", class: " + type.getSinkProcessorClassName(), ex);
    }
    try {
      processor = processorClass.newInstance();
    } catch (Exception e) {
      throw new FlumeException("Unable to create processor, type: " + typeStr
          + ", class: " + type.getSinkProcessorClassName(), e);
    }

    processor.setSinks(sinks);
    Configurables.configure(processor, conf);
    return processor;
View Full Code Here

Examples of org.apache.flume.conf.sink.SinkProcessorType

    Preconditions.checkNotNull(sinks);
    Preconditions.checkArgument(!sinks.isEmpty());
    Map<String, String> params = context.getParameters();
    SinkProcessor processor;
    String typeStr = params.get(TYPE);
    SinkProcessorType type = SinkProcessorType.OTHER;
    String processorClassName = typeStr;
    try {
      type = SinkProcessorType.valueOf(typeStr.toUpperCase(Locale.ENGLISH));
    } catch (Exception ex) {
      logger.warn("Sink Processor type {} is a custom type", typeStr);
    }

    if(!type.equals(SinkProcessorType.OTHER)) {
      processorClassName = type.getSinkProcessorClassName();
    }

    logger.debug("Creating instance of sink processor type {}, class {}",
            typeStr, processorClassName);
    Class<? extends SinkProcessor> processorClass = null;
    try {
      processorClass = (Class<? extends SinkProcessor>) Class.forName(
          processorClassName);
    } catch (Exception ex) {
      throw new FlumeException("Unable to load sink processor type: " + typeStr
          + ", class: " + type.getSinkProcessorClassName(), ex);
    }
    try {
      processor = processorClass.newInstance();
    } catch (Exception e) {
      throw new FlumeException("Unable to create sink processor, type: " + typeStr
View Full Code Here

Examples of org.apache.flume.conf.sink.SinkProcessorType

  @SuppressWarnings("unchecked")
  public static SinkProcessor getProcessor(ComponentConfiguration conf,
      List<Sink> sinks) {
    String typeStr = conf.getType();
    SinkProcessor processor;
    SinkProcessorType type = SinkProcessorType.DEFAULT;
    try {
      type = SinkProcessorType.valueOf(typeStr.toUpperCase(Locale.ENGLISH));
    } catch (Exception ex) {
      logger.warn("Sink type {} does not exist, using default", typeStr);
    }

    Class<? extends SinkProcessor> processorClass = null;
    try {
      processorClass =
          (Class<? extends SinkProcessor>) Class.forName(type
              .getSinkProcessorClassName());
    } catch (Exception ex) {
      throw new FlumeException("Unable to load sink processor type: " + typeStr
          + ", class: " + type.getSinkProcessorClassName(), ex);
    }
    try {
      processor = processorClass.newInstance();
    } catch (Exception e) {
      throw new FlumeException("Unable to create processor, type: " + typeStr
          + ", class: " + type.getSinkProcessorClassName(), e);
    }

    processor.setSinks(sinks);
    Configurables.configure(processor, conf);
    return processor;
View Full Code Here

Examples of org.apache.flume.conf.sink.SinkProcessorType

    Preconditions.checkNotNull(sinks);
    Preconditions.checkArgument(!sinks.isEmpty());
    Map<String, String> params = context.getParameters();
    SinkProcessor processor;
    String typeStr = params.get(TYPE);
    SinkProcessorType type = SinkProcessorType.OTHER;
    String processorClassName = typeStr;
    try {
      type = SinkProcessorType.valueOf(typeStr.toUpperCase());
    } catch (Exception ex) {
      logger.warn("Sink Processor type {} is a custom type", typeStr);
    }

    if(!type.equals(SinkProcessorType.OTHER)) {
      processorClassName = type.getSinkProcessorClassName();
    }

    logger.debug("Creating instance of sink processor type {}, class {}",
            typeStr, processorClassName);
    Class<? extends SinkProcessor> processorClass = null;
    try {
      processorClass = (Class<? extends SinkProcessor>) Class.forName(
          processorClassName);
    } catch (Exception ex) {
      throw new FlumeException("Unable to load sink processor type: " + typeStr
          + ", class: " + type.getSinkProcessorClassName(), ex);
    }
    try {
      processor = processorClass.newInstance();
    } catch (Exception e) {
      throw new FlumeException("Unable to create sink processor, type: " + typeStr
View Full Code Here

Examples of org.apache.flume.conf.sink.SinkProcessorType

  @SuppressWarnings("unchecked")
  public static SinkProcessor getProcessor(ComponentConfiguration conf,
      List<Sink> sinks) {
    String typeStr = conf.getType();
    SinkProcessor processor;
    SinkProcessorType type = SinkProcessorType.DEFAULT;
    try {
      type = SinkProcessorType.valueOf(typeStr.toUpperCase());
    } catch (Exception ex) {
      logger.warn("Sink type {} does not exist, using default", typeStr);
    }

    Class<? extends SinkProcessor> processorClass = null;
    try {
      processorClass =
          (Class<? extends SinkProcessor>) Class.forName(type
              .getSinkProcessorClassName());
    } catch (Exception ex) {
      throw new FlumeException("Unable to load sink processor type: " + typeStr
          + ", class: " + type.getSinkProcessorClassName(), ex);
    }
    try {
      processor = processorClass.newInstance();
    } catch (Exception e) {
      throw new FlumeException("Unable to create processor, type: " + typeStr
          + ", class: " + type.getSinkProcessorClassName(), e);
    }

    processor.setSinks(sinks);
    Configurables.configure(processor, conf);
    return processor;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.