use of com.linkedin.databus.client.pub.ConsumerCallbackResult in project databus by linkedin.
the class JsonDtailPrinter method printGenericRecord.
/**
* @see com.linkedin.databus2.tools.dtail.GenericRecordDtailPrinter#printGenericRecord(org.apache.avro.generic.GenericRecord)
*/
@Override
public ConsumerCallbackResult printGenericRecord(GenericRecord r) {
ConsumerCallbackResult result = ConsumerCallbackResult.SUCCESS;
try {
_out.write(r.toString().getBytes(Charset.defaultCharset()));
_out.write('\n');
} catch (RuntimeException re) {
LOG.error("event dump error: " + re.getMessage(), re);
result = ConsumerCallbackResult.ERROR;
} catch (IOException ioe) {
LOG.error("event dump error: " + ioe.getMessage(), ioe);
result = ConsumerCallbackResult.ERROR;
}
return result;
}
use of com.linkedin.databus.client.pub.ConsumerCallbackResult in project databus by linkedin.
the class BatchingDatabusCombinedConsumer method addDataEvent.
private ConsumerCallbackResult addDataEvent(T eventObj) {
ConsumerCallbackResult result = ConsumerCallbackResult.SUCCESS;
_streamEvents.add(eventObj);
if (_streamEvents.size() >= _staticConfig.getStreamBatchSize()) {
result = flushStreamEvents();
}
return result;
}
use of com.linkedin.databus.client.pub.ConsumerCallbackResult in project databus by linkedin.
the class BatchingDatabusCombinedConsumer method flushBootstrapEvents.
private ConsumerCallbackResult flushBootstrapEvents() {
ConsumerCallbackResult result;
if (0 == _bootstrapEvents.size())
result = ConsumerCallbackResult.SUCCESS;
else {
result = onBootstrapEventsBatch(_bootstrapEvents);
_bootstrapEvents.clear();
}
return result;
}
use of com.linkedin.databus.client.pub.ConsumerCallbackResult in project databus by linkedin.
the class BatchingDatabusCombinedConsumer method onDataEvent.
@Override
public ConsumerCallbackResult onDataEvent(DbusEvent e, DbusEventDecoder eventDecoder) {
T eventObj = eventDecoder.getTypedValue(e, (T) null, _payloadClass);
ConsumerCallbackResult result = addDataEvent(eventObj);
return result;
}
use of com.linkedin.databus.client.pub.ConsumerCallbackResult in project databus by linkedin.
the class BatchingDatabusCombinedConsumer method flushStreamEvents.
private ConsumerCallbackResult flushStreamEvents() {
ConsumerCallbackResult result;
if (0 == _streamEvents.size())
result = ConsumerCallbackResult.SUCCESS;
else {
result = onDataEventsBatch(_streamEvents);
_streamEvents.clear();
}
return result;
}
Aggregations