use of com.linkedin.databus.client.pub.ConsumerCallbackResult in project databus by linkedin.
the class LoggingConsumer method onStartBootstrapSequence.
@Override
public ConsumerCallbackResult onStartBootstrapSequence(SCN startScn) {
startDataEventSequenceStats();
ConsumerCallbackResult result = super.onStartBootstrapSequence(startScn);
return doStartDataEventSequence(startScn, result, true);
}
use of com.linkedin.databus.client.pub.ConsumerCallbackResult in project databus by linkedin.
the class LoggingConsumer method onStartDataEventSequence.
@Override
public ConsumerCallbackResult onStartDataEventSequence(SCN startScn) {
startDataEventSequenceStats();
ConsumerCallbackResult result = super.onStartDataEventSequence(startScn);
return doStartDataEventSequence(startScn, result, false);
}
use of com.linkedin.databus.client.pub.ConsumerCallbackResult in project databus by linkedin.
the class BatchingDatabusCombinedConsumer method addBootstrapEvent.
private ConsumerCallbackResult addBootstrapEvent(T eventObj) {
ConsumerCallbackResult result = ConsumerCallbackResult.SUCCESS;
_bootstrapEvents.add(eventObj);
if (_bootstrapEvents.size() >= _staticConfig.getBootstrapBatchSize()) {
result = flushBootstrapEvents();
}
return result;
}
use of com.linkedin.databus.client.pub.ConsumerCallbackResult in project databus by linkedin.
the class MultiConsumerCallback method onStartSource.
@Override
public ConsumerCallbackResult onStartSource(String source, Schema sourceSchema) {
long curNanos = System.nanoTime();
for (DatabusV2ConsumerRegistration consumerReg : _registrations) {
for (DatabusCombinedConsumer consumer : consumerReg.getConsumers()) {
ConsumerCallable<ConsumerCallbackResult> startSourceCallable = _callbackFactory.createStartSourceCallable(curNanos, source, sourceSchema, consumer, true);
_currentBatch.add(startSourceCallable);
if (_consumerStats != null)
_consumerStats.registerEventsReceived(1);
}
}
if (_loggingConsumer != null) {
ConsumerCallable<ConsumerCallbackResult> startSourceCallable = _callbackFactory.createStartSourceCallable(curNanos, source, sourceSchema, _loggingConsumer, false);
_currentBatch.add(startSourceCallable);
}
if (_log.isDebugEnabled()) {
long endNanos = System.nanoTime();
_log.debug("Time spent in databus clientlib by onStartSource = " + (endNanos - curNanos) / DbusConstants.NUM_NSECS_IN_MSEC + "ms");
}
return submitBatch(curNanos, false, true);
}
use of com.linkedin.databus.client.pub.ConsumerCallbackResult in project databus by linkedin.
the class MultiConsumerCallback method onError.
@Override
public ConsumerCallbackResult onError(Throwable err) {
long curNanos = System.nanoTime();
for (DatabusV2ConsumerRegistration consumerReg : _registrations) {
for (DatabusCombinedConsumer consumer : consumerReg.getConsumers()) {
ConsumerCallable<ConsumerCallbackResult> onErrorCallable = _callbackFactory.createOnErrorCallable(curNanos, err, consumer, true);
_currentBatch.add(onErrorCallable);
// FIXME: bug? "processed" usually means consumer callback has completed; registerErrorEventsProcessed() normally called only if consumer callback returns ERROR: why no registerErrorEventsReceived() call here?
if (_consumerStats != null)
_consumerStats.registerErrorEventsProcessed(1);
}
}
if (_loggingConsumer != null) {
ConsumerCallable<ConsumerCallbackResult> onErrorCallable = _callbackFactory.createOnErrorCallable(curNanos, err, _loggingConsumer, false);
_currentBatch.add(onErrorCallable);
}
if (_log.isDebugEnabled()) {
long endNanos = System.nanoTime();
_log.debug("Time spent in databus clientlib by onError = " + (endNanos - curNanos) / DbusConstants.NUM_NSECS_IN_MSEC + "ms");
}
return submitBatch(curNanos, true, true);
}
Aggregations