Search in sources :

Example 1 with RpcServer

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

the class TokenProvider method start.

@Override
public void start(CoprocessorEnvironment env) {
    // if running at region
    if (env instanceof RegionCoprocessorEnvironment) {
        RegionCoprocessorEnvironment regionEnv = (RegionCoprocessorEnvironment) env;
        /* Getting the RpcServer from a RegionCE is wrong. There cannot be an expectation that Region
       is hosted inside a RegionServer. If you need RpcServer, then pass in a RegionServerCE.
       TODO: FIX.
       */
        RegionServerServices rss = ((HasRegionServerServices) regionEnv).getRegionServerServices();
        RpcServerInterface server = rss.getRpcServer();
        SecretManager<?> mgr = ((RpcServer) server).getSecretManager();
        if (mgr instanceof AuthenticationTokenSecretManager) {
            secretManager = (AuthenticationTokenSecretManager) mgr;
        }
    }
}
Also used : RegionCoprocessorEnvironment(org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment) HasRegionServerServices(org.apache.hadoop.hbase.coprocessor.HasRegionServerServices) RegionServerServices(org.apache.hadoop.hbase.regionserver.RegionServerServices) HasRegionServerServices(org.apache.hadoop.hbase.coprocessor.HasRegionServerServices) RpcServer(org.apache.hadoop.hbase.ipc.RpcServer) RpcServerInterface(org.apache.hadoop.hbase.ipc.RpcServerInterface)

Aggregations

HasRegionServerServices (org.apache.hadoop.hbase.coprocessor.HasRegionServerServices)1 RegionCoprocessorEnvironment (org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment)1 RpcServer (org.apache.hadoop.hbase.ipc.RpcServer)1 RpcServerInterface (org.apache.hadoop.hbase.ipc.RpcServerInterface)1 RegionServerServices (org.apache.hadoop.hbase.regionserver.RegionServerServices)1