@Override protected String getZkPathUser(Configuration conf) { // We assume that AMs and HS2 run under the same user. return RegistryUtils.currentUser(); }
@Override protected String getZkPathUser(final Configuration conf) { return RegistryUtils.currentUser(); }
public static String currentUser() { return RegistryUtils.currentUser(); }
/** * TODO: purge this once RM is doing the work * * @throws IOException */ protected void setupInitialRegistryPaths() throws IOException { if (registryOperations instanceof RMRegistryOperationsService) { RMRegistryOperationsService rmRegOperations = (RMRegistryOperationsService) registryOperations; rmRegOperations.initUserRegistryAsync(RegistryUtils.currentUser()); } }
@Override protected String getZkPathUser(Configuration conf) { // External LLAP clients would need to set LLAP_ZK_REGISTRY_USER to the LLAP daemon user (hive), // rather than relying on RegistryUtils.currentUser(). return HiveConf.getVar(conf, ConfVars.LLAP_ZK_REGISTRY_USER, RegistryUtils.currentUser()); } }
jstormMasterContext.service_user_name = RegistryUtils.currentUser();
@Override protected String getZkPathUser(Configuration conf) { // We assume that AMs and HS2 run under the same user. return RegistryUtils.currentUser(); }
@Override protected String getZkPathUser(final Configuration conf) { return RegistryUtils.currentUser(); }
public static String currentUser() { return RegistryUtils.currentUser(); }
public String getUsername() throws IOException { return RegistryUtils.currentUser(); }
public String getUsername() throws IOException { return RegistryUtils.currentUser(); }
/** * Get the registry path for an instance under the user's home node * @param instanceName application instance * @return a path to the registry location for this application instance. */ public static String registryPathForInstance(String instanceName) { return RegistryUtils.servicePath( RegistryUtils.currentUser(), SliderKeys.APP_TYPE, instanceName ); }
@Override protected String getZkPathUser(Configuration conf) { // External LLAP clients would need to set LLAP_ZK_REGISTRY_USER to the LLAP daemon user (hive), // rather than relying on RegistryUtils.currentUser(). return HiveConf.getVar(conf, ConfVars.LLAP_ZK_REGISTRY_USER, RegistryUtils.currentUser()); } }
/** * Get the registry path for an instance under the user's home node * @param instanceName application instance * @return a path to the registry location for this application instance. */ public static String registryPathForInstance(String instanceName) { return RegistryUtils.servicePath( RegistryUtils.currentUser(), SliderKeys.APP_TYPE, instanceName ); }
public static ServiceRecord lookupServiceRecord(RegistryOperations rops, String user, String type, String name) throws IOException, SliderException { if (StringUtils.isEmpty(user)) { user = currentUser(); } else { user = RegistryPathUtils.encodeForRegistry(user); } if (StringUtils.isEmpty(type)) { type = SliderKeys.APP_TYPE; } String path = servicePath(user, type, name); return resolve(rops, path); }
public static ServiceRecord lookupServiceRecord(RegistryOperations rops, String user, String type, String name) throws IOException, SliderException { if (StringUtils.isEmpty(user)) { user = currentUser(); } else { user = RegistryPathUtils.encodeForRegistry(user); } if (StringUtils.isEmpty(type)) { type = SliderKeys.APP_TYPE; } String path = servicePath(user, type, name); return resolve(rops, path); }
/** * List instances in the registry * @return the instance IDs * @throws IOException * @throws YarnException */ public List<String> listRegisteredSliderInstances() throws IOException, YarnException { try { Map<String, ServiceRecord> recordMap = listServiceRecords( getRegistryOperations(), serviceclassPath(currentUser(), SliderKeys.APP_TYPE)); return new ArrayList<>(recordMap.keySet()); } catch (PathNotFoundException e) { log.debug("No registry path for slider instances for current user: {}", e, e); // no entries: return an empty list return new ArrayList<>(0); } catch (IOException | YarnException e) { throw e; } catch (Exception e) { throw new IOException(e); } }
/** * List instances in the registry * @return the instance IDs * @throws IOException * @throws YarnException */ public List<String> listRegisteredSliderInstances() throws IOException, YarnException { try { Map<String, ServiceRecord> recordMap = listServiceRecords( getRegistryOperations(), serviceclassPath(currentUser(), SliderKeys.APP_TYPE)); return new ArrayList<>(recordMap.keySet()); } catch (PathNotFoundException e) { log.debug("No registry path for slider instances for current user: {}", e, e); // no entries: return an empty list return new ArrayList<>(0); } catch (IOException | YarnException e) { throw e; } catch (Exception e) { throw new IOException(e); } }
/** * List instances in the registry for the current user * @return a list of slider registry instances * @throws IOException Any IO problem ... including no path in the registry * to slider service classes for this user * @throws SliderException other failures */ public Map<String, ServiceRecord> listRegistryInstances() throws IOException, SliderException { Map<String, ServiceRecord> recordMap = listServiceRecords( getRegistryOperations(), serviceclassPath(currentUser(), SliderKeys.APP_TYPE)); return recordMap; }
/** * List instances in the registry for the current user * @return a list of slider registry instances * @throws IOException Any IO problem ... including no path in the registry * to slider service classes for this user * @throws SliderException other failures */ public Map<String, ServiceRecord> listRegistryInstances() throws IOException, SliderException { Map<String, ServiceRecord> recordMap = listServiceRecords( getRegistryOperations(), serviceclassPath(currentUser(), SliderKeys.APP_TYPE)); return recordMap; }