Search in sources :

Example 6 with TimedQuota

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)));
}
Also used : TimedQuota(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.TimedQuota) ThrottleRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleRequest) Test(org.junit.Test)

Aggregations

TimedQuota (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.TimedQuota)6 ThrottleRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleRequest)3 Test (org.junit.Test)3 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)1 QuotaProtos (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos)1 Throttle (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle)1 Pair (org.apache.hadoop.hbase.util.Pair)1