当前位置: 首页>>代码示例>>Java>>正文


Java Status.OK属性代码示例

本文整理汇总了Java中org.apache.flume.source.avro.Status.OK属性的典型用法代码示例。如果您正苦于以下问题:Java Status.OK属性的具体用法?Java Status.OK怎么用?Java Status.OK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.flume.source.avro.Status的用法示例。


在下文中一共展示了Status.OK属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: append

@Override
public Status append(AvroFlumeEvent avroEvent) {
  logger.debug("Avro source {}: Received avro event: {}", getName(),
      avroEvent);
  sourceCounter.incrementAppendReceivedCount();
  sourceCounter.incrementEventReceivedCount();

  Event event = EventBuilder.withBody(avroEvent.getBody().array(),
      toStringMap(avroEvent.getHeaders()));

  try {
    getChannelProcessor().processEvent(event);
  } catch (ChannelException ex) {
    logger.warn("Avro source " + getName() + ": Unable to process event. " +
        "Exception follows.", ex);
    return Status.FAILED;
  }

  sourceCounter.incrementAppendAcceptedCount();
  sourceCounter.incrementEventAcceptedCount();

  return Status.OK;
}
 
开发者ID:srotya,项目名称:marauder,代码行数:23,代码来源:MarauderLFSource.java

示例2: append

