Skip to content

Commit

Permalink
Merge pull request #1 from 2lambda123/task/removeDeprecatedProjection
Browse files Browse the repository at this point in the history
Task/remove deprecated projection
  • Loading branch information
2lambda123 authored Aug 5, 2024
2 parents 5617f02 + 012eeed commit 2881534
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 250 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ static void create(final String fName) throws IOException {
throw new IllegalArgumentException("configuration file does not exist (" + f.getAbsolutePath() + ")");
}

@SuppressWarnings("deprecation")
final JsonParser parser = new JsonParser();
try (final Reader rdr = new FileReader(fName)) {
@SuppressWarnings("deprecation")
final JsonElement json = parser.parse(rdr);
final IngestConfig val = gson.fromJson(json.toString(), IngestConfig.class);
cfg.set(val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ public class DocumentProjection implements DocumentPermutation {
*/
private boolean trackSizes = true;

@Deprecated
public DocumentProjection() {
this(false, false);
}

@Deprecated
public DocumentProjection(boolean includeGroupingContext, boolean reducedResponse) {
this.includeGroupingContext = includeGroupingContext;
this.reducedResponse = reducedResponse;
this.projection = new Projection();
}

public DocumentProjection(boolean includeGroupingContext, boolean reducedResponse, boolean trackSizes, Set<String> projections,
Projection.ProjectionType projectionType) {
this.includeGroupingContext = includeGroupingContext;
Expand Down Expand Up @@ -77,16 +65,6 @@ public DocumentProjection(boolean includeGroupingContext, boolean isReducedRespo
this.projection = projection;
}

@Deprecated
public void setIncludes(Set<String> includes) {
this.projection.setIncludes(includes);
}

@Deprecated
public void setExcludes(Set<String> excludes) {
this.projection.setExcludes(excludes);
}

public Projection getProjection() {
return projection;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,28 +141,4 @@ public EventDataQueryFilter clone() {
return new EventDataQueryFieldFilter(this);
}

/**
* Configure the delegate {@link Projection} with the fields to exclude
*
* @param excludes
* the set of fields to exclude
* @deprecated This method is deprecated and should no longer be used.
*/
@Deprecated
public void setExcludes(Set<String> excludes) {
this.keyProjection.setExcludes(excludes);
}

/**
* Set the delegate {@link Projection} with the fields to include
*
* @param includedFields
* the sorted set of fields to include
* @deprecated This method is deprecated and should no longer be used.
*/
@Deprecated
public void setIncludes(Set<String> includedFields) {
this.keyProjection.setIncludes(includedFields);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,6 @@ public KeyProjection(KeyProjection other) {
projection = other.getProjection();
}

@Deprecated
public KeyProjection() {
projection = new Projection();
}

/**
* Set the delegate {@link Projection} with the fields to include
*
* @param includes
* a set of fields to retain
*/
@Deprecated
public void setIncludes(Set<String> includes) {
projection.setIncludes(includes);
}

/**
* Set the delegate {@link Projection} with the fields to exclude
*
* @param excludes
* a set of fields to exclude
*/
public void setExcludes(Set<String> excludes) {
projection.setExcludes(excludes);
}

@Deprecated
public Projection getProjection() {
return projection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,6 @@
public final class Projection implements Predicate<String> {

private boolean initialized;

@Deprecated
public void setIncludes(Set<String> includes) {
if (this.initialized) {
throw new RuntimeException("This Projection instance was already initialized");
}

// do not make a copy of the incoming include fields. It could be a UniversalSet
this.projections = includes;
this.initialized = true;
type = ProjectionType.INCLUDES;
}

@Deprecated
public void setExcludes(Set<String> excludes) {
if (this.initialized) {
throw new RuntimeException("This Projection instance was already initialized");
}

this.projections = Sets.newHashSet(excludes);
this.initialized = true;
type = ProjectionType.EXCLUDES;
}

@Deprecated
public Set<String> getIncludes() {
return Collections.unmodifiableSet(this.projections);
}

@Deprecated
public Set<String> getExcludes() {
return Collections.unmodifiableSet(this.projections);
}

/* Explicit constructor needed now that the new constructor was added */
@Deprecated
public Projection() {
this.initialized = false;
}

private Set<String> projections;
private ProjectionType type;

Expand Down
Loading

0 comments on commit 2881534

Please sign in to comment.