Skip to content

Commit

Permalink
Merge pull request #18 from impetus-opensource/JUM-31
Browse files Browse the repository at this point in the history
JUM-31: Jumbune CLI not functioning properly
  • Loading branch information
MishraMayank committed Sep 15, 2014
2 parents 7aa0959 + fc6d2c2 commit 8019c13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Expand Up @@ -260,7 +260,7 @@ public static String parseConfiguration(String destinationRelativePathOnLocal, S
* @param hadoopConfigurationFile which we wants to receive the path of.
* @return the string
*/
private static String copyAndGetHadoopConfigurationFilePath(YamlLoader loader, String hadoopConfigurationFile) {
public static String copyAndGetHadoopConfigurationFilePath(YamlLoader loader, String hadoopConfigurationFile) {

String jumbuneHome = YamlLoader.getjHome();
String dirInJumbuneHome = jumbuneHome + File.separator + Constants.JOB_JARS_LOC + loader.getJumbuneJobName();
Expand Down
Expand Up @@ -46,7 +46,8 @@ public class ShellExecutorService extends CoreExecutorService {

private static final Logger LOGGER = LogManager.getLogger(ShellExecutorService.class);
private static final MessageLoader MESSAGES = MessageLoader.getInstance();

/** The Constant FORWARD_SLASH. */
private final String FORWARD_SLASH = "/";
/**
* public constructor
* @throws JumbuneException
Expand Down Expand Up @@ -147,6 +148,7 @@ private YamlLoader run(InputStream is, ReportsBean reports) throws JumbuneExcept
* (validatedData.get(Constants.FAILURE_KEY) != null && !validatedData.get(Constants.FAILURE_KEY).isEmpty()) {
* ConsoleLogUtil.CONSOLELOGGER.debug(validatedData); throw new HTFException(ErrorCodesAndMessages.INVALID_YAML); }
*/
RemotingUtil.copyAndGetHadoopConfigurationFilePath(loader, "core-site.xml");
loadInitialSetup(yamlConfig);
disableModules(loader);
loader.createJumbuneDirectories();
Expand All @@ -172,7 +174,7 @@ private YamlLoader run(InputStream is, ReportsBean reports) throws JumbuneExcept

private void startExecution(ReportsBean reports, YamlLoader loader) throws IOException, JumbuneException {
String reportFolderPath = new StringBuilder().append(loader.getShellUserReportLocation()).append(Constants.DIR_SEPARATOR)
.append(loader.getYamlConfiguration().getJumbuneJobName()).append(Constants.JUMBUNE_REPORT_EXTENTION).toString();
.append(loader.getYamlConfiguration().getJumbuneJobName().split(FORWARD_SLASH)[0]).append(Constants.JUMBUNE_REPORT_EXTENTION).toString();
List<Processor> processors = getProcessorChain(loader.getYamlConfiguration(), CONSOLE_BASED);
ServiceInfo serviceInfo = new ServiceInfo();
serviceInfo.setRootDirectory(loader.getRootDirectoryName());
Expand Down
Expand Up @@ -283,7 +283,15 @@ private String executeCommand(String[] commands, String jarLocation, String dirL
throw new IllegalArgumentException("No job jar found at " + jobJarAbsolutePath);
}
if(!commands[2].contains(RemotingConstants.DATA_VALIDATION_JAR)){
commands[2] = jobJarAbsolutePath + "/" + fileLoc.list()[0];
String[] fileList = fileLoc.list();
String jarName = null;
for (String filename : fileList) {
if(filename.contains(".jar")){
jarName = filename;
break;
}
}
commands[2] = jobJarAbsolutePath + "/" + jarName;
}
ProcessBuilder pb = new ProcessBuilder(commands);
File loc = new File(agentHome + dirLocation);
Expand Down

0 comments on commit 8019c13

Please sign in to comment.