mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
Merge pull request #894 from nosqlbench/jeffb/code-scans-high
NB5 address high priority code scans
This commit is contained in:
commit
89c3bb4537
@ -22,8 +22,8 @@ import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.CycleResult
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.ResultReadable;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.inputs.cyclelog.CanFilterResultValue;
|
||||
import io.nosqlbench.engine.api.activityapi.output.Output;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
@ -35,13 +35,13 @@ import java.util.function.Predicate;
|
||||
*/
|
||||
public class ReorderingConcurrentResultBuffer implements Output, CanFilterResultValue {
|
||||
|
||||
private final static Logger logger = LogManager.getLogger(ReorderingConcurrentResultBuffer.class);
|
||||
private static final Logger logger = LogManager.getLogger(ReorderingConcurrentResultBuffer.class);
|
||||
|
||||
private final LinkedList<CycleResultsSegment> segments = new LinkedList<>();
|
||||
private final Output downstream;
|
||||
private final int threshold;
|
||||
private int currentCount;
|
||||
private int segmentCount;
|
||||
private long currentCount;
|
||||
private long segmentCount;
|
||||
private Predicate<ResultReadable> resultFilter;
|
||||
|
||||
public ReorderingConcurrentResultBuffer(Output downstream) {
|
||||
|
@ -130,7 +130,7 @@ public class Unit {
|
||||
Matcher m = numberFmtPattern.matcher(spec);
|
||||
if (m.matches()) {
|
||||
String numberpart = m.group("number");
|
||||
long base = Long.valueOf(numberpart);
|
||||
double base = Double.parseDouble(numberpart);
|
||||
String unitpart = m.group("unit");
|
||||
if (unitpart != null) {
|
||||
Count specifierUnit = Count.valueOfSuffix(unitpart);
|
||||
@ -142,7 +142,7 @@ public class Unit {
|
||||
double multiplier = (specifierScale / resultScale);
|
||||
base *= multiplier;
|
||||
}
|
||||
return Optional.of(base);
|
||||
return Optional.of((long) base);
|
||||
} else {
|
||||
logger.error("Parsing error for specifier:'" + spec + "'");
|
||||
return Optional.empty();
|
||||
|
Loading…
Reference in New Issue
Block a user