private String getInbox() throws IOException { return ServerConfigUtils.masterInbox(conf); }
public static String masterInimbusDir(Map<String, Object> conf) throws IOException { return (masterLocalDir(conf) + FILE_SEPARATOR + "inimbus"); }
public static String masterStormDistRoot(Map<String, Object> conf, String stormId) throws IOException { return (masterStormDistRoot(conf) + FILE_SEPARATOR + stormId); }
public static File getLogMetaDataFile(String fname) { String[] subStrings = fname.split(Pattern.quote(FILE_SEPARATOR)); // TODO: does this work well on windows? String id = subStrings[0]; Integer port = Integer.parseInt(subStrings[1]); return getLogMetaDataFile(Utils.readStormConfig(), id, port); }
private void addTopoToHistoryLog(String topoId, Map<String, Object> topoConf) { LOG.info("Adding topo to history log: {}", topoId); LocalState state = topologyHistoryState; List<String> users = ServerConfigUtils.getTopoLogsUsers(topoConf); List<String> groups = ServerConfigUtils.getTopoLogsGroups(topoConf); synchronized (topologyHistoryLock) { state.addTopologyHistory(new LSTopoHistory(topoId, Time.currentTimeSecs(), users, groups)); } }
inimbus.prepare(conf, ServerConfigUtils.masterInimbusDir(conf)); this.credRenewers = ClientAuthUtils.getCredentialRenewers(conf); this.topologyHistoryLock = new Object(); this.topologyHistoryState = ServerConfigUtils.nimbusTopoHistoryState(conf); this.nimbusAutocredPlugins = ClientAuthUtils.getNimbusAutoCredPlugins(conf); this.nimbusTopologyActionNotifier = createTopologyActionNotifier(conf);
public static LocalState nimbusTopoHistoryState(Map<String, Object> conf) throws IOException { return _instance.nimbusTopoHistoryStateImpl(conf); }
public static int healthCheck(Map<String, Object> conf) { String healthDir = ServerConfigUtils.absoluteHealthCheckDir(conf); List<String> results = new ArrayList<>(); if (healthDir != null) {
/** * Get the whitelist of users and groups for given file. * * @param fileName file name to get the whitelist */ public LogUserGroupWhitelist getLogUserGroupWhitelist(String fileName) { File wlFile = ServerConfigUtils.getLogMetaDataFile(fileName); Map<String, Object> map = (Map<String, Object>) Utils.readYamlFile(wlFile.getAbsolutePath()); if (map == null) { return null; } List<String> logsUsers = ObjectReader.getStrings(map.get(DaemonConfig.LOGS_USERS)); List<String> logsGroups = ObjectReader.getStrings(map.get(DaemonConfig.LOGS_GROUPS)); return new LogUserGroupWhitelist( logsUsers.isEmpty() ? new HashSet<>() : new HashSet<>(logsUsers), logsGroups.isEmpty() ? new HashSet<>() : new HashSet<>(logsGroups) ); }
Map<String, Object> topoConf = tryReadTopoConf(topoId, topoCache); topoConf = Utils.merge(conf, topoConf); List<String> groups = ServerConfigUtils.getTopoLogsGroups(topoConf); List<String> topoLogUsers = ServerConfigUtils.getTopoLogsUsers(topoConf); if (user == null || isAdmin || isUserPartOf(user, groups)
File file = ServerConfigUtils.getLogMetaDataFile(_conf, _topologyId, _port);
public static String masterInbox(Map<String, Object> conf) throws IOException { String ret = masterLocalDir(conf) + FILE_SEPARATOR + "inbox"; FileUtils.forceMkdir(new File(ret)); return ret; }
@VisibleForTesting public void forceDeleteTopoDistDir(String topoId) throws IOException { Utils.forceDelete(ServerConfigUtils.masterStormDistRoot(conf, topoId)); }
private void makeArtifactoryCache(String location) throws IOException { // First make the cache dir String localDirName = ServerConfigUtils.masterLocalDir(conf) + File.separator + LOCAL_ARTIFACT_DIR; File dir = new File(localDirName); if (!dir.exists()) { dir.mkdirs(); } localCacheDir = localDirName + File.separator + location.replaceAll(File.separator, "_"); dir = new File(localCacheDir); if (!dir.exists()) { dir.mkdir(); } cacheInitialized = true; }
public static String masterStormDistRoot(Map<String, Object> conf) throws IOException { String ret = ConfigUtils.stormDistPath(masterLocalDir(conf)); FileUtils.forceMkdir(new File(ret)); return ret; }
public LocalState nimbusTopoHistoryStateImpl(Map<String, Object> conf) throws IOException { return new LocalState((masterLocalDir(conf) + FILE_SEPARATOR + "history"), true); } }