org.apache.flume.Context.putAll()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.apache.flume.Context.putAll()方法的一些代码示例,展示了Context.putAll()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.putAll()方法的具体详情如下:
包路径:org.apache.flume.Context
类名称:Context
方法名:putAll

Context.putAll介绍

[英]Associates all of the given map's keys and values in the Context.
[中]关联上下文中所有给定映射的键和值。

代码示例

代码示例来源:origin: apache/flume

public Context(Map<String, String> paramters) {
 this();
 this.putAll(paramters);
}

代码示例来源:origin: apache/flume

public static ChannelSelector create(List<Channel> channels,
  Map<String, String> config) {
 ChannelSelector selector = getSelectorForType(config.get(
   BasicConfigurationConstants.CONFIG_TYPE));
 selector.setChannels(channels);
 Context context = new Context();
 context.putAll(config);
 Configurables.configure(selector, context);
 return selector;
}

代码示例来源:origin: apache/flume

logger.info("No serializer defined, Will use default");
serializerContext.putAll(context.getSubProperties(
  HBaseSinkConfigurationConstants.CONFIG_SERIALIZER_PREFIX));
columnFamily = cf.getBytes(Charsets.UTF_8);

代码示例来源:origin: apache/flume

logger.info("No serializer defined, Will use default");
serializerContext.putAll(context.getSubProperties(
  HBase2SinkConfigurationConstants.CONFIG_SERIALIZER_PREFIX));
columnFamily = cf.getBytes(Charsets.UTF_8);

代码示例来源:origin: apache/flume

logger.info("No serializer defined, Will use default");
serializerContext.putAll(context.getSubProperties(
  HBaseSinkConfigurationConstants.CONFIG_SERIALIZER_PREFIX));
columnFamily = cf.getBytes(Charsets.UTF_8);

代码示例来源:origin: apache/flume

elasticSearchClientContext.putAll(context.getSubProperties(CLIENT_PREFIX));
serializerContext.putAll(context.getSubProperties(SERIALIZER_PREFIX));
serializerContext.putAll(
    context.getSubProperties(INDEX_NAME_BUILDER_PREFIX));

代码示例来源:origin: apache/flume

@Override
public void configure(Context context) throws ConfigurationException {
 super.configure(context);
 sinks = Arrays.asList(context.getString(
   BasicConfigurationConstants.CONFIG_SINKS).split("\\s+"));
 Map<String, String> params = context.getSubProperties(
   BasicConfigurationConstants.CONFIG_SINK_PROCESSOR_PREFIX);
 processorContext = new Context();
 processorContext.putAll(params);
 SinkProcessorType spType = getKnownSinkProcessor(processorContext.getString(
     BasicConfigurationConstants.CONFIG_TYPE));
 if (spType != null) {
  processorConf =
    (SinkProcessorConfiguration) ComponentConfigurationFactory.create(
      this.getComponentName() + "-processor",
      spType.toString(),
      ComponentType.SINK_PROCESSOR);
  if (processorConf != null) {
   processorConf.setSinks(new HashSet<String>(sinks));
   processorConf.configure(processorContext);
  }
 }
 setConfigured();
}

代码示例来源:origin: apache/flume

