rmarsch commented on a change in pull request #3944:
URL: https://github.com/apache/hbase/pull/3944#discussion_r769065613



##########
File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestSimpleRpcScheduler.java
##########
@@ -274,6 +275,41 @@ public void testPluggableRpcQueue() throws Exception {
     }
   }
 
+  @Test
+  public void testPluggableRpcQueueWireUpWithFastPathExecutor() throws 
Exception {
+    String queueType = RpcExecutor.CALL_QUEUE_TYPE_PLUGGABLE_CONF_VALUE;
+    Configuration schedConf = HBaseConfiguration.create();
+    schedConf.set(RpcExecutor.CALL_QUEUE_TYPE_CONF_KEY, queueType);
+    schedConf.set(RpcExecutor.PLUGGABLE_CALL_QUEUE_CLASS_NAME, 
"org.apache.hadoop.hbase.ipc.TestPluggableQueueImpl");
+    
schedConf.setBoolean(RpcExecutor.PLUGGABLE_CALL_QUEUE_WITH_FAST_PATH_ENABLED, 
true);
+
+    PriorityFunction priority = mock(PriorityFunction.class);
+    when(priority.getPriority(any(), any(), 
any())).thenReturn(HConstants.NORMAL_QOS);
+    SimpleRpcScheduler scheduler = new SimpleRpcScheduler(schedConf, 0, 0, 0, 
priority,
+      HConstants.QOS_THRESHOLD);
+
+    Field f = scheduler.getClass().getDeclaredField("callExecutor");
+    f.setAccessible(true);
+    assertTrue(f.get(scheduler) instanceof FastPathBalancedQueueRpcExecutor);

Review comment:
       I didn't have a better testing idea off the top of my head. The indirect 
coupling to field name and other circumstantial structure is less than ideal. I 
figured I'd start somewhere, I'm not sure if there are many other ways to 
verify the behavior. Maybe it's minor enough to not really necessitate a test.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to