/** * Generate data. Schedule process. Try to perform -kill operation using -start and -end which are * both in future with respect to process start. * * @throws Exception TODO amend test with validations */ @Test(groups = {"singleCluster"}) public void testProcessInstanceKillBothStartAndEndInFuture01() throws Exception { /* both start and end r in future with respect to process start end */ String startTime = TimeUtil.getTimeWrtSystemTime(-20); String endTime = TimeUtil.getTimeWrtSystemTime(400); String startTimeData = TimeUtil.getTimeWrtSystemTime(-50); String endTimeData = TimeUtil.getTimeWrtSystemTime(50); List<String> dataDates = TimeUtil.getMinuteDatesOnEitherSide(startTimeData, endTimeData, 1); HadoopUtil.flattenAndPutDataInFolder( clusterFS, OSUtil.SINGLE_FILE, baseTestHDFSDir + "/input01", dataDates); bundles[0].setInputFeedDataPath(feedInputPath.replace("input/", "input01/")); bundles[0].setProcessValidity(startTime, endTime); bundles[0].setProcessPeriodicity(5, TimeUnit.minutes); bundles[0].setOutputFeedPeriodicity(5, TimeUnit.minutes); bundles[0].setOutputFeedLocationData(feedOutputPath); bundles[0].setProcessConcurrency(6); bundles[0].submitFeedsScheduleProcess(prism); String startTimeRequest = TimeUtil.getTimeWrtSystemTime(-17); String endTimeRequest = TimeUtil.getTimeWrtSystemTime(23); InstancesResult r = prism .getProcessHelper() .getProcessInstanceKill( Util.readEntityName(bundles[0].getProcessData()), "?start=" + startTimeRequest + "&end=" + endTimeRequest); LOGGER.info(r.toString()); }
/** * Schedule process. Perform -kill action on instances between -start and -end dates which expose * range of last 3 instances which have been materialized already and those which should be. Check * that only existent instances are killed. * * @throws Exception */ @Test(groups = {"singleCluster"}) public void testProcessInstanceKillKillNonMatrelized() throws Exception { bundles[0].setProcessValidity("2010-01-02T00:00Z", "2010-01-02T04:00Z"); bundles[0].setProcessTimeOut(3, TimeUnit.minutes); bundles[0].setProcessPeriodicity(1, TimeUnit.minutes); bundles[0].setOutputFeedPeriodicity(5, TimeUnit.minutes); bundles[0].setOutputFeedLocationData(feedOutputPath); bundles[0].setProcessConcurrency(6); bundles[0].submitFeedsScheduleProcess(prism); TimeUtil.sleepSeconds(TIMEOUT); InstancesResult r = prism .getProcessHelper() .getProcessInstanceKill( Util.readEntityName(bundles[0].getProcessData()), "?start=2010-01-02T00:03Z&end=2010-01-02T00:30Z"); InstanceUtil.validateResponse(r, 3, 0, 0, 0, 3); LOGGER.info(r.toString()); }