@Override public boolean connect(StatsCollectionContext context) { conf = context.getHiveConf(); List<String> statsDirs = context.getStatsTmpDirs(); assert statsDirs.size() == 1 : "Found multiple stats dirs: " + statsDirs; Path statsDir = new Path(statsDirs.get(0)); LOG.debug("Connecting to : " + statsDir); statsMap = new HashMap<String, Map<String,String>>(); try { return statsDir.getFileSystem(conf).exists(statsDir); } catch (IOException e) { LOG.error("Failed to check if dir exists", e); return false; } }
@Override public boolean init(StatsCollectionContext context) { try { for (String tmpDir : context.getStatsTmpDirs()) { Path statsDir = new Path(tmpDir); LOG.debug("Initing FSStatsPublisher with : " + statsDir); statsDir.getFileSystem(context.getHiveConf()).mkdirs(statsDir); LOG.info("created : " + statsDir); } return true; } catch (IOException e) { LOG.error("Failed to create dir", e); return false; } }
@Override public boolean connect(StatsCollectionContext context) { conf = context.getHiveConf(); List<String> statsDirs = context.getStatsTmpDirs(); assert statsDirs.size() == 1 : "Found multiple stats dirs: " + statsDirs; Path statsDir = new Path(statsDirs.get(0)); LOG.debug("Connecting to : " + statsDir); statsMap = new HashMap<String, Map<String,String>>(); try { return statsDir.getFileSystem(conf).exists(statsDir); } catch (IOException e) { LOG.error("Failed to check if dir exists", e); return false; } }
@Override public boolean init(StatsCollectionContext context) { try { for (String tmpDir : context.getStatsTmpDirs()) { Path statsDir = new Path(tmpDir); LOG.debug("Initing FSStatsPublisher with : " + statsDir); statsDir.getFileSystem(context.getHiveConf()).mkdirs(statsDir); LOG.info("created : " + statsDir); } return true; } catch (IOException e) { LOG.error("Failed to create dir", e); return false; } }
fs = statsDir.getFileSystem(scc.getHiveConf()); statsList = new ArrayList<Map<String,Map<String,String>>>(); FileStatus[] status = fs.listStatus(statsDir, new PathFilter() {
fs = statsDir.getFileSystem(scc.getHiveConf()); statsList = new ArrayList<Map<String,Map<String,String>>>(); FileStatus[] status = fs.listStatus(statsDir, new PathFilter() {