本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例8: appendBatch
@Override
public Status appendBatch(List<AvroFlumeEvent> events) throws
AvroRemoteException {
LOG.info("OK: Received {} events from appendBatch()",
events.size());
return Status.OK;
}
示例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;
}
示例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;
}
示例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;
}
示例12: appendBatch
@Override
public Status appendBatch(List<AvroFlumeEvent> events) throws
AvroRemoteException {
logger.info("OK: Received {} events from appendBatch()",
events.size());
return Status.OK;
}
示例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;
}
示例14: append
@Override
public Status append(AvroFlumeEvent event) throws AvroRemoteException {
logger.debug("Received event:{}", event);
return Status.OK;
}
示例15: append
@Override
public Status append(AvroFlumeEvent event) throws AvroRemoteException {
eventQueue.add(event);
return Status.OK;
}