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

[REFACTORING] Updating search-processor for XContentType refactor #116

Closed
sejli opened this issue Mar 9, 2023 · 1 comment
Closed

[REFACTORING] Updating search-processor for XContentType refactor #116

sejli opened this issue Mar 9, 2023 · 1 comment
Assignees
Labels
refactoring Improve the design, structure, and/or implementation of the software, while preserving its function. Search

Comments

@sejli
Copy link
Member

sejli commented Mar 9, 2023

Description

Following the XContentType refactor, search-processor plugin no longer builds on 3.0.0. XContentType usage should be rearranged in the repository to reflect the refactor changes.

Sample Output

Building using 3.0.0 gradle build tools:

➜ search-processor (main-version) ✗ ./gradlew build

> Configure project :
true
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 7.4.2
  OS Info               : Mac OS X 12.6.3 (aarch64)
  JDK Version           : 11 (Eclipse Temurin JDK)
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/jdk-11.0.17+8/Contents/Home
  Random Testing Seed   : DF0676945F54ACBA
  In FIPS 140 mode      : false
=======================================

> Task :compileJava FAILED
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/ResultTransformerConfigurationFactory.java:12: error: cannot find symbol
import org.opensearch.common.xcontent.XContentParser;
                                     ^
  symbol:   class XContentParser
  location: package org.opensearch.common.xcontent
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/TransformerConfiguration.java:13: error: cannot find symbol
import org.opensearch.common.ParseField;
                            ^
  symbol:   class ParseField
  location: package org.opensearch.common
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/TransformerConfiguration.java:15: error: cannot find symbol
import org.opensearch.common.xcontent.ToXContentObject;
                                     ^
  symbol:   class ToXContentObject
  location: package org.opensearch.common.xcontent
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/TransformerConfiguration.java:17: error: cannot find symbol
public abstract class TransformerConfiguration implements Writeable, ToXContentObject {
                                                                     ^
  symbol: class ToXContentObject
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/ResultTransformerConfigurationFactory.java:32: error: cannot find symbol
    ResultTransformerConfiguration configure(XContentParser parser) throws IOException;
                                             ^
  symbol:   class XContentParser
  location: interface ResultTransformerConfigurationFactory
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/TransformerConfiguration.java:18: error: cannot find symbol
  protected static final ParseField TRANSFORMER_ORDER = new ParseField(ORDER);
                         ^
  symbol:   class ParseField
  location: class TransformerConfiguration
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/TransformerConfiguration.java:19: error: cannot find symbol
  protected static final ParseField TRANSFORMER_PROPERTIES = new ParseField(PROPERTIES);
                         ^
  symbol:   class ParseField
  location: class TransformerConfiguration
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:10: error: cannot find symbol
import org.opensearch.common.ParseField;
                            ^
  symbol:   class ParseField
  location: package org.opensearch.common
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:14: error: cannot find symbol
import org.opensearch.common.xcontent.XContentBuilder;
                                     ^
  symbol:   class XContentBuilder
  location: package org.opensearch.common.xcontent
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:15: error: cannot find symbol
import org.opensearch.common.xcontent.XContentParser;
                                     ^
  symbol:   class XContentParser
  location: package org.opensearch.common.xcontent
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:31: error: cannot find symbol
    private static final ParseField RESULT_TRANSFORMER = new ParseField(TransformerType.RESULT_TRANSFORMER.toString());
                         ^
  symbol:   class ParseField
  location: class SearchConfigurationExtBuilder
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:64: error: cannot find symbol
    public static SearchConfigurationExtBuilder parse(XContentParser parser,
                                                      ^
  symbol:   class XContentParser
  location: class SearchConfigurationExtBuilder
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:111: error: cannot find symbol
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
                                      ^
  symbol:   class XContentBuilder
  location: class SearchConfigurationExtBuilder
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:111: error: cannot find symbol
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
           ^
  symbol:   class XContentBuilder
  location: class SearchConfigurationExtBuilder
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfigurationFactory.java:12: error: cannot find symbol
import org.opensearch.common.xcontent.XContentParser;
                                     ^
  symbol:   class XContentParser
  location: package org.opensearch.common.xcontent
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfigurationFactory.java:37: error: cannot find symbol
    public ResultTransformerConfiguration configure(XContentParser parser) throws IOException {
                                                    ^
  symbol:   class XContentParser
  location: class KendraIntelligentRankingConfigurationFactory
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:10: error: cannot find symbol
import org.opensearch.common.ParseField;
                            ^
  symbol:   class ParseField
  location: package org.opensearch.common
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:16: error: cannot find symbol
import org.opensearch.common.xcontent.ObjectParser;
                                     ^
  symbol:   class ObjectParser
  location: package org.opensearch.common.xcontent
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:17: error: cannot find symbol
import org.opensearch.common.xcontent.ToXContentObject;
                                     ^
  symbol:   class ToXContentObject
  location: package org.opensearch.common.xcontent
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:18: error: cannot find symbol
import org.opensearch.common.xcontent.XContentBuilder;
                                     ^
  symbol:   class XContentBuilder
  location: package org.opensearch.common.xcontent
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:19: error: cannot find symbol
import org.opensearch.common.xcontent.XContentParser;
                                     ^
  symbol:   class XContentParser
  location: package org.opensearch.common.xcontent
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:36: error: cannot find symbol
  private static final ObjectParser<KendraIntelligentRankingConfiguration, Void> PARSER;
                       ^
  symbol:   class ObjectParser
  location: class KendraIntelligentRankingConfiguration
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:124: error: cannot find symbol
  public static class KendraIntelligentRankingProperties implements Writeable, ToXContentObject {
                                                                               ^
  symbol:   class ToXContentObject
  location: class KendraIntelligentRankingConfiguration
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:79: error: cannot find symbol
  public static KendraIntelligentRankingConfiguration parse(XContentParser parser) throws IOException {
                                                            ^
  symbol:   class XContentParser
  location: class KendraIntelligentRankingConfiguration
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:93: error: cannot find symbol
  public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
                                    ^
  symbol:   class XContentBuilder
  location: class KendraIntelligentRankingConfiguration
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:93: error: cannot find symbol
  public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
                                                             ^
  symbol:   class Params
  location: class KendraIntelligentRankingConfiguration
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:93: error: cannot find symbol
  public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
         ^
  symbol:   class XContentBuilder
  location: class KendraIntelligentRankingConfiguration
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:125: error: cannot find symbol
    protected static final ParseField BODY_FIELD = new ParseField(Constants.BODY_FIELD);
                           ^
  symbol:   class ParseField
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:126: error: cannot find symbol
    protected static final ParseField TITLE_FIELD = new ParseField(Constants.TITLE_FIELD);
                           ^
  symbol:   class ParseField
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:127: error: cannot find symbol
    protected static final ParseField DOC_LIMIT = new ParseField(Constants.DOC_LIMIT);
                           ^
  symbol:   class ParseField
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:129: error: cannot find symbol
    private static final ObjectParser<KendraIntelligentRankingProperties, Void> PARSER;
                         ^
  symbol:   class ObjectParser
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:168: error: cannot find symbol
    public static KendraIntelligentRankingProperties parse(XContentParser parser, Void context) throws IOException {
                                                           ^
  symbol:   class XContentParser
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:183: error: cannot find symbol
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
                                      ^
  symbol:   class XContentBuilder
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:183: error: cannot find symbol
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
                                                               ^
  symbol:   class Params
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:183: error: cannot find symbol
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
           ^
  symbol:   class XContentBuilder
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/SearchRelevancePlugin.java:25: error: cannot find symbol
import org.opensearch.common.xcontent.NamedXContentRegistry;
                                     ^
  symbol:   class NamedXContentRegistry
  location: package org.opensearch.common.xcontent
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/SearchRelevancePlugin.java:82: error: cannot find symbol
      NamedXContentRegistry xContentRegistry,
      ^
  symbol:   class NamedXContentRegistry
  location: class SearchRelevancePlugin
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/ResultTransformerConfigurationFactory.java:40: error: name clash: interface ResultTransformerConfigurationFactory has two methods with the same erasure, yet neither overrides the other
    ResultTransformerConfiguration configure(StreamInput streamInput) throws IOException;
                                   ^
  first method:  configure(XContentParser) in ResultTransformerConfigurationFactory
  second method: configure(Settings) in ResultTransformerConfigurationFactory
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/TransformerConfiguration.java:18: error: cannot find symbol
  protected static final ParseField TRANSFORMER_ORDER = new ParseField(ORDER);
                                                            ^
  symbol:   class ParseField
  location: class TransformerConfiguration
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/TransformerConfiguration.java:19: error: cannot find symbol
  protected static final ParseField TRANSFORMER_PROPERTIES = new ParseField(PROPERTIES);
                                                                 ^
  symbol:   class ParseField
  location: class TransformerConfiguration
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:31: error: cannot find symbol
    private static final ParseField RESULT_TRANSFORMER = new ParseField(TransformerType.RESULT_TRANSFORMER.toString());
                                                             ^
  symbol:   class ParseField
  location: class SearchConfigurationExtBuilder
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:67: error: package XContentParser does not exist
        XContentParser.Token token = parser.currentToken();
                      ^
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:69: error: package XContentParser does not exist
        if (token != XContentParser.Token.START_OBJECT && (token = parser.nextToken()) != XContentParser.Token.START_OBJECT) {
                                   ^
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:69: error: package XContentParser does not exist
        if (token != XContentParser.Token.START_OBJECT && (token = parser.nextToken()) != XContentParser.Token.START_OBJECT) {
                                                                                                        ^
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:72: error: package XContentParser does not exist
                    "Expected [" + XContentParser.Token.START_OBJECT + "] but found [" + token + "]",
                                                 ^
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:76: error: package XContentParser does not exist
        while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
                                                             ^
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:77: error: package XContentParser does not exist
            if (token == XContentParser.Token.FIELD_NAME) {
                                       ^
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:79: error: package XContentParser does not exist
            } else if (token == XContentParser.Token.START_OBJECT) {
                                              ^
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:82: error: package XContentParser does not exist
                    while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
                                                                         ^
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/configuration/SearchConfigurationExtBuilder.java:83: error: package XContentParser does not exist
                        if (token == XContentParser.Token.FIELD_NAME) {
                                                   ^
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfigurationFactory.java:37: error: configure(XContentParser) in KendraIntelligentRankingConfigurationFactory cannot implement configure(Settings) in ResultTransformerConfigurationFactory
    public ResultTransformerConfiguration configure(XContentParser parser) throws IOException {
                                          ^
  overridden method does not throw IOException
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfigurationFactory.java:42: error: name clash: class KendraIntelligentRankingConfigurationFactory has two methods with the same erasure, yet neither overrides the other
    public ResultTransformerConfiguration configure(StreamInput streamInput) throws IOException {
                                          ^
  first method:  configure(XContentParser) in KendraIntelligentRankingConfigurationFactory
  second method: configure(Settings) in KendraIntelligentRankingConfigurationFactory
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:39: error: cannot find symbol
    PARSER = new ObjectParser<>("kendra_intelligent_ranking_configuration", KendraIntelligentRankingConfiguration::new);
                 ^
  symbol:   class ObjectParser
  location: class KendraIntelligentRankingConfiguration
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:92: error: method does not override or implement a method from a supertype
  @Override
  ^
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:125: error: cannot find symbol
    protected static final ParseField BODY_FIELD = new ParseField(Constants.BODY_FIELD);
                                                       ^
  symbol:   class ParseField
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:126: error: cannot find symbol
    protected static final ParseField TITLE_FIELD = new ParseField(Constants.TITLE_FIELD);
                                                        ^
  symbol:   class ParseField
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:127: error: cannot find symbol
    protected static final ParseField DOC_LIMIT = new ParseField(Constants.DOC_LIMIT);
                                                      ^
  symbol:   class ParseField
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:132: error: cannot find symbol
      PARSER = new ObjectParser<>("kendra_intelligent_ranking_configuration", KendraIntelligentRankingProperties::new);
                   ^
  symbol:   class ObjectParser
  location: class KendraIntelligentRankingProperties
/Users/lnse/opensearch/search-processor/src/main/java/org/opensearch/search/relevance/transformer/kendraintelligentranking/configuration/KendraIntelligentRankingConfiguration.java:182: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
59 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 703ms
2 actionable tasks: 2 executed
@sejli sejli added the refactoring Improve the design, structure, and/or implementation of the software, while preserving its function. label Mar 9, 2023
@sejli sejli changed the title [REFACTORING] Updating our repo for XContentType refactor [REFACTORING] Updating search-processor for XContentType refactor Mar 9, 2023
@macohen macohen added the Search label Mar 10, 2023
@sejli sejli removed the untriaged label Mar 13, 2023
@msfroh
Copy link
Collaborator

msfroh commented Mar 13, 2023

Fixed by #117

@msfroh msfroh closed this as completed Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Improve the design, structure, and/or implementation of the software, while preserving its function. Search
Projects
None yet
Development

No branches or pull requests

3 participants