Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added default to/from binary to aggregation #1734

Merged
merged 1 commit into from Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -21,14 +21,6 @@ public abstract class BoundingBoxAggregation<P extends Persistable, T> implement
protected double maxX = -Double.MAX_VALUE;
protected double maxY = -Double.MAX_VALUE;

@Override
public byte[] toBinary() {
return new byte[0];
}

@Override
public void fromBinary(final byte[] bytes) {}

@Override
public P getParameters() {
return null;
Expand Down
Expand Up @@ -21,14 +21,6 @@ public abstract class TimeRangeAggregation<P extends Persistable, T> implements
protected long min = Long.MAX_VALUE;
protected long max = Long.MIN_VALUE;

@Override
public byte[] toBinary() {
return new byte[0];
}

@Override
public void fromBinary(final byte[] bytes) {}

@Override
public P getParameters() {
return null;
Expand Down
Expand Up @@ -93,4 +93,22 @@ default R merge(final R result1, final R result2) {
* @param entry the new entry to compute an updated aggregation result on
*/
void aggregate(T entry);

/**
* Because the serialization of aggregation is just the function without the parameters or the
* result, its expected that this is empty
*/
@Override
default byte[] toBinary() {
return new byte[0];
}

/**
* Because the serialization of aggregation is just the function without the parameters or the
* result, its expected that there's nothing to deserialize
*/
@Override
default void fromBinary(byte[] bytes) {}


}
Expand Up @@ -53,14 +53,6 @@ public void clearResult() {
return statisticsResult;
}

@Override
public byte[] toBinary() {
return new byte[] {};
}

@Override
public void fromBinary(final byte[] bytes) {}

@Override
public byte[] resultToBinary(final InternalDataStatistics<T, ?, ?> result) {
return PersistenceUtils.toBinary(result);
Expand Down
Expand Up @@ -16,14 +16,6 @@
public class MergingAggregation<T extends Mergeable> implements Aggregation<Persistable, T, T> {
private T result = null;

@Override
public byte[] toBinary() {
return new byte[0];
}

@Override
public void fromBinary(final byte[] bytes) {}

@Override
public Persistable getParameters() {
return null;
Expand Down
Expand Up @@ -44,14 +44,6 @@ public void add(final Aggregation<?, ?, SimpleFeature> aggregation) {
aggregations.add(aggregation);
}

@Override
public byte[] toBinary() {
return new byte[0];
}

@Override
public void fromBinary(final byte[] bytes) {}

@Override
public PersistableList getParameters() {
List<Persistable> persistables = Lists.newArrayListWithCapacity(aggregations.size());
Expand Down
Expand Up @@ -31,14 +31,6 @@ public VectorCountAggregation(final FieldNameParam fieldNameParam) {
this.fieldNameParam = fieldNameParam;
}

@Override
public byte[] toBinary() {
return new byte[0];
}

@Override
public void fromBinary(final byte[] bytes) {}

@Override
public FieldNameParam getParameters() {
return fieldNameParam;
Expand Down
Expand Up @@ -34,14 +34,6 @@ public VectorMathAggregation(final FieldNameParam fieldNameParam) {
this.fieldNameParam = fieldNameParam;
}

@Override
public byte[] toBinary() {
return new byte[0];
}

@Override
public void fromBinary(final byte[] bytes) {}

@Override
public FieldNameParam getParameters() {
return fieldNameParam;
Expand Down
Expand Up @@ -176,14 +176,6 @@ public void aggregate(final SimpleFeature entry) {
queue.add(entry);
}

@Override
public byte[] toBinary() {
return new byte[] {};
}

@Override
public void fromBinary(final byte[] bytes) {}

@Override
public byte[] resultToBinary(final DistributedRenderResult result) {
return result.toBinary();
Expand Down