Search in sources :

Example 1 with SimpleRpcSchedulerFactory

use of org.apache.hadoop.hbase.regionserver.SimpleRpcSchedulerFactory 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)

Aggregations

RpcScheduler (org.apache.hadoop.hbase.ipc.RpcScheduler)1 SimpleRpcSchedulerFactory (org.apache.hadoop.hbase.regionserver.SimpleRpcSchedulerFactory)1