@Override
public Status append(AvroFlumeEvent event) throws AvroRemoteException {
  if (failed) {
    logger.debug("Event rejected");
    return Status.FAILED;
  }
  logger.debug("LB: Received event from append(): {}",
      new String(event.getBody().array(), Charset.forName("UTF8")));
  appendCount++;
  return Status.OK;
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:11,代码来源:RpcTestUtils.java

示例3: appendBatch

@Override
public Status appendBatch(List<AvroFlumeEvent> events) throws
    AvroRemoteException {
  if (failed) {
    logger.debug("Event batch rejected");
    return Status.FAILED;
  }
  logger.debug("LB: Received {} events from appendBatch()",
      events.size());

  appendBatchCount++;
  return Status.OK;
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:13,代码来源:RpcTestUtils.java

示例4: append

@Override
public Status append(AvroFlumeEvent avroEvent) {
  if (logger.isDebugEnabled()) {
    if (LogPrivacyUtil.allowLogRawData()) {
      logger.debug("Avro source {}: Received avro event: {}", getName(), avroEvent);
    } else {
      logger.debug("Avro source {}: Received avro event", getName());
    }
  }

  sourceCounter.incrementAppendReceivedCount();
  sourceCounter.incrementEventReceivedCount();

  Event event = EventBuilder.withBody(avroEvent.getBody().array(),
      toStringMap(avroEvent.getHeaders()));

  try {
    getChannelProcessor().processEvent(event);
  } catch (ChannelException ex) {
    logger.warn("Avro source " + getName() + ": Unable to process event. " +
        "Exception follows.", ex);
    return Status.FAILED;
  }

  sourceCounter.incrementAppendAcceptedCount();
  sourceCounter.incrementEventAcceptedCount();

  return Status.OK;
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:29,代码来源:AvroSource.java

示例5: appendBatch

@Override
public Status appendBatch(List<AvroFlumeEvent> events) {
  logger.debug("Avro source {}: Received avro event batch of {} events.",
      getName(), events.size());
  sourceCounter.incrementAppendBatchReceivedCount();
  sourceCounter.addToEventReceivedCount(events.size());

  List<Event> batch = new ArrayList<Event>();

  for (AvroFlumeEvent avroEvent : events) {
    Event event = EventBuilder.withBody(avroEvent.getBody().array(),
        toStringMap(avroEvent.getHeaders()));

    batch.add(event);
  }

  try {
    getChannelProcessor().processEventBatch(batch);
  } catch (Throwable t) {
    logger.error("Avro source " + getName() + ": Unable to process event " +
        "batch. Exception follows.", t);
    if (t instanceof Error) {
      throw (Error) t;
    }
    return Status.FAILED;
  }

  sourceCounter.incrementAppendBatchAcceptedCount();
  sourceCounter.addToEventAcceptedCount(events.size());

  return Status.OK;
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:32,代码来源:AvroSource.java

示例6: appendBatch

@Override
public Status appendBatch(List<AvroFlumeEvent> events)
    throws AvroRemoteException {
  logger.debug("Received event batch:{}; delaying for {}ms", events, delay);
  sleep();
  return Status.OK;
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:7,代码来源:TestAvroSink.java

示例7: appendBatch

@Override
public Status appendBatch(List<AvroFlumeEvent> events) {
  logger.debug("Avro source {}: Received avro event batch of {} events.",
      getName(), events.size());
  sourceCounter.incrementAppendBatchReceivedCount();
  sourceCounter.addToEventReceivedCount(events.size());

  List<Event> batch = new ArrayList<Event>();

  for (AvroFlumeEvent avroEvent : events) {
    Event event = EventBuilder.withBody(avroEvent.getBody().array(),
        toStringMap(avroEvent.getHeaders()));

    batch.add(event);
  }

  try {
    getChannelProcessor().processEventBatch(batch);
  } catch (Throwable t) {
    logger.error("Avro source " + getName() + ": Unable to process event " +
        "batch. Exception follows.", t);
    if (t instanceof Error) {
      throw (Error) t;
    }
    return Status.FAILED;
  }
  sourceCounter.incrementAppendBatchAcceptedCount();
  sourceCounter.addToEventAcceptedCount(events.size());
  return Status.OK;
}
 
开发者ID:srotya,项目名称:marauder,代码行数:30,代码来源:MarauderLFSource.java

示例8: appendBatch

@Override
public Status appendBatch(List<AvroFlumeEvent> events) throws
    AvroRemoteException {
  LOG.info("OK: Received {} events from appendBatch()",
      events.size());
  return Status.OK;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:7,代码来源:AvroAsyncRpcClientTest.java

示例9: append

@Override
public Status append(AvroFlumeEvent event) throws AvroRemoteException {
  LOG.info("OK Sleep: Received event from append(): {}",
      new String(event.getBody().array(), Charset.forName("UTF8")));
  try {
    Thread.sleep(sleepTime);
  } catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  return Status.OK;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:12,代码来源:AvroAsyncRpcClientTest.java

示例10: appendBatch

/**
 * Sends the AvroFlumeEvents from it's argument list to the Apache Flink
 * {@link DataStream}.
 * 
 * @param events
 *            The events that is sent to the dataStream
 * @return A Status.OK message if sending the events was successful.
 */
@Override
public Status appendBatch(List<AvroFlumeEvent> events) {
	for (AvroFlumeEvent avroEvent : events) {
		collect(avroEvent);
	}

	return Status.OK;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:16,代码来源:FlumeSource.java

示例11: appendBatch

@Override
public Status appendBatch(final List<AvroFlumeEvent> events) throws AvroRemoteException {
    Preconditions.checkState(eventQueue.addAll(events));
    for (final AvroFlumeEvent event : events) {
        // System.out.println("Received event " + event.getHeaders().get(new org.apache.avro.util.Utf8(FlumeEvent.GUID)));
    }
    return Status.OK;
}
 
开发者ID:OuZhencong,项目名称:log4j2,代码行数:8,代码来源:FlumePersistentAppenderTest.java

示例12: appendBatch

@Override
public Status appendBatch(List<AvroFlumeEvent> events) throws
    AvroRemoteException {
  logger.info("OK: Received {} events from appendBatch()",
      events.size());
  return Status.OK;
}
 
开发者ID:tmalaska,项目名称:Flume.NettyAvroAsyncRpcClient,代码行数:7,代码来源:TestAsyncRpcClient.java

示例13: append

@Override
public Status append(AvroFlumeEvent event) throws AvroRemoteException {
  logger.info("OK Sleep: Received event from append(): {}",
      new String(event.getBody().array(), Charset.forName("UTF8")));
  try {
    Thread.sleep(sleepTime);
  } catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  return Status.OK;
}
 
开发者ID:tmalaska,项目名称:Flume.NettyAvroAsyncRpcClient,代码行数:12,代码来源:TestAsyncRpcClient.java

示例14: append

@Override
public Status append(AvroFlumeEvent event) throws AvroRemoteException {
  logger.debug("Received event:{}", event);
  return Status.OK;
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:5,代码来源:TestAvroSink.java

示例15: append

@Override
public Status append(AvroFlumeEvent event) throws AvroRemoteException {
  eventQueue.add(event);
  return Status.OK;
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:5,代码来源:TestEmbeddedAgent.java


注:本文中的org.apache.flume.source.avro.Status.OK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。