use of org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.TimedQuota in project hbase by apache.
the class TestThrottleSettings method testNoThrottleReturnsOriginal.
@Test
public void testNoThrottleReturnsOriginal() throws IOException {
TimedQuota tq1 = TimedQuota.newBuilder().setSoftLimit(10).setScope(QuotaProtos.QuotaScope.MACHINE).setTimeUnit(HBaseProtos.TimeUnit.MINUTES).build();
ThrottleRequest tr1 = ThrottleRequest.newBuilder().setTimedQuota(tq1).setType(QuotaProtos.ThrottleType.REQUEST_NUMBER).build();
ThrottleSettings orig = new ThrottleSettings("joe", null, null, null, tr1);
ThrottleRequest tr2 = ThrottleRequest.newBuilder().setType(QuotaProtos.ThrottleType.REQUEST_NUMBER).build();
assertTrue("The same object should be returned by merge, but it wasn't", orig == orig.merge(new ThrottleSettings("joe", null, null, null, tr2)));
}
Aggregations