@Test public void testEviction2() throws Exception { try { Configuration conf = cluster.getConf(); FileSystem fs = FileSystem.get(conf); fs.delete(new Path("/"), true); stream.clear(); Pair<List<String>, List<String>> pair; pair = createTestData("feed1", "yyyy-MM-dd/'more'/yyyy", 10, TimeUnit.DAYS,"/data"); String dataPath = "/data/YYYY/feed1/mmHH/dd/MM/?{YEAR}-?{MONTH}-?{DAY}/more/?{YEAR}"; String logFile = "/ivory/staging/feed/instancePaths-2012-01-01-01-00.csv"; FeedEvictor.main(new String[] { "-feedBasePath",cluster.getConf().get("fs.default.name") + dataPath, "-retentionType","instance", "-retentionLimit","days(10)", "-timeZone","UTC", "-frequency","daily", "-logFile",logFile}); assertFailures(fs, pair); compare(map.get("feed1"), stream.getBuffer()); Assert.assertEquals(readLogFile(new Path(logFile)), getExpectedInstancePaths(dataPath)); } catch (Exception e) { Assert.fail("Unknown exception", e); } }
public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); Path confPath = new Path("file: LOG.info(confPath + " found ? " + confPath.getFileSystem(conf).exists(confPath)); conf.addResource(confPath); int ret = ToolRunner.run(conf, new FeedEvictor(), args); if (ret != 0) { throw new Exception("Unable to perform eviction action args: " + Arrays.toString(args)); } }
FeedEvictor extends Configured implements Tool { public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); Path confPath = new Path("file: LOG.info(confPath + " found ? " + confPath.getFileSystem(conf).exists(confPath)); conf.addResource(confPath); int ret = ToolRunner.run(conf, new FeedEvictor(), args); if (ret != 0) { throw new Exception("Unable to perform eviction action args: " + Arrays.toString(args)); } } }
FeedEvictor extends Configured implements Tool { public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); Path confPath = new Path("file: LOG.info(confPath + " found ? " + confPath.getFileSystem(conf).exists(confPath)); conf.addResource(confPath); int ret = ToolRunner.run(conf, new FeedEvictor(), args); if (ret != 0) { throw new Exception("Unable to perform eviction action args: " + Arrays.toString(args)); } }  }
FeedEvictor extends Configured implements Tool { public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); Path confPath = new Path("file: LOG.info(confPath + " found ? " + confPath.getFileSystem(conf).exists(confPath)); conf.addResource(confPath); int ret = ToolRunner.run(conf, new FeedEvictor(), args); if (ret != 0) { throw new Exception("Unable to perform eviction action args: " + Arrays.toString(args)); } }  static void main(String[] args); @Override int run(String[] args); }
FeedEvictor extends Configured implements Tool { public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); Path confPath = new Path("file: LOG.info(confPath + " found ? " + confPath.getFileSystem(conf).exists(confPath)); conf.addResource(confPath); int ret = ToolRunner.run(conf, new FeedEvictor(), args); if (ret != 0) { throw new Exception("Unable to perform eviction action args: " + Arrays.toString(args)); } }  static void main(String[] args); @Override int run(String[] args);  }