Search in sources :

Example 1 with RpcScheduler

use of org.apache.hadoop.hbase.ipc.RpcScheduler in project phoenix by apache.

the class PhoenixRpcSchedulerFactory method create.

@Override
public RpcScheduler create(Configuration conf, PriorityFunction priorityFunction, Abortable abortable) {
    // create the delegate scheduler
    RpcScheduler delegate;
    try {
        // happens in <=0.98.4 where the scheduler factory is not visible
        delegate = new SimpleRpcSchedulerFactory().create(conf, priorityFunction, abortable);
    } catch (IllegalAccessError e) {
        LOG.fatal(VERSION_TOO_OLD_FOR_INDEX_RPC);
        throw e;
    }
    // get the index priority configs
    int indexPriority = getIndexPriority(conf);
    validatePriority(indexPriority);
    // get the metadata priority configs
    int metadataPriority = getMetadataPriority(conf);
    validatePriority(metadataPriority);
    // validate index and metadata priorities are not the same
    Preconditions.checkArgument(indexPriority != metadataPriority, "Index and Metadata priority must not be same " + indexPriority);
    LOG.info("Using custom Phoenix Index RPC Handling with index rpc priority " + indexPriority + " and metadata rpc priority " + metadataPriority);
    PhoenixRpcScheduler scheduler = new PhoenixRpcScheduler(conf, delegate, indexPriority, metadataPriority);
    return scheduler;
}
Also used : SimpleRpcSchedulerFactory(org.apache.hadoop.hbase.regionserver.SimpleRpcSchedulerFactory) RpcScheduler(org.apache.hadoop.hbase.ipc.RpcScheduler)

Example 2 with RpcScheduler

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

the class TestRpcSchedulerFactory method testRWQ.

@Test
public void testRWQ() {
    // Set some configs just to see how it changes the scheduler. Can't assert the settings had
    // an effect. Just eyeball the log.
    this.conf.setDouble(RWQueueRpcExecutor.CALL_QUEUE_READ_SHARE_CONF_KEY, 0.5);
    this.conf.setDouble(RpcExecutor.CALL_QUEUE_HANDLER_FACTOR_CONF_KEY, 0.5);
    this.conf.setDouble(RWQueueRpcExecutor.CALL_QUEUE_SCAN_SHARE_CONF_KEY, 0.5);
    RpcSchedulerFactory factory = new SimpleRpcSchedulerFactory();
    RpcScheduler rpcScheduler = factory.create(this.conf, null, null);
    assertTrue(rpcScheduler.getClass().equals(SimpleRpcScheduler.class));
}
Also used : SimpleRpcScheduler(org.apache.hadoop.hbase.ipc.SimpleRpcScheduler) FifoRpcScheduler(org.apache.hadoop.hbase.ipc.FifoRpcScheduler) RpcScheduler(org.apache.hadoop.hbase.ipc.RpcScheduler) SimpleRpcScheduler(org.apache.hadoop.hbase.ipc.SimpleRpcScheduler) Test(org.junit.Test)

Example 3 with RpcScheduler

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

the class TestRpcSchedulerFactory method testFifo.

@Test
public void testFifo() {
    RpcSchedulerFactory factory = new FifoRpcSchedulerFactory();
    RpcScheduler rpcScheduler = factory.create(this.conf, null, null);
    assertTrue(rpcScheduler.getClass().equals(FifoRpcScheduler.class));
}
Also used : FifoRpcScheduler(org.apache.hadoop.hbase.ipc.FifoRpcScheduler) FifoRpcScheduler(org.apache.hadoop.hbase.ipc.FifoRpcScheduler) RpcScheduler(org.apache.hadoop.hbase.ipc.RpcScheduler) SimpleRpcScheduler(org.apache.hadoop.hbase.ipc.SimpleRpcScheduler) Test(org.junit.Test)

Aggregations

RpcScheduler (org.apache.hadoop.hbase.ipc.RpcScheduler)3 FifoRpcScheduler (org.apache.hadoop.hbase.ipc.FifoRpcScheduler)2 SimpleRpcScheduler (org.apache.hadoop.hbase.ipc.SimpleRpcScheduler)2 Test (org.junit.Test)2 SimpleRpcSchedulerFactory (org.apache.hadoop.hbase.regionserver.SimpleRpcSchedulerFactory)1