- rename hazelcast.common

This commit is contained in:
Zellweger Christof Ralf
2015-06-22 11:58:41 +02:00
parent d41e1a03bf
commit 4f6ceccd68
5 changed files with 32 additions and 27 deletions

View File

@ -32,7 +32,7 @@ applicationDefaultJvmArgs = [
dependencies { dependencies {
compile (project(':ch.psi.daq.cassandra')) 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 'org.springframework.boot:spring-boot-starter-web:1.2.4.RELEASE'
compile 'com.google.code.gson:gson:2+' compile 'com.google.code.gson:gson:2+'
compile 'org.apache.commons:commons-lang3:3.4' compile 'org.apache.commons:commons-lang3:3.4'

View File

@ -9,8 +9,8 @@ import org.springframework.util.Assert;
import ch.psi.daq.cassandra.reader.Ordering; import ch.psi.daq.cassandra.reader.Ordering;
import ch.psi.daq.hazelcast.common.query.Aggregation; 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.Query;
import ch.psi.daq.hazelcast.common.query.ValueAggregation;
import ch.psi.daq.hazelcast.common.query.bin.BinIntervalCalculator; import ch.psi.daq.hazelcast.common.query.bin.BinIntervalCalculator;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
@ -41,7 +41,7 @@ public abstract class AbstractQuery implements Query {
private List<Aggregation> aggregations; private List<Aggregation> aggregations;
private ValueAggregation valueAggregation; private AggregationType aggregationType;
private boolean aggregateChannels; private boolean aggregateChannels;
@ -62,12 +62,12 @@ public abstract class AbstractQuery implements Query {
@JsonProperty(value = "channels") List<String> channelIds, @JsonProperty(value = "channels") List<String> channelIds,
@JsonProperty(value = "fields") LinkedHashSet<String> fields, @JsonProperty(value = "fields") LinkedHashSet<String> fields,
@JsonProperty(value = "aggregateChannels") boolean aggregateChannels, @JsonProperty(value = "aggregateChannels") boolean aggregateChannels,
@JsonProperty(value = "aggregationType") ValueAggregation valueAggregation, @JsonProperty(value = "aggregationType") AggregationType aggregationType,
@JsonProperty(value = "aggregations") List<Aggregation> aggregations) { @JsonProperty(value = "aggregations") List<Aggregation> aggregations) {
this.ordering = ordering; this.ordering = ordering;
this.aggregateChannels = aggregateChannels; this.aggregateChannels = aggregateChannels;
this.valueAggregation = valueAggregation; this.aggregationType = aggregationType;
if (channelIds == null || fields == null) { if (channelIds == null || fields == null) {
throw new IllegalArgumentException("sourceIds and/or fields cannot be null."); throw new IllegalArgumentException("sourceIds and/or fields cannot be null.");
@ -100,21 +100,13 @@ public abstract class AbstractQuery implements Query {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public ValueAggregation getValueAggregation() { public AggregationType getAggregationType() {
return valueAggregation; return aggregationType;
}
/**
* {@inheritDoc}
*/
@Override
public boolean aggregateChannels() {
return isAggregateChannels();
} }
@Override @Override
public BinIntervalCalculator getBinIntervalCalculator() { public BinIntervalCalculator getBinIntervalCalculator() {
// TODO Auto-generated method stub // TODO
return null; return null;
} }

View File

@ -7,7 +7,8 @@ import org.apache.commons.lang.builder.ToStringBuilder;
import ch.psi.daq.cassandra.reader.Ordering; import ch.psi.daq.cassandra.reader.Ordering;
import ch.psi.daq.hazelcast.common.query.Aggregation; 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.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -28,13 +29,13 @@ public class PulseRangeQuery extends AbstractQuery {
@JsonProperty(value = "channels") List<String> channels, @JsonProperty(value = "channels") List<String> channels,
@JsonProperty(value = "fields") LinkedHashSet<String> fields, @JsonProperty(value = "fields") LinkedHashSet<String> fields,
@JsonProperty(value = "aggregateChannels") boolean aggregateChannels, @JsonProperty(value = "aggregateChannels") boolean aggregateChannels,
@JsonProperty(value = "aggregationType") ValueAggregation valueAggregation, @JsonProperty(value = "aggregationType") AggregationType aggregationType,
@JsonProperty(value = "aggregations") List<Aggregation> aggregations, @JsonProperty(value = "aggregations") List<Aggregation> aggregations,
@JsonProperty(value = "startPulseId") long startPulseId, @JsonProperty(value = "startPulseId") long startPulseId,
@JsonProperty(value = "endPulseId") long endPulseId) @JsonProperty(value = "endPulseId") long endPulseId)
{ {
super(ordering, channels, fields, aggregateChannels, valueAggregation, aggregations); super(ordering, channels, fields, aggregateChannels, aggregationType, aggregations);
this.startPulseId = startPulseId; this.startPulseId = startPulseId;
this.endPulseId = endPulseId; this.endPulseId = endPulseId;
@ -64,4 +65,10 @@ public class PulseRangeQuery extends AbstractQuery {
return ToStringBuilder.reflectionToString(this); return ToStringBuilder.reflectionToString(this);
} }
@Override
public QueryRange getQueryRange() {
// TODO Auto-generated method stub
return null;
}
} }

View File

@ -14,7 +14,8 @@ import org.slf4j.LoggerFactory;
import ch.psi.daq.cassandra.reader.Ordering; import ch.psi.daq.cassandra.reader.Ordering;
import ch.psi.daq.hazelcast.common.query.Aggregation; 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.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -56,7 +57,7 @@ public class TimeRangeQuery extends AbstractQuery {
@JsonProperty(value = "channels") List<String> channels, @JsonProperty(value = "channels") List<String> channels,
@JsonProperty(value = "fields") LinkedHashSet<String> fields, @JsonProperty(value = "fields") LinkedHashSet<String> fields,
@JsonProperty(value = "aggregateChannels") boolean aggregateChannels, @JsonProperty(value = "aggregateChannels") boolean aggregateChannels,
@JsonProperty(value = "aggregationType") ValueAggregation valueAggregation, @JsonProperty(value = "aggregationType") AggregationType aggregationType,
@JsonProperty(value = "aggregations") List<Aggregation> aggregations, @JsonProperty(value = "aggregations") List<Aggregation> aggregations,
@JsonProperty(value = "start") long startMillis, @JsonProperty(value = "start") long startMillis,
@JsonProperty(value = "startNanoOffset") long startNanoOffset, @JsonProperty(value = "startNanoOffset") long startNanoOffset,
@ -65,7 +66,7 @@ public class TimeRangeQuery extends AbstractQuery {
@JsonProperty(value = "endNanoOffset") long endNanoOffset, @JsonProperty(value = "endNanoOffset") long endNanoOffset,
@JsonProperty(value = "endDateTime") String endDateTime) { @JsonProperty(value = "endDateTime") String endDateTime) {
super(ordering, channels, fields, aggregateChannels, valueAggregation, aggregations); super(ordering, channels, fields, aggregateChannels, aggregationType, aggregations);
this.start = startMillis; this.start = startMillis;
this.startNanoOffset = startNanoOffset; this.startNanoOffset = startNanoOffset;
@ -129,5 +130,11 @@ public class TimeRangeQuery extends AbstractQuery {
return ToStringBuilder.reflectionToString(this); return ToStringBuilder.reflectionToString(this);
} }
@Override
public QueryRange getQueryRange() {
// TODO Auto-generated method stub
return null;
}
} }

View File

@ -11,7 +11,7 @@ import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers; import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import ch.psi.daq.cassandra.reader.Ordering; 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.PulseRangeQuery;
import ch.psi.daq.rest.queries.TimeRangeQuery; import ch.psi.daq.rest.queries.TimeRangeQuery;
import ch.psi.daq.test.rest.AbstractDaqRestTest; import ch.psi.daq.test.rest.AbstractDaqRestTest;
@ -33,7 +33,7 @@ public class DaqControllerTest extends AbstractDaqRestTest {
Lists.newArrayList(), // DummyQueryProcessor simply returns a fixed list Lists.newArrayList(), // DummyQueryProcessor simply returns a fixed list
Sets.newLinkedHashSet(DEFAULT_PROPERTIES), Sets.newLinkedHashSet(DEFAULT_PROPERTIES),
false, false,
ValueAggregation.index, AggregationType.index,
null, null,
100l, 100l,
101l 101l
@ -64,15 +64,14 @@ public class DaqControllerTest extends AbstractDaqRestTest {
Lists.newArrayList(), // DummyQueryProcessor simply returns a fixed list Lists.newArrayList(), // DummyQueryProcessor simply returns a fixed list
Sets.newLinkedHashSet(DEFAULT_PROPERTIES), Sets.newLinkedHashSet(DEFAULT_PROPERTIES),
false, false,
ValueAggregation.index, AggregationType.index,
null, // aggregations null, // aggregations
startTime, // startMillis startTime, // startMillis
0, 0,
null, null,
endTime, endTime,
0, 0,
null null);
);
String content = mapper.writeValueAsString(request); String content = mapper.writeValueAsString(request);
System.out.println(content); System.out.println(content);