- rename hazelcast.common
This commit is contained in:
@ -32,7 +32,7 @@ applicationDefaultJvmArgs = [
|
||||
|
||||
dependencies {
|
||||
compile (project(':ch.psi.daq.cassandra'))
|
||||
compile (project(':ch.psi.daq.hazelcast.common'))
|
||||
compile (project(':ch.psi.daq.hazelcast'))
|
||||
compile 'org.springframework.boot:spring-boot-starter-web:1.2.4.RELEASE'
|
||||
compile 'com.google.code.gson:gson:2+'
|
||||
compile 'org.apache.commons:commons-lang3:3.4'
|
||||
|
@ -9,8 +9,8 @@ import org.springframework.util.Assert;
|
||||
|
||||
import ch.psi.daq.cassandra.reader.Ordering;
|
||||
import ch.psi.daq.hazelcast.common.query.Aggregation;
|
||||
import ch.psi.daq.hazelcast.common.query.AggregationType;
|
||||
import ch.psi.daq.hazelcast.common.query.Query;
|
||||
import ch.psi.daq.hazelcast.common.query.ValueAggregation;
|
||||
import ch.psi.daq.hazelcast.common.query.bin.BinIntervalCalculator;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
@ -41,7 +41,7 @@ public abstract class AbstractQuery implements Query {
|
||||
|
||||
private List<Aggregation> aggregations;
|
||||
|
||||
private ValueAggregation valueAggregation;
|
||||
private AggregationType aggregationType;
|
||||
|
||||
private boolean aggregateChannels;
|
||||
|
||||
@ -62,12 +62,12 @@ public abstract class AbstractQuery implements Query {
|
||||
@JsonProperty(value = "channels") List<String> channelIds,
|
||||
@JsonProperty(value = "fields") LinkedHashSet<String> fields,
|
||||
@JsonProperty(value = "aggregateChannels") boolean aggregateChannels,
|
||||
@JsonProperty(value = "aggregationType") ValueAggregation valueAggregation,
|
||||
@JsonProperty(value = "aggregationType") AggregationType aggregationType,
|
||||
@JsonProperty(value = "aggregations") List<Aggregation> aggregations) {
|
||||
|
||||
this.ordering = ordering;
|
||||
this.aggregateChannels = aggregateChannels;
|
||||
this.valueAggregation = valueAggregation;
|
||||
this.aggregationType = aggregationType;
|
||||
|
||||
if (channelIds == null || fields == null) {
|
||||
throw new IllegalArgumentException("sourceIds and/or fields cannot be null.");
|
||||
@ -100,21 +100,13 @@ public abstract class AbstractQuery implements Query {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ValueAggregation getValueAggregation() {
|
||||
return valueAggregation;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean aggregateChannels() {
|
||||
return isAggregateChannels();
|
||||
public AggregationType getAggregationType() {
|
||||
return aggregationType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BinIntervalCalculator getBinIntervalCalculator() {
|
||||
// TODO Auto-generated method stub
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,8 @@ import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
import ch.psi.daq.cassandra.reader.Ordering;
|
||||
import ch.psi.daq.hazelcast.common.query.Aggregation;
|
||||
import ch.psi.daq.hazelcast.common.query.ValueAggregation;
|
||||
import ch.psi.daq.hazelcast.common.query.AggregationType;
|
||||
import ch.psi.daq.hazelcast.common.query.range.QueryRange;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@ -28,13 +29,13 @@ public class PulseRangeQuery extends AbstractQuery {
|
||||
@JsonProperty(value = "channels") List<String> channels,
|
||||
@JsonProperty(value = "fields") LinkedHashSet<String> fields,
|
||||
@JsonProperty(value = "aggregateChannels") boolean aggregateChannels,
|
||||
@JsonProperty(value = "aggregationType") ValueAggregation valueAggregation,
|
||||
@JsonProperty(value = "aggregationType") AggregationType aggregationType,
|
||||
@JsonProperty(value = "aggregations") List<Aggregation> aggregations,
|
||||
@JsonProperty(value = "startPulseId") long startPulseId,
|
||||
@JsonProperty(value = "endPulseId") long endPulseId)
|
||||
{
|
||||
|
||||
super(ordering, channels, fields, aggregateChannels, valueAggregation, aggregations);
|
||||
super(ordering, channels, fields, aggregateChannels, aggregationType, aggregations);
|
||||
|
||||
this.startPulseId = startPulseId;
|
||||
this.endPulseId = endPulseId;
|
||||
@ -64,4 +65,10 @@ public class PulseRangeQuery extends AbstractQuery {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryRange getQueryRange() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,8 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import ch.psi.daq.cassandra.reader.Ordering;
|
||||
import ch.psi.daq.hazelcast.common.query.Aggregation;
|
||||
import ch.psi.daq.hazelcast.common.query.ValueAggregation;
|
||||
import ch.psi.daq.hazelcast.common.query.AggregationType;
|
||||
import ch.psi.daq.hazelcast.common.query.range.QueryRange;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@ -56,7 +57,7 @@ public class TimeRangeQuery extends AbstractQuery {
|
||||
@JsonProperty(value = "channels") List<String> channels,
|
||||
@JsonProperty(value = "fields") LinkedHashSet<String> fields,
|
||||
@JsonProperty(value = "aggregateChannels") boolean aggregateChannels,
|
||||
@JsonProperty(value = "aggregationType") ValueAggregation valueAggregation,
|
||||
@JsonProperty(value = "aggregationType") AggregationType aggregationType,
|
||||
@JsonProperty(value = "aggregations") List<Aggregation> aggregations,
|
||||
@JsonProperty(value = "start") long startMillis,
|
||||
@JsonProperty(value = "startNanoOffset") long startNanoOffset,
|
||||
@ -65,7 +66,7 @@ public class TimeRangeQuery extends AbstractQuery {
|
||||
@JsonProperty(value = "endNanoOffset") long endNanoOffset,
|
||||
@JsonProperty(value = "endDateTime") String endDateTime) {
|
||||
|
||||
super(ordering, channels, fields, aggregateChannels, valueAggregation, aggregations);
|
||||
super(ordering, channels, fields, aggregateChannels, aggregationType, aggregations);
|
||||
|
||||
this.start = startMillis;
|
||||
this.startNanoOffset = startNanoOffset;
|
||||
@ -129,5 +130,11 @@ public class TimeRangeQuery extends AbstractQuery {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryRange getQueryRange() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
|
||||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
|
||||
|
||||
import ch.psi.daq.cassandra.reader.Ordering;
|
||||
import ch.psi.daq.hazelcast.common.query.ValueAggregation;
|
||||
import ch.psi.daq.hazelcast.common.query.AggregationType;
|
||||
import ch.psi.daq.rest.queries.PulseRangeQuery;
|
||||
import ch.psi.daq.rest.queries.TimeRangeQuery;
|
||||
import ch.psi.daq.test.rest.AbstractDaqRestTest;
|
||||
@ -33,7 +33,7 @@ public class DaqControllerTest extends AbstractDaqRestTest {
|
||||
Lists.newArrayList(), // DummyQueryProcessor simply returns a fixed list
|
||||
Sets.newLinkedHashSet(DEFAULT_PROPERTIES),
|
||||
false,
|
||||
ValueAggregation.index,
|
||||
AggregationType.index,
|
||||
null,
|
||||
100l,
|
||||
101l
|
||||
@ -64,15 +64,14 @@ public class DaqControllerTest extends AbstractDaqRestTest {
|
||||
Lists.newArrayList(), // DummyQueryProcessor simply returns a fixed list
|
||||
Sets.newLinkedHashSet(DEFAULT_PROPERTIES),
|
||||
false,
|
||||
ValueAggregation.index,
|
||||
AggregationType.index,
|
||||
null, // aggregations
|
||||
startTime, // startMillis
|
||||
0,
|
||||
null,
|
||||
endTime,
|
||||
0,
|
||||
null
|
||||
);
|
||||
null);
|
||||
|
||||
String content = mapper.writeValueAsString(request);
|
||||
System.out.println(content);
|
||||
|
Reference in New Issue
Block a user