ATEST-81:
- remove not needed enum in BinningStrategyEnum - rename enum in Ordering
This commit is contained in:
@@ -3,8 +3,6 @@ package ch.psi.daq.rest;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import ch.psi.daq.cassandra.writer.CassandraWriter;
|
||||
import ch.psi.daq.cassandra.writer.CassandraWriterImpl;
|
||||
import ch.psi.daq.common.statistic.StorelessStatistics;
|
||||
import ch.psi.daq.domain.cassandra.ChannelEvent;
|
||||
import ch.psi.daq.hazelcast.query.processor.QueryProcessor;
|
||||
@@ -24,11 +22,6 @@ public class DaqRestConfiguration {
|
||||
return new CassandraQueryProcessorLocal();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CassandraWriter cassandraWriter() {
|
||||
return new CassandraWriterImpl();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public JsonFactory jsonFactory() {
|
||||
return new JsonFactory();
|
||||
|
||||
@@ -75,7 +75,7 @@ public abstract class AbstractQuery implements Query {
|
||||
@JsonProperty(value = "channels") List<String> channels,
|
||||
@JsonProperty(value = "fields") LinkedHashSet<String> fields,
|
||||
@JsonProperty(value = "binningStrategy") BinningStrategyEnum binningStrategyEnum,
|
||||
@JsonProperty(value = "binDuration") long binDurationOrBinCount,
|
||||
@JsonProperty(value = "binDuration") long lengthOrCount,
|
||||
@JsonProperty(value = "aggregateChannels") boolean aggregateChannels,
|
||||
@JsonProperty(value = "aggregationType") AggregationType aggregationType,
|
||||
@JsonProperty(value = "aggregations") List<Aggregation> aggregations,
|
||||
@@ -98,19 +98,18 @@ public abstract class AbstractQuery implements Query {
|
||||
|
||||
if (binningStrategyEnum != null) {
|
||||
switch (binningStrategyEnum) {
|
||||
case bincount:
|
||||
this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), (int) binDurationOrBinCount);
|
||||
case count:
|
||||
this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), (int) lengthOrCount);
|
||||
break;
|
||||
case lengthpulse:
|
||||
case lengthtime:
|
||||
this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), binDurationOrBinCount);
|
||||
case length:
|
||||
this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), lengthOrCount);
|
||||
break;
|
||||
default:
|
||||
logger.warn("No binning strategy has been set. Selecting BinningStrategyBinCount.");
|
||||
this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), (int) binDurationOrBinCount);
|
||||
this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), (int) lengthOrCount);
|
||||
}
|
||||
} else {
|
||||
this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), (int) binDurationOrBinCount);
|
||||
this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), (int) lengthOrCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,5 +9,8 @@ import ch.psi.daq.hazelcast.query.bin.BinningStrategy;
|
||||
*
|
||||
*/
|
||||
public enum BinningStrategyEnum {
|
||||
lengthpulse, lengthtime, bincount
|
||||
|
||||
length,
|
||||
|
||||
count
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user