ServiceRequestLimiter extends DynamicRequestLimiter<StreamOp> { public ServiceRequestLimiter(DynamicDistributedLogConfiguration dynConf, StatsLogger statsLogger, MovingAverageRate serviceRps, MovingAverageRate serviceBps, StreamManager streamManager, Feature disabledFeature) { super(dynConf, statsLogger, disabledFeature); this.limiterStatLogger = statsLogger; this.streamManager = streamManager; this.serviceRps = serviceRps; this.serviceBps = serviceBps; this.limiter = build(); } ServiceRequestLimiter(DynamicDistributedLogConfiguration dynConf,
                                 StatsLogger statsLogger,
                                 MovingAverageRate serviceRps,
                                 MovingAverageRate serviceBps,
                                 StreamManager streamManager,
                                 Feature disabledFeature); @Override RequestLimiter<StreamOp> build();  }
@Test(timeout = 60000) public void testServiceRequestLimiter() throws Exception { MockHardRequestLimiter limiter = new MockHardRequestLimiter(new CounterLimiter(1)); limiter.apply(new MockRequest()); try { limiter.apply(new MockRequest()); } catch (OverCapacityException ex) { } assertEquals(1, limiter.getLimitHitCount()); }