@SuppressWarnings("unchecked") public static <T> T createProxy(Configuration conf, InetSocketAddress hsaddr, Class<T> xface, UserGroupInformation ugi) throws IOException { T proxy; if (xface == RefreshUserMappingsProtocol.class) { proxy = (T) createHSProxyWithRefreshUserMappingsProtocol(hsaddr, conf, ugi); } else if (xface == GetUserMappingsProtocol.class) { proxy = (T) createHSProxyWithGetUserMappingsProtocol(hsaddr, conf, ugi); } else if (xface == HSAdminRefreshProtocol.class) { proxy = (T) createHSProxyWithHSAdminRefreshProtocol(hsaddr, conf, ugi); } else { String message = "Unsupported protocol found when creating the proxy " + "connection to History server: " + ((xface != null) ? xface.getClass().getName() : "null"); LOG.error(message); throw new IllegalStateException(message); } return proxy; }
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); }
private int refreshAdminAcls() throws IOException { // Refresh the admin acls Configuration conf = getConf(); InetSocketAddress address = conf.getSocketAddr( JHAdminConfig.JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_PORT); HSAdminRefreshProtocol refreshProtocol = HSProxies.createProxy(conf, address, HSAdminRefreshProtocol.class, UserGroupInformation.getCurrentUser()); refreshProtocol.refreshAdminAcls(); return 0; }
private int refreshLoadedJobCache() throws IOException { // Refresh the loaded job cache Configuration conf = getConf(); InetSocketAddress address = conf.getSocketAddr( JHAdminConfig.JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_PORT); HSAdminRefreshProtocol refreshProtocol = HSProxies.createProxy(conf, address, HSAdminRefreshProtocol.class, UserGroupInformation.getCurrentUser()); refreshProtocol.refreshLoadedJobCache(); return 0; }
private int refreshJobRetentionSettings() throws IOException { // Refresh job retention settings Configuration conf = getConf(); InetSocketAddress address = conf.getSocketAddr( JHAdminConfig.JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_PORT); HSAdminRefreshProtocol refreshProtocol = HSProxies.createProxy(conf, address, HSAdminRefreshProtocol.class, UserGroupInformation.getCurrentUser()); refreshProtocol.refreshJobRetentionSettings(); return 0; }
private int refreshLogRetentionSettings() throws IOException { // Refresh log retention settings Configuration conf = getConf(); InetSocketAddress address = conf.getSocketAddr( JHAdminConfig.JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_ADDRESS, JHAdminConfig.DEFAULT_JHS_ADMIN_PORT); HSAdminRefreshProtocol refreshProtocol = HSProxies.createProxy(conf, address, HSAdminRefreshProtocol.class, UserGroupInformation.getCurrentUser()); refreshProtocol.refreshLogRetentionSettings(); return 0; }
public HSAdminRefreshProtocolServerSideTranslatorPB( HSAdminRefreshProtocol impl) { this.impl = impl; }