private static HSAdminRefreshProtocol createHSProxyWithHSAdminRefreshProtocol( InetSocketAddress hsaddr, Configuration conf, UserGroupInformation ugi) throws IOException { HSAdminRefreshProtocolPB proxy = (HSAdminRefreshProtocolPB) createHSProxy( hsaddr, conf, ugi, HSAdminRefreshProtocolPB.class, 0); return new HSAdminRefreshProtocolClientSideTranslatorPB(proxy); }
@Override public void serviceInit(Configuration conf) throws Exception { RPC.setProtocolEngine(conf, RefreshUserMappingsProtocolPB.class, ProtobufRpcEngine.class); RefreshUserMappingsProtocolServerSideTranslatorPB refreshUserMappingXlator = new RefreshUserMappingsProtocolServerSideTranslatorPB( this); BlockingService refreshUserMappingService = RefreshUserMappingsProtocolService .newReflectiveBlockingService(refreshUserMappingXlator); GetUserMappingsProtocolServerSideTranslatorPB getUserMappingXlator = new GetUserMappingsProtocolServerSideTranslatorPB( this); BlockingService getUserMappingService = GetUserMappingsProtocolService .newReflectiveBlockingService(getUserMappingXlator); HSAdminRefreshProtocolServerSideTranslatorPB refreshHSAdminProtocolXlator = new HSAdminRefreshProtocolServerSideTranslatorPB( this); BlockingService refreshHSAdminProtocolService = HSAdminRefreshProtocolService .newReflectiveBlockingService(refreshHSAdminProtocolXlator); WritableRpcEngine.ensureInitialized(); clientRpcAddress = conf.getSocketAddr(JHAdminConfig.JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_PORT); clientRpcServer = new RPC.Builder(conf) .setProtocol(RefreshUserMappingsProtocolPB.class) .setInstance(refreshUserMappingService) .setBindAddress(clientRpcAddress.getHostName()) .setPort(clientRpcAddress.getPort()).setVerbose(false).build(); addProtocol(conf, GetUserMappingsProtocolPB.class, getUserMappingService); addProtocol(conf, HSAdminRefreshProtocolPB.class, refreshHSAdminProtocolService); adminAcl = new AccessControlList(conf.get(JHAdminConfig.JHS_ADMIN_ACL, JHAdminConfig.DEFAULT_JHS_ADMIN_ACL)); }
@Override public void serviceInit(Configuration conf) throws Exception { RPC.setProtocolEngine(conf, RefreshUserMappingsProtocolPB.class, ProtobufRpcEngine.class); RefreshUserMappingsProtocolServerSideTranslatorPB refreshUserMappingXlator = new RefreshUserMappingsProtocolServerSideTranslatorPB( this); BlockingService refreshUserMappingService = RefreshUserMappingsProtocolService .newReflectiveBlockingService(refreshUserMappingXlator); GetUserMappingsProtocolServerSideTranslatorPB getUserMappingXlator = new GetUserMappingsProtocolServerSideTranslatorPB( this); BlockingService getUserMappingService = GetUserMappingsProtocolService .newReflectiveBlockingService(getUserMappingXlator); HSAdminRefreshProtocolServerSideTranslatorPB refreshHSAdminProtocolXlator = new HSAdminRefreshProtocolServerSideTranslatorPB( this); BlockingService refreshHSAdminProtocolService = HSAdminRefreshProtocolService .newReflectiveBlockingService(refreshHSAdminProtocolXlator); WritableRpcEngine.ensureInitialized(); clientRpcAddress = conf.getSocketAddr( JHAdminConfig.MR_HISTORY_BIND_HOST, JHAdminConfig.JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_PORT); clientRpcServer = new RPC.Builder(conf) .setProtocol(RefreshUserMappingsProtocolPB.class) .setInstance(refreshUserMappingService) .setBindAddress(clientRpcAddress.getHostName()) .setPort(clientRpcAddress.getPort()).setVerbose(false).build(); addProtocol(conf, GetUserMappingsProtocolPB.class, getUserMappingService); addProtocol(conf, HSAdminRefreshProtocolPB.class, refreshHSAdminProtocolService); adminAcl = new AccessControlList(conf.get(JHAdminConfig.JHS_ADMIN_ACL, JHAdminConfig.DEFAULT_JHS_ADMIN_ACL)); }