this.getKnownChannelSelector(selType);
Context selectorContext = new Context();
selectorContext.putAll(selectorParams);
String config = null;
if (selectorType == null) {

代码示例来源:origin: forcedotcom/phoenix

/**
 * Initializes the serializer for flume events.
 * @param eventSerializerType
 */
private void initializeSerializer(final Context context,final String eventSerializerType) {
  
  EventSerializers eventSerializer = null;
  try {
      eventSerializer =  EventSerializers.valueOf(eventSerializerType.toUpperCase());
  } catch(IllegalArgumentException iae) {
      logger.error("An invalid eventSerializer {} was passed. Please specify one of {} ",eventSerializerType,
          Joiner.on(",").skipNulls().join(EventSerializers.values()));
      Throwables.propagate(iae);
  }
    final Context serializerContext = new Context();
  serializerContext.putAll(context.getSubProperties(FlumeConstants.CONFIG_SERIALIZER_PREFIX));
  copyPropertiesToSerializerContext(context,serializerContext);
       try {
   @SuppressWarnings("unchecked")
   Class<? extends EventSerializer> clazz = (Class<? extends EventSerializer>) Class.forName(eventSerializer.getClassName());
   serializer = clazz.newInstance();
   serializer.configure(serializerContext);
     } catch (Exception e) {
   logger.error("Could not instantiate event serializer." , e);
   Throwables.propagate(e);
  }
}

代码示例来源:origin: apache/phoenix

serializerContext.putAll(context.getSubProperties(FlumeConstants.CONFIG_SERIALIZER_PREFIX));
copyPropertiesToSerializerContext(context,serializerContext);

代码示例来源:origin: apache/phoenix

serializerContext.putAll(context.getSubProperties(FlumeConstants.CONFIG_SERIALIZER_PREFIX));
copyPropertiesToSerializerContext(context,serializerContext);

代码示例来源:origin: org.apache.flume/flume-ng-configuration

public Context(Map<String, String> paramters) {
 this();
 this.putAll(paramters);
}

代码示例来源:origin: org.apache.flume/flume-ng-core

public static ChannelSelector create(List<Channel> channels,
  Map<String, String> config) {
 ChannelSelector selector = getSelectorForType(config.get(
   BasicConfigurationConstants.CONFIG_TYPE));
 selector.setChannels(channels);
 Context context = new Context();
 context.putAll(config);
 Configurables.configure(selector, context);
 return selector;
}

代码示例来源:origin: org.apache.phoenix/phoenix-kafka

serializerContext.putAll(context.getSubProperties(FlumeConstants.CONFIG_SERIALIZER_PREFIX));
copyPropertiesToSerializerContext(context,serializerContext);

代码示例来源:origin: org.apache.flume.flume-ng-sinks/flume-ng-hbase2-sink

logger.info("No serializer defined, Will use default");
serializerContext.putAll(context.getSubProperties(
  HBase2SinkConfigurationConstants.CONFIG_SERIALIZER_PREFIX));
columnFamily = cf.getBytes(Charsets.UTF_8);

代码示例来源:origin: org.apache.flume.flume-ng-sinks/flume-ng-hbase-sink

logger.info("No serializer defined, Will use default");
serializerContext.putAll(context.getSubProperties(
  HBaseSinkConfigurationConstants.CONFIG_SERIALIZER_PREFIX));
columnFamily = cf.getBytes(Charsets.UTF_8);

代码示例来源:origin: org.apache.flume.flume-ng-sinks/flume-ng-hbase-sink

logger.info("No serializer defined, Will use default");
serializerContext.putAll(context.getSubProperties(
  HBaseSinkConfigurationConstants.CONFIG_SERIALIZER_PREFIX));
columnFamily = cf.getBytes(Charsets.UTF_8);

代码示例来源:origin: Stratio/ingestion

elasticSearchClientContext.putAll(context.getSubProperties(CLIENT_PREFIX));
serializerContext.putAll(context.getSubProperties(SERIALIZER_PREFIX));
serializerContext.putAll(
    context.getSubProperties(INDEX_NAME_BUILDER_PREFIX));

代码示例来源:origin: org.apache.flume/flume-ng-configuration

@Override
public void configure(Context context) throws ConfigurationException {
 super.configure(context);
 sinks = Arrays.asList(context.getString(
   BasicConfigurationConstants.CONFIG_SINKS).split("\\s+"));
 Map<String, String> params = context.getSubProperties(
   BasicConfigurationConstants.CONFIG_SINK_PROCESSOR_PREFIX);
 processorContext = new Context();
 processorContext.putAll(params);
 SinkProcessorType spType = getKnownSinkProcessor(processorContext.getString(
     BasicConfigurationConstants.CONFIG_TYPE));
 if (spType != null) {
  processorConf =
    (SinkProcessorConfiguration) ComponentConfigurationFactory.create(
      this.getComponentName() + "-processor",
      spType.toString(),
      ComponentType.SINK_PROCESSOR);
  if (processorConf != null) {
   processorConf.setSinks(new HashSet<String>(sinks));
   processorConf.configure(processorContext);
  }
 }
 setConfigured();
}

代码示例来源:origin: org.apache.flume/flume-ng-configuration

this.getKnownChannelSelector(selType);
Context selectorContext = new Context();
selectorContext.putAll(selectorParams);
String config = null;
if (selectorType == null) {

相关文章