Skip to content

Commit

Permalink
apply spotless after rebase
Browse files Browse the repository at this point in the history
Signed-off-by: HenryL27 <[email protected]>
  • Loading branch information
HenryL27 committed Dec 19, 2023
1 parent 2c2ea47 commit bd64d0e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
import java.util.Map;
import java.util.stream.Collectors;

import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;

import org.opensearch.core.action.ActionListener;
import org.opensearch.core.common.util.CollectionUtils;
import org.opensearch.ml.client.MachineLearningNodeClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import java.util.Set;
import java.util.StringJoiner;

import lombok.AllArgsConstructor;

import org.opensearch.ingest.ConfigurationUtils;
import org.opensearch.neuralsearch.ml.MLCommonsClientAccessor;
import org.opensearch.neuralsearch.processor.rerank.ContextSourceFetcher;
Expand All @@ -38,6 +36,8 @@

import com.google.common.collect.Sets;

import lombok.AllArgsConstructor;

/**
* Factory for rerank processors. Must:
* - Instantiate the right kind of rerank processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
import java.util.Map;
import java.util.stream.Collectors;

import lombok.AllArgsConstructor;

import org.opensearch.action.search.SearchRequest;
import org.opensearch.action.search.SearchResponse;
import org.opensearch.core.action.ActionListener;
import org.opensearch.core.xcontent.ObjectPath;
import org.opensearch.search.SearchHit;

import lombok.AllArgsConstructor;

/**
* Context Source Fetcher that gets context from the search results (documents)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

import lombok.AllArgsConstructor;
import lombok.Getter;

import org.opensearch.action.search.SearchRequest;
import org.opensearch.action.search.SearchResponse;
import org.opensearch.core.action.ActionListener;
import org.opensearch.search.pipeline.PipelineProcessingContext;
import org.opensearch.search.pipeline.SearchResponseProcessor;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* Abstract base class for reranking processors
*/
Expand Down Expand Up @@ -106,7 +106,9 @@ public void processResponseAsync(
generateRerankingContext(
request,
response,
ActionListener.wrap(context -> { rerank(response, context, responseListener); }, e -> { responseListener.onFailure(e); })
ActionListener.wrap(context -> { rerank(response, context, responseListener); }, e -> {
responseListener.onFailure(e);
})

Check warning on line 111 in src/main/java/org/opensearch/neuralsearch/processor/rerank/RerankProcessor.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/neuralsearch/processor/rerank/RerankProcessor.java#L110-L111

Added lines #L110 - L111 were not covered by tests
);
} catch (Exception e) {
responseListener.onFailure(e);

Check warning on line 114 in src/main/java/org/opensearch/neuralsearch/processor/rerank/RerankProcessor.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/neuralsearch/processor/rerank/RerankProcessor.java#L113-L114

Added lines #L113 - L114 were not covered by tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
import java.util.Objects;
import java.util.Optional;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.log4j.Log4j2;

import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.core.xcontent.XContentParser;
import org.opensearch.search.SearchExtBuilder;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.log4j.Log4j2;

@Log4j2
@AllArgsConstructor
public class RerankSearchExtBuilder extends SearchExtBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
import java.util.List;
import java.util.Map;

import lombok.SneakyThrows;
import lombok.extern.log4j.Log4j2;

import org.apache.hc.core5.http.HttpHeaders;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.hc.core5.http.message.BasicHeader;
Expand All @@ -38,6 +35,9 @@

import com.google.common.collect.ImmutableList;

import lombok.SneakyThrows;
import lombok.extern.log4j.Log4j2;

@Log4j2
public class MLOpenSearchRerankProcessorIT extends BaseNeuralSearchIT {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import java.util.Locale;
import java.util.Map;

import lombok.extern.log4j.Log4j2;

import org.junit.Before;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
Expand All @@ -61,6 +59,8 @@
import org.opensearch.search.pipeline.Processor.PipelineContext;
import org.opensearch.test.OpenSearchTestCase;

import lombok.extern.log4j.Log4j2;

@Log4j2
public class MLOpenSearchRerankProcessorTests extends OpenSearchTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import java.util.List;
import java.util.Map;

import lombok.extern.log4j.Log4j2;

import org.junit.Before;
import org.opensearch.common.io.stream.BytesStreamOutput;
import org.opensearch.core.common.bytes.BytesReference;
Expand All @@ -35,6 +33,8 @@
import org.opensearch.search.SearchExtBuilder;
import org.opensearch.test.OpenSearchTestCase;

import lombok.extern.log4j.Log4j2;

@Log4j2
public class RerankSearchExtBuilderTests extends OpenSearchTestCase {

Expand Down

0 comments on commit bd64d0e

Please sign in to comment.