/** * In case of BatchException we expect that the dispatcher has removed all * the events till the event that threw BatchException. */ public void handleException() { final GatewaySenderStats statistics = this.sender.getStatistics(); statistics.incBatchesRedistributed(); this.resetLastPeekedEvents = true; }
/** * In case of BatchException we expect that the dispatcher has removed all * the events till the event that threw BatchException. */ public void handleException() { final GatewaySenderStats statistics = this.sender.getStatistics(); statistics.incBatchesRedistributed(); this.resetLastPeekedEvents = true; }
private void handleUnSuccessfulBatchDispatch(List events) { final GatewaySenderStats statistics = this.sender.getStatistics(); statistics.incBatchesRedistributed(); // Set posDup flag on each event in the batch Iterator it = events.iterator(); while (it.hasNext() && !this.isStopped) { Object o = it.next(); if (o != null && o instanceof GatewaySenderEventImpl) { GatewaySenderEventImpl ge = (GatewaySenderEventImpl)o; ge.setPossibleDuplicate(true); } } }
private void handleUnSuccessfulBatchDispatch(List events) { final GatewaySenderStats statistics = this.sender.getStatistics(); statistics.incBatchesRedistributed(); // Set posDup flag on each event in the batch Iterator it = events.iterator(); while (it.hasNext() && !this.isStopped) { Object o = it.next(); if (o != null && o instanceof GatewaySenderEventImpl) { GatewaySenderEventImpl ge = (GatewaySenderEventImpl)o; ge.setPossibleDuplicate(true); } } }
public void handleUnSuccessBatchAck(int bId, int numEvents) { this.sender.getStatistics().incBatchesRedistributed(); // Set posDup flag on each event in the batch List events = this.batchIdToEventsMap.get(bId); if(events!=null){ Iterator it = events.iterator(); while (it.hasNext() && !this.isStopped) { Object o = it.next(); if (o != null && o instanceof GatewaySenderEventImpl) { GatewaySenderEventImpl ge = (GatewaySenderEventImpl)o; ge.setPossibleDuplicate(true); } } } }
public void handleUnSuccessBatchAck(int bId) { this.sender.getStatistics().incBatchesRedistributed(); // Set posDup flag on each event in the batch List<GatewaySenderEventImpl>[] eventsArr = this.batchIdToEventsMap.get(bId); if(eventsArr!=null){ List<GatewaySenderEventImpl> events = eventsArr[0]; Iterator it = events.iterator(); while (it.hasNext() && !this.isStopped) { Object o = it.next(); if (o != null && o instanceof GatewaySenderEventImpl) { GatewaySenderEventImpl ge = (GatewaySenderEventImpl)o; ge.setPossibleDuplicate(true); } } } }
public void testSenderStats() throws InterruptedException{ senderStats.incBatchesRedistributed(); senderStats.incEventsReceived(); senderStats.setQueueSize(10); senderStats.endPut(testStartTime); senderStats.endBatch(testStartTime, 100); senderStats.incEventsNotQueuedConflated(); sample(); assertEquals(1, getTotalBatchesRedistributed()); assertEquals(1, getTotalEventsConflated()); assertEquals(10, getEventQueueSize()); assertTrue(getEventsQueuedRate() >0); assertTrue(getEventsReceivedRate() >0); assertTrue(getBatchesDispatchedRate() >0); assertTrue(getAverageDistributionTimePerBatch() >0); }