Skip to content

Commit

Permalink
Fix references to moved classes in plugin examples (#80736)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira authored Nov 15, 2021
1 parent 4ba14c4 commit c6cdbf8
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private static void configureDependencies(final Project project) {
var dependencies = project.getDependencies();
dependencies.add("compileOnly", "org.elasticsearch:elasticsearch:" + VersionProperties.getElasticsearch());
dependencies.add("testImplementation", "org.elasticsearch.test:framework:" + VersionProperties.getElasticsearch());
dependencies.add("testImplementation", "org.apache.logging.log4j:log4j-core:" + VersionProperties.getVersions().get("log4j"));

// we "upgrade" these optional deps to provided for plugins, since they will run
// with a full elasticsearch server that includes optional deps
Expand Down
2 changes: 1 addition & 1 deletion plugins/examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ subprojects {
targetCompatibility = 11

repositories {
if (gradle.includedBuilds == false) {
if (!gradle.includedBuilds) {
// Only necessary when building plugins against SNAPSHOT versions of Elasticsearch
maven {
url = 'https://snapshots.elastic.co/maven/'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.xcontent.ObjectParser;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@

package org.elasticsearch.example.customsuggester;

import org.elasticsearch.common.xcontent.ParseField;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.text.Text;
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.xcontent.ConstructingObjectParser;
import org.elasticsearch.xcontent.ObjectParser;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.XContentParser;
import org.elasticsearch.search.suggest.Suggest;

import java.io.IOException;

import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg;
import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg;

public class CustomSuggestion extends Suggest.Suggestion<CustomSuggestion.Entry> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package org.elasticsearch.example.customsuggester;

import org.elasticsearch.common.xcontent.ParseField;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down
2 changes: 1 addition & 1 deletion plugins/examples/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopDocs;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.common.xcontent.ParseField;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
import org.elasticsearch.xcontent.ConstructingObjectParser;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.XContentParser;
import org.elasticsearch.index.fielddata.IndexFieldData;
Expand All @@ -36,8 +36,8 @@
import java.util.Objects;

import static java.util.Collections.singletonList;
import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg;
import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg;
import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg;
import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg;

/**
* Example rescorer that multiplies the score of the hit by some factor and doesn't resort them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.cluster.metadata.IndexAbstraction;
import org.elasticsearch.cluster.metadata.IndexAbstraction.Index;
import org.elasticsearch.cluster.metadata.IndexAbstraction.ConcreteIndex;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.ESTestCase;
Expand Down Expand Up @@ -120,11 +120,11 @@ public void testAuthorizeClusterAction() {
public void testAuthorizeIndexAction() {
CustomAuthorizationEngine engine = new CustomAuthorizationEngine();
Map<String, IndexAbstraction> indicesMap = new HashMap<>();
indicesMap.put("index", new Index(IndexMetadata.builder("index")
indicesMap.put("index", new ConcreteIndex(IndexMetadata.builder("index")
.settings(Settings.builder().put("index.version.created", Version.CURRENT))
.numberOfShards(1)
.numberOfReplicas(0)
.build()));
.build(), null));
// authorized
{
RequestInfo requestInfo =
Expand Down
2 changes: 1 addition & 1 deletion plugins/examples/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rootDir.listFiles().findAll { it.directory && new File(it, 'build.gradle').exist
gradle.rootProject {
ext {
// Fetch Elasticsearch version from outer build
if (gradle.includedBuilds) {
if (!gradle.includedBuilds) {
new File(rootDir.parentFile.parentFile, 'build-tools-internal/version.properties').withInputStream { is ->
def props = new Properties()
props.load(is)
Expand Down

0 comments on commit c6cdbf8

Please sign in to comment.