-
Notifications
You must be signed in to change notification settings - Fork 29
Some Fixes. #77
Some Fixes. #77
Conversation
@Override | ||
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { | ||
//Check: https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers | ||
//TODO: Handle the request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: Comment matches to-do format 'TODO:'.
|
||
//2) Converter to time series | ||
MetricTimeSeries ts = new MetricTimeSeries.Builder("cpu_load_short") | ||
.attribute("host","server02") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: ',' is not followed by whitespace.
//2) Converter to time series | ||
MetricTimeSeries ts = new MetricTimeSeries.Builder("cpu_load_short") | ||
.attribute("host","server02") | ||
.attribute("region","us-west") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: ',' is not followed by whitespace.
@@ -213,12 +212,12 @@ private static boolean hasTransformationsOrAggregations(FunctionValueMap functio | |||
* @throws ParseException if bad things happen | |||
* @throws IOException if bad things happen | |||
*/ | |||
private void applyAnalyses(SolrQueryRequest req, Iterable<ChronixAnalysis<MetricTimeSeries>> analyses, Function<SolrDocument, String> key, long queryStart, long queryEnd, Map.Entry<String, List<SolrDocument>> docs, MetricTimeSeries timeSeries, FunctionValueMap analysisAndValues) throws ParseException, IOException { | |||
private void applyAnalyses(SolrQueryRequest req, Iterable<ChronixAnalysis> analyses, JoinFunction key, long queryStart, long queryEnd, Map.Entry<String, List<SolrDocument>> docs, MetricTimeSeries timeSeries, FunctionValueMap analysisAndValues) throws ParseException, IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: More than 7 parameters (found 8).
} else { | ||
LOGGER.info("{} is unknown. {} is ignored", type, type); | ||
} | ||
} | ||
|
||
private static void addAggregation(QueryFunctions<MetricTimeSeries> result, FunctionType type, String[] arguments) { | ||
private static void addStrace(QueryFunctions result, FunctionType type, String[] arguments) { | ||
switch (type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: switch without "default" clause.
} | ||
|
||
private static void addLsof(QueryFunctions result, FunctionType type, String[] arguments) { | ||
switch (type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: switch without "default" clause.
@@ -203,7 +227,7 @@ private static void addAnalysis(QueryFunctions<MetricTimeSeries> result, Functio | |||
} | |||
} | |||
|
|||
private static void addTransformation(QueryFunctions<MetricTimeSeries> result, FunctionType type, String[] arguments) { | |||
private static void addTransformation(QueryFunctions result, FunctionType type, String[] arguments) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: NCSS for this method is 51 (max allowed is 50).
//Performance optimization. Avoiding fine grained growing. | ||
if (timestamps == null) { | ||
int size = ts.size(); | ||
if (size < 1000) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: Nested if-else depth is 2 (max allowed is 1).
//Performance optimization. Avoiding fine grained growing. | ||
if (timestamps == null) { | ||
int size = ts.size(); | ||
if (size < 1000) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: Nested if-else depth is 2 (max allowed is 1).
|
||
static { | ||
Collections.addAll(AGGREGATIONS, AVG, MIN, MAX, DEV, P, SUM, COUNT, FIRST, LAST, RANGE, DIFF, SDIFF); | ||
Collections.addAll(AGGREGATIONS, AVG, MIN, MAX, DEV, P, SUM, COUNT, FIRST, LAST, RANGE, DIFF, SDIFF,INTEGRAL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: ',' is not followed by whitespace.
|
||
//If it is empty, we return NaN | ||
if (timeSeries.size() <= 0) { | ||
return Double.NaN; | ||
functionValueMap.add(this,Double.NaN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: ',' is not followed by whitespace.
//If it is empty, we return NaN | ||
if (timeSeries.size() <= 0) { | ||
return Double.NaN; | ||
functionValueMap.add(this,Double.NaN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: ',' is not followed by whitespace.
@@ -55,8 +49,8 @@ public double execute(MetricTimeSeries... args) { | |||
double firstValue = timeSeries.getValue(0); | |||
double lastValue = timeSeries.getValue(timeSeries.size() - 1); | |||
|
|||
//return the difference | |||
return Math.abs(firstValue - lastValue); | |||
functionValueMap.add(this,Math.abs(firstValue - lastValue)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] ERROR: ',' is not followed by whitespace.
No description provided.