Skip to content

Commit

Permalink
Move BasicMap and SearchRequestMap to parent package
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Froh <froh@amazon.com>
  • Loading branch information
msfroh committed Dec 4, 2023
1 parent 077b90c commit 7b049b0
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.search.pipeline.common.helpers;
package org.opensearch.search.pipeline.common;

import java.util.Collection;
import java.util.Map;
Expand All @@ -19,7 +19,7 @@
* Helper for map abstractions passed to scripting processors. Throws {@link UnsupportedOperationException} for almost
* all methods. Subclasses just need to implement get and put.
*/
public abstract class BasicMap implements Map<String, Object> {
abstract class BasicMap implements Map<String, Object> {

/**
* No-args constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import org.opensearch.search.pipeline.Processor;
import org.opensearch.search.pipeline.SearchRequestProcessor;
import org.opensearch.search.pipeline.StatefulSearchRequestProcessor;
import org.opensearch.search.pipeline.common.helpers.BasicMap;
import org.opensearch.search.pipeline.common.helpers.SearchRequestMap;

import java.io.InputStream;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.search.pipeline.common.helpers;
package org.opensearch.search.pipeline.common;

import org.opensearch.action.search.SearchRequest;
import org.opensearch.search.builder.SearchSourceBuilder;
Expand All @@ -17,7 +17,7 @@
* A custom implementation of {@link Map} that provides access to the properties of a {@link SearchRequest}'s
* {@link SearchSourceBuilder}. The class allows retrieving and modifying specific properties of the search request.
*/
public class SearchRequestMap extends BasicMap implements Map<String, Object> {
class SearchRequestMap extends BasicMap implements Map<String, Object> {

private final SearchSourceBuilder source;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
* compatible open source license.
*/

package org.opensearch.search.pipeline.common.helpers;
package org.opensearch.search.pipeline.common;

import org.opensearch.OpenSearchException;
import org.opensearch.OpenSearchWrapperException;

/**
* An exception that indicates an error occurred while processing a {@link SearchRequestMap}.
*/
public class SearchRequestMapProcessingException extends OpenSearchException implements OpenSearchWrapperException {
class SearchRequestMapProcessingException extends OpenSearchException implements OpenSearchWrapperException {

/**
* Constructs a new SearchRequestMapProcessingException with the specified message.
*
* @param msg The error message.
* @param msg The error message.
* @param args Arguments to substitute in the error message.
*/
public SearchRequestMapProcessingException(String msg, Object... args) {
Expand All @@ -29,9 +29,9 @@ public SearchRequestMapProcessingException(String msg, Object... args) {
/**
* Constructs a new SearchRequestMapProcessingException with the specified message and cause.
*
* @param msg The error message.
* @param msg The error message.
* @param cause The cause of the exception.
* @param args Arguments to substitute in the error message.
* @param args Arguments to substitute in the error message.
*/
public SearchRequestMapProcessingException(String msg, Throwable cause, Object... args) {
super(msg, cause, args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.opensearch.script.SearchScript;
import org.opensearch.search.builder.SearchSourceBuilder;
import org.opensearch.search.pipeline.PipelineProcessingContext;
import org.opensearch.search.pipeline.common.helpers.SearchRequestMap;
import org.opensearch.test.OpenSearchTestCase;
import org.junit.Before;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
package org.opensearch.search.pipeline.common.helpers;
package org.opensearch.search.pipeline.common;

import org.opensearch.action.search.SearchRequest;
import org.opensearch.search.builder.SearchSourceBuilder;
Expand Down

0 comments on commit 7b049b0

Please sign in to comment.