Skip to content

Commit

Permalink
Adjust lombok annotations, fix variable names
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
  • Loading branch information
martin-gaievski committed Jul 12, 2022
1 parent 053bd6e commit 5487268
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/main/java/org/opensearch/knn/index/KNNMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@
* the KNNMethodContext passed in by the user. It is also used to provide superficial string translations.
*/
@AllArgsConstructor
@Getter
public class KNNMethod {

@Getter
private final MethodComponent methodComponent;
@Getter
private final Set<SpaceType> spaces;

/**
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/opensearch/knn/index/KNNMethodContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* It will encompass all parameters necessary to build the index.
*/
@AllArgsConstructor
@Getter
public class KNNMethodContext implements ToXContentFragment, Writeable {

private static KNNMethodContext defaultInstance = null;
Expand All @@ -56,11 +57,8 @@ public static synchronized KNNMethodContext getDefault() {
return defaultInstance;
}

@Getter
private final KNNEngine knnEngine;
@Getter
private final SpaceType spaceType;
@Getter
private final MethodComponentContext methodComponent;

/**
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/opensearch/knn/index/MethodComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
package org.opensearch.knn.index;

import lombok.Getter;
import lombok.Setter;
import org.opensearch.common.TriFunction;
import org.opensearch.common.ValidationException;
import org.opensearch.knn.common.KNNConstants;
Expand Down Expand Up @@ -209,7 +208,6 @@ public static class Builder {

private String name;
private Map<String, Parameter<?>> parameters;
@Setter
private BiFunction<MethodComponent, MethodComponentContext, Map<String, Object>> mapGenerator;
private TriFunction<MethodComponent, MethodComponentContext, Integer, Long> overheadInKBEstimator;
private boolean requiresTraining;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public Codec createKNNCodec(final KNNCodecVersion knnCodecVersion, final Codec u

private Codec getCodec(final KNNCodecVersion knnCodecVersion, final Codec userCodec) {
try {
CodecBuilder constructor = codecByVersion.getOrDefault(knnCodecVersion, codecByVersion.get(LATEST_KNN_CODEC_VERSION));
return constructor.userCodec(userCodec).build();
final CodecBuilder codecBuilder = codecByVersion.getOrDefault(knnCodecVersion, codecByVersion.get(LATEST_KNN_CODEC_VERSION));
return codecBuilder.userCodec(userCodec).build();
} catch (Exception ex) {
throw new RuntimeException("Cannot create instance of KNN codec", ex);
}
Expand Down

0 comments on commit 5487268

Please sign in to comment.