@Test
  public void testNettyWritableWatermarks() throws Exception {
    Configuration conf = HBaseConfiguration.create();
    conf.setInt(NettyRpcServer.CHANNEL_WRITABLE_LOW_WATERMARK_KEY, 1);
    conf.setInt(NettyRpcServer.CHANNEL_WRITABLE_HIGH_WATERMARK_KEY, 2);

    NettyRpcServer rpcServer = createRpcServer(conf, 0);
    try {
      sendAndReceive(conf, rpcServer, 5);
      METRICS_ASSERT.assertCounterGt("unwritableTime_numOps", 0,
        rpcServer.metrics.getMetricsSource());
    } finally {
      rpcServer.stop();
    }
  }
Test that we properly send configured watermarks to netty, and trigger setWritable when
necessary.
hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestNettyChannelWritability.java