Skip to content

Commit

Permalink
Merge branch 'main' into composeui
Browse files Browse the repository at this point in the history
  • Loading branch information
malliaridis committed Dec 7, 2024
2 parents 97fb1c3 + 7547395 commit 517ed98
Show file tree
Hide file tree
Showing 544 changed files with 4,431 additions and 4,107 deletions.
3 changes: 2 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
dependencies:
- changed-files:
- any-glob-to-any-file:
- versions.props
- gradle/libs.versions.toml # Solr 10+
- versions.props # Solr < v10
- versions.lock
- solr/licenses/**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ private boolean hasInheritedJavadocs(Element element) {
}

// Check for methods up the types tree.
if (element instanceof ExecutableElement) {
ExecutableElement thisMethod = (ExecutableElement) element;
if (element instanceof ExecutableElement thisMethod) {
Iterable<Element> superTypes =
() -> superTypeForInheritDoc(thisMethod.getEnclosingElement()).iterator();

Expand Down
8 changes: 8 additions & 0 deletions dev-docs/v2-api-conventions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ For use within the v2 API, the four "popular" HTTP methods have the following se
* `PUT` - used for idempotent resource modifications.
* `DELETE` - Used to delete or cleanup resource

== Errors

v2 APIs should be consistent in how they report errors. Throwing a `SolrException` will convey
1.the error code as the HTTP response status code, as `responseHeader.status` and as `error.code`, and
1.the error message as `error.msg`.

API calls that reference a specific resource (e.g. `specificCollName`, `specificAliasName`, `specificPropertyName` and others per the above list) that do not exist should return `SolrException.ErrorCode.NOT_FOUND` (HTTP 404).

== Exceptional Cases - "Command" APIs

The pairing of semantic HTTP verbs and "resource"-based paths gives Solr an intuitive pattern for representing many operations, but not all.
Expand Down
17 changes: 17 additions & 0 deletions gradle/documentation/changes-to-html.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ class ChangesToHtmlTask extends DefaultTask {

def toHtml(File versionsFile) {
def output = new ByteArrayOutputStream()

// Check if the perl executable exists
if (!perlExists()) {
logger.warn("WARNING: Perl is not installed, skipping creating Changes.html")
return
}

def result = project.exec {
executable project.externalTool("perl")
standardInput changesFile.newInputStream()
Expand Down Expand Up @@ -114,4 +121,14 @@ class ChangesToHtmlTask extends DefaultTask {
throw new GradleException("Changes file ${changesFile} or Doap file ${changesDoapFile} not found.")
}
}

def perlExists() {
try {
def process = "perl -v".execute()
process.waitFor()
return process.exitValue() == 0
} catch (Exception e) {
return false
}
}
}
2 changes: 1 addition & 1 deletion gradle/validation/error-prone.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ allprojects { prj ->
'-Xep:Overrides:WARN',
// '-Xep:OverridesGuiceInjectableMethod:OFF', // we don't use guice
'-Xep:ParameterName:WARN',
// '-Xep:PatternMatchingInstanceof:WARN', // todo check if useful or comment why not
'-Xep:PatternMatchingInstanceof:WARN',
'-Xep:PreconditionsCheckNotNullRepeated:WARN',
'-Xep:PrimitiveAtomicReference:WARN',
'-Xep:ProtectedMembersInFinalClass:WARN',
Expand Down
16 changes: 16 additions & 0 deletions gradle/validation/forbidden-apis/commons-cli.commons-cli.all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@defaultMessage Use a org.apache.commons.cli.Option instead of a String value
org.apache.commons.cli.CommandLine#hasOption(java.lang.String)
org.apache.commons.cli.CommandLine#getOptionValue(java.lang.String)
org.apache.commons.cli.CommandLine#getOptionValue(java.lang.String, java.lang.String)
org.apache.commons.cli.CommandLine#getParsedOptionValue(java.lang.String, java.lang.Object)
org.apache.commons.cli.CommandLine#hasOption(char)
org.apache.commons.cli.CommandLine#getOptionValue(char)
org.apache.commons.cli.CommandLine#getOptionValue(char, java.lang.String)
#org.apache.commons.cli.CommandLine#getOptionValue(char, Supplier<String>)
org.apache.commons.cli.CommandLine#getOptionValues(char)
org.apache.commons.cli.CommandLine#getOptionValues(java.lang.String)
org.apache.commons.cli.CommandLine#getParsedOptionValue(char)
# org.apache.commons.cli.CommandLine#getParsedOptionValue(char, Supplier<T>)
org.apache.commons.cli.CommandLine#getParsedOptionValue(char, java.lang.Object)
org.apache.commons.cli.CommandLine#getParsedOptionValue(java.lang.String)
# org.apache.commons.cli.CommandLine#getParsedOptionValue(String, Supplier<T>)
38 changes: 36 additions & 2 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ Improvements

* SOLR-17495: Change Solr CLI delete command to not delete configs by default. Decouple lifecycle of collections from configsets. (Eric Pugh)

* SOLR-17516: `LBHttp2SolrClient` is now generic, adding support for `HttpJdkSolrClient`. (James Dyer)

Optimizations
---------------------
(No changes)
* SOLR-17568: The CLI bin/solr export tool now contacts the appropriate nodes directly for data instead of proxying through one.
(David Smiley)

Bug Fixes
---------------------
Expand Down Expand Up @@ -71,7 +74,7 @@ Deprecation Removals
in WordBreakSolrSpellChecker (Andrey Bozhko via Eric Pugh)

* SOLR-14763: Remove deprecated asynchronous request methods from `Http2SolrClient`, `HttpJdkSolrClient` and `LBHttp2SolrClient`
in favor of the new CompletableFuture based methods. Remove the related deprecated interfaces `AsyncListener` and ``Cancellable`
in favor of the new CompletableFuture based methods. Remove the related deprecated interfaces `AsyncListener` and `Cancellable`
(James Dyer)

* SOLR-14115: Remove deprecated zkcli script in favour of equivalent bin/solr sub commmands. (Eric Pugh)
Expand All @@ -89,6 +92,14 @@ Deprecation Removals
* SOLR-17256: Previously deprecated `SolrRequest` methods `setBasePath` and `getBasePath` have been removed. SolrJ users
wishing to temporarily override an HTTP client's base URL may use `Http2SolrClient.requestWithBaseUrl` instead. (Jason Gerlowski)

* SOLR-17564: Remove code in Assign used for backwards compatibility with Collections created prior to 7.0 (Paul McArthur)

* SOLR-17576: Remove deprecated master/slave option language from ReplicationHandler. (Eric Pugh)

* SOLR-16781: Support for `<lib/>` directives (used in solrconfig.xml to add JARs on a core-by-core basis) has been removed. Users
looking for similar functionality can use Solr's package manager. Users that don't need to vary JAR access on a per-core basis
have many options, including the `<sharedLib/>` tag and directly modifying Solr's classpath prior to JVM startup. (Jason Gerlowski)

Dependency Upgrades
---------------------
(No changes)
Expand Down Expand Up @@ -124,6 +135,10 @@ Other Changes

* SOLR-17321: Minimum Java version for Apache Solr is now 21, and for SolrJ, it is 17. (Sanjay Dutt, David Smiley)

* SOLR-16903: Update CLI tools to use java.nio.file.Path instead of java.io.File (Andrey Bozhko)

* SOLR-17568: SolrCloud no longer reroutes/proxies a core request to another node if not found locally. (David Smiley)

================== 9.8.0 ==================
New Features
---------------------
Expand Down Expand Up @@ -165,6 +180,15 @@ Improvements

* SOLR-17390: EmbeddedSolrServer now considers the ResponseParser (David Smiley)

* SOLR-16390: v2 "cluster prop" APIs have been updated to be more REST-ful. Cluster prop creation/update are now available
at `PUT /api/cluster/properties/somePropName`. Deletion is now available at `DELETE /api/cluster/properties/somePropName`.
New APIs for listing-all and fetching-single cluster props are also now available at `GET /api/cluster/properties` and
`GET /api/cluster/properties/somePropName`, respectively. (Carlos Ugarte via Jason Gerlowski)

* SOLR-16470: Replication "fetch file" API now has a v2 equivalent, available at `GET /api/cores/coreName/replication/files/fileName`
(Matthew Biscocho via Jason Gerlowski)


Optimizations
---------------------
* SOLR-14985: Solrj CloudSolrClient with Solr URLs had serious performance regressions (since the
Expand Down Expand Up @@ -212,6 +236,10 @@ Bug Fixes
* SOLR-16976: Remove log4j-jul jar and use slf4j bridge for JUL to prevent exception from being logged when remote JMX
is enabled (Shawn Heisey, Stephen Zhou, Eric Pugh, Christine Poerschke, David Smiley)

* SOLR-17575: Fixed broken backwards compatibility with the legacy "langid.whitelist" config in Solr Langid. (Jan Høydahl, Alexander Zagniotov)

* SOLR-17574: Fix AllowListUrlChecker when liveNodes changes. Remove ClusterState.getHostAllowList (Bruno Roustant, David Smiley)

Dependency Upgrades
---------------------
(No changes)
Expand All @@ -237,6 +265,12 @@ led to the suppression of exceptions. (Andrey Bozhko)

* SOLR-17545: Upgrade to Gradle 8.10 (Houston Putman)

* SOLR-17504: CoreContainer calls UpdateHandler.commit when closing a read-only core (Bruno Roustant)

* SOLR-17556: "home" and "data" directories used by Solr examples have been updated to align with documented best practices. (Eric Pugh, Houston Putman)

* SOLR-17577: Remove "solr.indexfetcher.sotimeout" system property that was for optimizing replication tests. It was disabled, but not removed. (Eric Pugh)

================== 9.7.1 ==================
Bug Fixes
---------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.client.api.endpoint;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import java.util.Map;
import org.apache.solr.client.api.model.ListClusterPropertiesResponse;
import org.apache.solr.client.api.model.SetClusterPropertyRequestBody;
import org.apache.solr.client.api.model.SolrJerseyResponse;

/** Definitions for v2 JAX-RS cluster properties APIs. */
@Path("/cluster/properties")
public interface ClusterPropertyApis {
@GET
@Operation(
summary = "List all cluster properties in this Solr cluster.",
tags = {"cluster-properties"})
ListClusterPropertiesResponse listClusterProperties();

@GET
@Path("/{propertyName}")
@Operation(
summary = "Get a cluster property in this Solr cluster.",
tags = {"cluster-properties"})
SolrJerseyResponse getClusterProperty(
@Parameter(description = "The name of the property being retrieved.", required = true)
@PathParam("propertyName")
String propertyName);

@PUT
@Path("/{propertyName}")
@Operation(
summary = "Set a single new or existing cluster property in this Solr cluster.",
tags = {"cluster-properties"})
SolrJerseyResponse createOrUpdateClusterProperty(
@Parameter(description = "The name of the property being set.", required = true)
@PathParam("propertyName")
String propertyName,
@RequestBody(description = "Value to set for the property", required = true)
SetClusterPropertyRequestBody requestBody)
throws Exception;

@PUT
@Operation(
summary = "Set nested cluster properties in this Solr cluster.",
tags = {"cluster-properties"})
SolrJerseyResponse createOrUpdateNestedClusterProperty(
@RequestBody(description = "Property/ies to be set", required = true)
Map<String, Object> propertyValuesByName)
throws Exception;

@DELETE
@Path("/{propertyName}")
@Operation(
summary = "Delete a cluster property in this Solr cluster.",
tags = {"cluster-properties"})
SolrJerseyResponse deleteClusterProperty(
@Parameter(description = "The name of the property being deleted.", required = true)
@PathParam("propertyName")
String propertyName);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.client.api.endpoint;

import io.swagger.v3.oas.annotations.Operation;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import org.apache.solr.client.api.model.CreateCollectionBackupRequestBody;
import org.apache.solr.client.api.model.RestoreCollectionRequestBody;
import org.apache.solr.client.api.model.SolrJerseyResponse;
import org.apache.solr.client.api.model.SubResponseAccumulatingJerseyResponse;

/**
* V2 API definition for creating a new "backup" of a specified collection
*
* <p>This API is analogous to the v1 /admin/collections?action=BACKUP command.
*/
public interface CollectionBackupApi {

@Path("/collections/{collectionName}/backups/{backupName}/versions")
interface Create {
@POST
@Operation(
summary = "Creates a new backup point for a collection",
tags = {"collection-backups"})
SolrJerseyResponse createCollectionBackup(
@PathParam("collectionName") String collectionName,
@PathParam("backupName") String backupName,
CreateCollectionBackupRequestBody requestBody)
throws Exception;
}

@Path("/backups/{backupName}/restore")
interface Restore {
@POST
@Operation(
summary = "Restores an existing backup point to a (potentially new) collection.",
tags = {"collection-backups"})
SubResponseAccumulatingJerseyResponse restoreCollection(
@PathParam("backupName") String backupName, RestoreCollectionRequestBody requestBody)
throws Exception;
}
}
Loading

0 comments on commit 517ed98

Please sign in to comment.