Search in sources :

Example 1 with PriorityFunction

use of org.apache.hadoop.hbase.ipc.PriorityFunction in project hbase by apache.

the class TestPriorityRpc method testQosFunctionWithoutKnownArgument.

@Test
public void testQosFunctionWithoutKnownArgument() throws IOException {
    //The request is not using any of the
    //known argument classes (it uses one random request class)
    //(known argument classes are listed in
    //HRegionServer.QosFunctionImpl.knownArgumentClasses)
    RequestHeader.Builder headerBuilder = RequestHeader.newBuilder();
    headerBuilder.setMethodName("foo");
    RequestHeader header = headerBuilder.build();
    PriorityFunction qosFunc = regionServer.rpcServices.getPriority();
    assertEquals(HConstants.NORMAL_QOS, qosFunc.getPriority(header, null, User.createUserForTesting(regionServer.conf, "someuser", new String[] { "somegroup" })));
}
Also used : PriorityFunction(org.apache.hadoop.hbase.ipc.PriorityFunction) RequestHeader(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader) Test(org.junit.Test)

Aggregations

PriorityFunction (org.apache.hadoop.hbase.ipc.PriorityFunction)1 RequestHeader (org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader)1 Test (org.junit.Test)1