Commit be2e9c0e authored by Costin Grigoras's avatar Costin Grigoras
Browse files

Another bunch of changes

parent 66cc3714
......@@ -264,14 +264,16 @@ public class JBoxServer extends Thread {
final NodeList optionsNodeList = document.getElementsByTagName("o");
for (int i = 0; i < optionsNodeList.getLength(); i++) {
final int nodeCount = optionsNodeList.getLength();
for (int i = 0; i < nodeCount; i++) {
final Node optionNode = optionsNodeList.item(i);
cmdOptions.add(optionNode.getTextContent());
fullCmd.add(optionNode.getTextContent());
logger.info("Command options = " + optionNode.getTextContent());
}
if (sCmdValue != null && "password".equals(sCmdValue)) {
if ("password".equals(sCmdValue)) {
if (cmdOptions.get(0).equals(password)) {
os.write(passACK.getBytes());
......
......@@ -76,36 +76,36 @@ public class JAliEnCommandlistSEs extends JAliEnBaseCommand {
long summaryFileCount = 0;
for (final SE se : filteredSEs) {
String qos = "";
final StringBuilder qos = new StringBuilder();
int len = 0;
for (final String q : se.qos) {
if (qos.length() > 0) {
len += 2;
qos += ", ";
qos.append(", ");
}
len += q.length();
switch (q) {
case "disk":
qos += ShellColor.jobStateGreen() + q + ShellColor.reset();
qos.append(ShellColor.jobStateGreen() + q + ShellColor.reset());
break;
case "tape":
qos += ShellColor.jobStateBlue() + q + ShellColor.reset();
qos.append(ShellColor.jobStateBlue() + q + ShellColor.reset());
break;
case "legooutput":
case "legoinput":
qos += ShellColor.jobStateYellow() + q + ShellColor.reset();
qos.append(ShellColor.jobStateYellow() + q + ShellColor.reset());
break;
default:
qos += ShellColor.jobStateRed() + q + ShellColor.reset();
qos.append(ShellColor.jobStateRed() + q + ShellColor.reset());
}
}
for (; len < maxQosLength; len++)
qos += " ";
qos.append(' ');
final long totalSpace = se.size * 1024;
final long usedSpace = se.seUsedSpace;
......@@ -120,7 +120,7 @@ public class JAliEnCommandlistSEs extends JAliEnBaseCommand {
+ "\t" + padLeft(Format.size(usedSpace), 8) + "\t" + padLeft(Format.size(freeSpace), 8)
+ String.format("%16d", Long.valueOf(se.seNumFiles))
+ "\t" + String.format("% .4f", Double.valueOf(se.demoteRead)) + " "
+ String.format("% .4f", Double.valueOf(se.demoteWrite)) + "\t" + qos + "\t " + se.generateProtocol());
+ String.format("% .4f", Double.valueOf(se.demoteWrite)) + "\t" + qos.toString() + "\t " + se.generateProtocol());
commander.printOut("seName", se.originalName);
commander.printOut("seNumber", String.valueOf(se.seNumber));
......
......@@ -33,6 +33,8 @@ public class HTCONDOR extends BatchQueue {
private boolean use_job_router = false;
private boolean use_external_cloud = false;
private static final Pattern p = Pattern.compile("(\\d+)\\s*\\*\\s*(\\S+)");
//
// 2020-06-24 - Maarten Litmaath, Maxim Storetvedt
//
......@@ -129,7 +131,6 @@ public class HTCONDOR extends BatchQueue {
for (final String str : val.split(",")) {
double w = 1;
String ce = str;
final Pattern p = Pattern.compile("(\\d+)\\s*\\*\\s*(\\S+)");
final Matcher m = p.matcher(str);
if (m.find()) {
......@@ -441,7 +442,6 @@ public class HTCONDOR extends BatchQueue {
try (PrintWriter out = new PrintWriter(submit_file)) {
out.println(submit_jdl);
out.close();
}
catch (final Exception e) {
logger.severe("Error writing to submit file: " + submit_file);
......@@ -459,7 +459,7 @@ public class HTCONDOR extends BatchQueue {
}
private String readJdlFile(final String path) {
String file_contents = "";
final StringBuilder file_contents = new StringBuilder();
String line;
try (BufferedReader br = new BufferedReader(new FileReader(path))) {
......@@ -476,7 +476,7 @@ public class HTCONDOR extends BatchQueue {
// remove erroneous spaces
line = line.replaceAll(err_spaces_pattern.pattern(), "\\\\\n");
file_contents += line + "\n";
file_contents.append(line).append('\n');
}
}
catch (final Exception e) {
......@@ -485,7 +485,7 @@ public class HTCONDOR extends BatchQueue {
return "";
}
return file_contents;
return file_contents.toString();
}
private boolean getJobNumbers() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment