@Override public void execute() throws MojoExecutionException, MojoFailureException { if (skipTests) { getLog().info("Hadoop Unit's stop goal is skipped"); } else { HadoopBootstrapRemoteUtils utils = new HadoopBootstrapRemoteUtils(project, session, pluginManager); hadoopUnitPath = utils.getHadoopUnitPath(hadoopUnitPath, getLog()); getLog().info("is going to stop hadoop unit with executable " + ((exec == null) ? "./hadoop-unit-standalone" : exec)); utils.operateRemoteHadoopUnit(hadoopUnitPath, outputFile, "stop", exec); Path hadoopLogFilePath = Paths.get(hadoopUnitPath, "wrapper.log"); getLog().info("is going tail log file"); utils.tailLogFileUntilFind(hadoopLogFilePath, "<-- Wrapper Stopped", getLog()); getLog().info("hadoop unit stopped"); } }
@Override public void execute() throws MojoExecutionException, MojoFailureException { if (skipTests) { getLog().info("Hadoop Unit's start goal is skipped"); } else { HadoopBootstrapRemoteUtils utils = new HadoopBootstrapRemoteUtils(project, session, pluginManager); hadoopUnitPath = utils.getHadoopUnitPath(hadoopUnitPath, getLog()); //change hadoop.properties getLog().info("is going to modifying hadoop.properties"); editHadoopUnitConfFile(); getLog().info("modifying hadoop.properties done"); //clean log file Path hadoopLogFilePath = Paths.get(hadoopUnitPath, "wrapper.log"); deleteLogFile(hadoopLogFilePath); getLog().info("is going to start hadoop unit with executable " + ((exec == null) ? "./hadoop-unit-standalone" : exec)); utils.operateRemoteHadoopUnit(hadoopUnitPath, outputFile, "start", exec); //listen to log file and wait getLog().info("is going tail log file"); utils.tailLogFileUntilFind(hadoopLogFilePath, "/_/ /_/ \\__,_/ \\__,_/ \\____/\\____/_ .___/ \\____/ /_/ /_//_/ \\__/", getLog()); getLog().info("hadoop unit started"); } }