Skip to content
Snippets Groups Projects
Commit 37ceeadb authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

pmg thingies and removed UseConcurrentHashMap rule

parent b56e33f9
No related branches found
No related tags found
No related merge requests found
Showing
with 30 additions and 26 deletions
......@@ -31,11 +31,11 @@ public class TaskFarmAnalysisException extends RuntimeException {
* gets thrown if the analysis component was unable to find the chosen
* throughput algorithm.
*
* @param s
* @param message
* error message
*/
public TaskFarmAnalysisException(final String s) {
super(s);
public TaskFarmAnalysisException(final String message, final Throwable cause) {
super(message, cause);
}
}
......@@ -31,11 +31,11 @@ public class TaskFarmControllerException extends RuntimeException {
* gets thrown if the reconfiguration component is not able to add or remove a
* worker stage.
*
* @param s
* @param message
* error message
*/
public TaskFarmControllerException(final String s, final Throwable cause) {
super(s, cause);
public TaskFarmControllerException(final String message, final Throwable cause) {
super(message, cause);
}
}
......@@ -31,11 +31,11 @@ public class TaskFarmInvalidPipeException extends RuntimeException {
* gets thrown if the user tries to monitor a pipe which
* does not implement {@link teetime.framework.pipe.IMonitorablePipe IMonitorablePipe}.
*
* @param s
* @param message
* error message
*/
public TaskFarmInvalidPipeException(final String s, final Throwable cause) {
super(s, cause);
public TaskFarmInvalidPipeException(final String message, final Throwable cause) {
super(message, cause);
}
}
......@@ -100,8 +100,7 @@ public class PipeMonitoringService implements IMonitoringService<IMonitorablePip
pushThroughput,
pullThroughput,
pipe.getNumWaits(),
i
);
i);
container.addMonitoringData(monitoringData);
}
......
......
......@@ -44,7 +44,7 @@ public class SingleTaskFarmMonitoringService implements IMonitoringService<TaskF
private final TaskFarmHistoryService<?, ?, ?> history;
/** maximum number of worker stages used by the task farm over its whole execution **/
private int maxNumberOfStages = 0;
private int maxNumberOfStages;
/**
* Constructor.
......@@ -102,6 +102,7 @@ public class SingleTaskFarmMonitoringService implements IMonitoringService<TaskF
PUSH, PULL
}
@SuppressWarnings("PMD.DataflowAnomalyAnalysis")
private double getMeanAndSumThroughput(final TaskFarmStage<?, ?, ?> taskFarmStage, final MeanThroughputType type, final boolean mean) {
double sum = 0;
double count = 0;
......@@ -143,11 +144,9 @@ public class SingleTaskFarmMonitoringService implements IMonitoringService<TaskF
}
// calculate the mean value if necessary
if (mean) {
if (count > 0) {
if (mean && count > 0) {
sum /= count;
}
}
return sum;
}
......
......
......@@ -41,6 +41,7 @@ public class StackedTimePullThroughput2D extends AbstractStackedCSVExporter {
super(pipeMonitoringService, taskFarmMonitoringService);
}
@SuppressWarnings("PMD.DataflowAnomalyAnalysis") // PMD does not recognize arrays correctly
@Override
protected void addLineOfValuesToCSV(final Writer writer, final int maxNumberOfPipes, final PipeMonitoringDataContainer container)
throws IOException {
......@@ -60,6 +61,7 @@ public class StackedTimePullThroughput2D extends AbstractStackedCSVExporter {
addCSVLineToWriter(writer, entryStrings);
}
@SuppressWarnings("PMD.DataflowAnomalyAnalysis") // PMD does not recognize arrays correctly
@Override
protected void createHeader(final Writer writer, final int maxNumberOfStages) throws IOException {
String[] headerStrings = new String[maxNumberOfStages + 1];
......
......
......@@ -41,6 +41,7 @@ public class StackedTimePushThroughput2D extends AbstractStackedCSVExporter {
super(pipeMonitoringService, taskFarmMonitoringService);
}
@SuppressWarnings("PMD.DataflowAnomalyAnalysis") // PMD does not recognize arrays correctly
@Override
protected void addLineOfValuesToCSV(final Writer writer, final int maxNumberOfPipes, final PipeMonitoringDataContainer container)
throws IOException {
......@@ -60,6 +61,7 @@ public class StackedTimePushThroughput2D extends AbstractStackedCSVExporter {
addCSVLineToWriter(writer, entryStrings);
}
@SuppressWarnings("PMD.DataflowAnomalyAnalysis") // PMD does not recognize arrays correctly
@Override
protected void createHeader(final Writer writer, final int maxNumberOfStages) throws IOException {
String[] headerStrings = new String[maxNumberOfStages + 1];
......
......
......@@ -42,6 +42,7 @@ public class StackedTimeSizeWithCapacity2D extends AbstractStackedCSVExporter {
super(pipeMonitoringService, taskFarmMonitoringService);
}
@SuppressWarnings("PMD.DataflowAnomalyAnalysis") // PMD does not recognize arrays correctly
@Override
protected void addLineOfValuesToCSV(final Writer writer, final int maxNumberOfPipes, final PipeMonitoringDataContainer container)
throws IOException {
......@@ -62,6 +63,7 @@ public class StackedTimeSizeWithCapacity2D extends AbstractStackedCSVExporter {
addCSVLineToWriter(writer, entryStrings);
}
@SuppressWarnings("PMD.DataflowAnomalyAnalysis") // PMD does not recognize arrays correctly
@Override
protected void createHeader(final Writer writer, final int maxNumberOfPipes) throws IOException {
String[] headerStrings = new String[maxNumberOfPipes + 2];
......
......
......@@ -48,7 +48,7 @@ public class TimeBoundary2D extends AbstractGeneralCSVExporter {
try {
addCSVLineToWriter(writer, "time", "boundary");
if (monitoredDataValues.size() > 0) {
if (!monitoredDataValues.isEmpty()) {
// just add last time-boundary pair so that it will record the duration of the monitoring
TaskFarmMonitoringData taskFarmMonitoringData = monitoredDataValues.get(monitoredDataValues.size() - 1);
addCSVLineToWriter(writer,
......@@ -56,7 +56,7 @@ public class TimeBoundary2D extends AbstractGeneralCSVExporter {
Double.toString(taskFarmMonitoringData.getThroughputBoundary()));
}
} catch (IOException e) {
throw new IllegalArgumentException("The writer could not be written to: " + e.getMessage());
throw new IllegalArgumentException("The writer could not be written to: " + e.getMessage(), e);
}
}
......
......
......@@ -55,7 +55,7 @@ public class TimeBoundaryMSPullThroughput3D extends AbstractGeneralCSVExporter {
Double.toString(taskFarmMonitoringData.getSumOfPullThroughput()));
}
} catch (IOException e) {
throw new IllegalArgumentException("The writer could not be written to: " + e.getMessage());
throw new IllegalArgumentException("The writer could not be written to: " + e.getMessage(), e);
}
}
}
......@@ -55,7 +55,7 @@ public class TimeBoundaryMSPushThroughput3D extends AbstractGeneralCSVExporter {
Double.toString(taskFarmMonitoringData.getSumOfPushThroughput()));
}
} catch (IOException e) {
throw new IllegalArgumentException("The writer could not be written to: " + e.getMessage());
throw new IllegalArgumentException("The writer could not be written to: " + e.getMessage(), e);
}
}
}
......@@ -54,7 +54,7 @@ public class TimeBoundaryStages3D extends AbstractGeneralCSVExporter {
Integer.toString(taskFarmMonitoringData.getStages()));
}
} catch (IOException e) {
throw new IllegalArgumentException("The writer could not be written to: " + e.getMessage());
throw new IllegalArgumentException("The writer could not be written to: " + e.getMessage(), e);
}
}
}
......@@ -20,12 +20,12 @@ import java.io.File;
/**
* @author Christian Wulf
*/
public final class TextLine {
public final class TextLineContainer {
private final File textFile;
private final String textLine;
public TextLine(final File textFile, final String textLine) {
public TextLineContainer(final File textFile, final String textLine) {
this.textFile = textFile;
this.textLine = textLine;
}
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment