Skip to content

Commit 75a5db7

Browse files
SOLR-17949: Fix CI failures for Azure Blob Storage backup repository
- Replace fully-qualified class names with imports in test files (Error Prone UnnecessarilyFullyQualified under -Werror) - Remove invalid 'description' key from changelog entry - Regenerate dependency lockfiles after merging upstream/main Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 26eeb40 commit 75a5db7

7 files changed

Lines changed: 27 additions & 26 deletions

File tree

changelog/unreleased/SOLR-17949-azure-blob-repository.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ title: Add Azure Blob Storage backup repository module
33
type: added
44
authors:
55
- name: Prateek Singhal
6-
description: |
7-
Added AzureBlobBackupRepository module for backing up and restoring Solr collections to Azure Blob Storage.
8-
Supports multiple authentication methods: connection string, account name + key, SAS token, and Azure Identity (service principal, managed identity).
96
links:
107
- name: SOLR-17949
118
url: https://issues.apache.org/jira/browse/SOLR-17949

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,10 @@ ow2-asm-commons = { module = "org.ow2.asm:asm-commons", version.ref = "ow2-asm"
512512
ow2-asm-tree = { module = "org.ow2.asm:asm-tree", version.ref = "ow2-asm" }
513513
# @keep transitive dependency for version alignment
514514
perfmark-api = { module = "io.perfmark:perfmark-api", version.ref = "perfmark" }
515-
prometheus-metrics-expositionformats = { module = "io.prometheus:prometheus-metrics-exposition-formats", version.ref = "prometheus-metrics" }
516-
prometheus-metrics-model = { module = "io.prometheus:prometheus-metrics-model", version.ref = "prometheus-metrics" }
517515
# Version managed by azure-sdk-bom
518516
projectreactor-core = { module = "io.projectreactor:reactor-core" }
517+
prometheus-metrics-expositionformats = { module = "io.prometheus:prometheus-metrics-exposition-formats", version.ref = "prometheus-metrics" }
518+
prometheus-metrics-model = { module = "io.prometheus:prometheus-metrics-model", version.ref = "prometheus-metrics" }
519519
quicktheories-quicktheories = { module = "org.quicktheories:quicktheories", version.ref = "quicktheories" }
520520
semver4j-semver4j = { module = "org.semver4j:semver4j", version.ref = "semver4j" }
521521
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }

solr/modules/azure-blob-repository/gradle.lockfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ com.tdunning:t-digest:3.3=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,s
5353
commons-cli:commons-cli:1.11.0=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
5454
commons-codec:commons-codec:1.21.0=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
5555
commons-io:commons-io:2.21.0=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
56-
io.dropwizard.metrics:metrics-annotation:4.2.33=jarValidation,testRuntimeClasspath
5756
io.dropwizard.metrics:metrics-core:4.2.33=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
58-
io.dropwizard.metrics:metrics-jetty12-ee10:4.2.33=jarValidation,testRuntimeClasspath
59-
io.dropwizard.metrics:metrics-jetty12:4.2.33=jarValidation,testRuntimeClasspath
6057
io.github.eisop:dataflow-errorprone:3.41.0-eisop1=annotationProcessor,errorprone,testAnnotationProcessor
6158
io.github.java-diff-utils:java-diff-utils:4.12=annotationProcessor,errorprone,testAnnotationProcessor
6259
io.netty:netty-buffer:4.2.12.Final=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath

solr/modules/azure-blob-repository/src/test/org/apache/solr/azureblob/AbstractAzureBlobClientTest.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,23 @@
2424
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
2525
import java.io.IOException;
2626
import java.io.OutputStream;
27+
import java.net.URI;
2728
import java.nio.charset.StandardCharsets;
29+
import java.util.UUID;
2830
import java.util.concurrent.TimeUnit;
2931
import okhttp3.OkHttpClient;
3032
import org.apache.lucene.tests.util.QuickPatchThreadsFilter;
3133
import org.apache.solr.SolrIgnoredThreadsFilter;
3234
import org.apache.solr.SolrTestCase;
35+
import org.apache.solr.util.SocketProxy;
3336
import org.junit.After;
3437
import org.junit.AfterClass;
3538
import org.junit.Assume;
3639
import org.junit.Before;
3740
import org.junit.BeforeClass;
3841
import org.testcontainers.containers.GenericContainer;
3942
import org.testcontainers.utility.DockerImageName;
43+
import reactor.core.scheduler.Schedulers;
4044

4145
/** Abstract class for tests with Azure Blob Storage emulator. */
4246
@ThreadLeakFilters(
@@ -56,7 +60,7 @@ public class AbstractAzureBlobClientTest extends SolrTestCase {
5660
private static String connectionString;
5761

5862
protected String containerName;
59-
protected org.apache.solr.util.SocketProxy proxy;
63+
protected SocketProxy proxy;
6064

6165
protected AzureBlobStorageClient client;
6266

@@ -85,8 +89,8 @@ public void setUpClient() throws Exception {
8589
+ blobServiceUrl
8690
+ "/devstoreaccount1;";
8791

88-
proxy = new org.apache.solr.util.SocketProxy();
89-
proxy.open(new java.net.URI(blobServiceUrl));
92+
proxy = new SocketProxy();
93+
proxy.open(new URI(blobServiceUrl));
9094

9195
HttpClient httpClient = new OkHttpAsyncHttpClientBuilder(sharedOkHttpClient).build();
9296

@@ -100,7 +104,7 @@ public void setUpClient() throws Exception {
100104
.httpClient(httpClient)
101105
.buildClient();
102106

103-
containerName = "test-" + java.util.UUID.randomUUID();
107+
containerName = "test-" + UUID.randomUUID();
104108
client = new AzureBlobStorageClient(blobServiceClient, containerName);
105109
}
106110

@@ -161,7 +165,7 @@ public static void afterAll() {
161165
}
162166

163167
try {
164-
reactor.core.scheduler.Schedulers.shutdownNow();
168+
Schedulers.shutdownNow();
165169
Thread.sleep(100);
166170
} catch (Throwable ignored) {
167171
}

solr/modules/azure-blob-repository/src/test/org/apache/solr/azureblob/AzureBlobBackupRepositoryTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.apache.lucene.store.IOContext;
3232
import org.apache.lucene.store.IndexInput;
3333
import org.apache.lucene.store.IndexOutput;
34+
import org.apache.lucene.store.MMapDirectory;
3435
import org.apache.solr.common.util.NamedList;
3536
import org.apache.solr.core.backup.repository.BackupRepository;
3637
import org.junit.Before;
@@ -215,7 +216,7 @@ public void testCopyFileFromDirectory() throws IOException {
215216
Files.write(tempFile, content.getBytes(StandardCharsets.UTF_8));
216217

217218
try {
218-
Directory sourceDir = new org.apache.lucene.store.MMapDirectory(tempDir);
219+
Directory sourceDir = new MMapDirectory(tempDir);
219220
URI destDirUri = getBaseUri().resolve("copy-from-dir");
220221

221222
repository.copyFileFrom(sourceDir, "source-file.txt", destDirUri);
@@ -250,7 +251,7 @@ public void testCopyFileToDirectory() throws IOException {
250251
Path tempDir = Files.createTempDirectory("blob-test");
251252

252253
try {
253-
Directory destDir = new org.apache.lucene.store.MMapDirectory(tempDir);
254+
Directory destDir = new MMapDirectory(tempDir);
254255

255256
repository.copyFileTo(sourceUri, "source-file.txt", destDir);
256257

@@ -290,7 +291,7 @@ public void testRetrieveChecksumViaRepository() throws IOException {
290291
String fileName = "checksum-test.bin";
291292
long expectedChecksum;
292293
long expectedLength;
293-
try (Directory localDir = new org.apache.lucene.store.MMapDirectory(tempDir)) {
294+
try (Directory localDir = new MMapDirectory(tempDir)) {
294295
try (IndexOutput out = localDir.createOutput(fileName, IOContext.DEFAULT)) {
295296
CodecUtil.writeIndexHeader(out, "azure-blob-test", 1, new byte[16], "suffix");
296297
for (int i = 0; i < 10000; i++) {

solr/modules/azure-blob-repository/src/test/org/apache/solr/azureblob/AzureBlobIndexInputTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.nio.charset.StandardCharsets;
2121
import java.util.Locale;
2222
import org.apache.lucene.store.AlreadyClosedException;
23+
import org.apache.lucene.store.BufferedIndexInput;
2324
import org.apache.lucene.store.IndexInput;
2425
import org.junit.Test;
2526

@@ -333,9 +334,8 @@ public void testIndexInputSlice() throws Exception {
333334
}
334335

335336
/**
336-
* A clone has an independent file pointer (per {@link
337-
* org.apache.lucene.store.BufferedIndexInput#clone()}): seeks and reads on the clone do not move
338-
* the parent's position, and vice versa.
337+
* A clone has an independent file pointer (per {@link BufferedIndexInput#clone()}): seeks and
338+
* reads on the clone do not move the parent's position, and vice versa.
339339
*/
340340
@Test
341341
public void testIndexInputCloneIndependent() throws Exception {

solr/modules/azure-blob-repository/src/test/org/apache/solr/azureblob/AzureBlobPathsTest.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@
1616
*/
1717
package org.apache.solr.azureblob;
1818

19+
import java.util.HashSet;
20+
import java.util.Set;
21+
import java.util.UUID;
1922
import org.junit.Test;
2023

2124
public class AzureBlobPathsTest extends AbstractAzureBlobClientTest {
2225

2326
/** {@code pathExists()} returns false before push, true after. */
2427
@Test
2528
public void testPathExists() throws Exception {
26-
String path = "path-exists-test-" + java.util.UUID.randomUUID() + ".txt";
29+
String path = "path-exists-test-" + UUID.randomUUID() + ".txt";
2730

2831
assertFalse("Path should not exist initially", client.pathExists(path));
2932

@@ -35,7 +38,7 @@ public void testPathExists() throws Exception {
3538
/** {@code pathExists()} reports a freshly-created directory marker as present. */
3639
@Test
3740
public void testDirectoryExists() throws Exception {
38-
String dirPath = "test-directory-" + java.util.UUID.randomUUID() + "/";
41+
String dirPath = "test-directory-" + UUID.randomUUID() + "/";
3942

4043
assertFalse("Directory should not exist initially", client.pathExists(dirPath));
4144

@@ -127,7 +130,7 @@ public void testListAll() throws Exception {
127130
pushContent(dirPath + "subdir1/file3.txt", "Content 3");
128131
pushContent(dirPath + "subdir2/file4.txt", "Content 4");
129132

130-
java.util.Set<String> allFiles = new java.util.HashSet<>();
133+
Set<String> allFiles = new HashSet<>();
131134
listAllRecursive(dirPath, allFiles);
132135

133136
assertTrue("Should find file1.txt", allFiles.contains(dirPath + "file1.txt"));
@@ -136,8 +139,7 @@ public void testListAll() throws Exception {
136139
assertTrue("Should find subdir2/file4.txt", allFiles.contains(dirPath + "subdir2/file4.txt"));
137140
}
138141

139-
private void listAllRecursive(String dirPath, java.util.Set<String> allFiles)
140-
throws AzureBlobException {
142+
private void listAllRecursive(String dirPath, Set<String> allFiles) throws AzureBlobException {
141143
String[] files = client.listDir(dirPath);
142144
for (String file : files) {
143145
String fullPath = dirPath + file;
@@ -160,7 +162,7 @@ public void testDeleteFile() throws Exception {
160162
pushContent(path, "test content");
161163
assertTrue("File should exist", client.pathExists(path));
162164

163-
client.delete(java.util.Set.of(path));
165+
client.delete(Set.of(path));
164166

165167
assertFalse("File should not exist after deletion", client.pathExists(path));
166168
}
@@ -191,7 +193,7 @@ public void testDeleteNonExistentFile() throws Exception {
191193
assertFalse("File should not exist", client.pathExists(path));
192194

193195
AzureBlobNotFoundException thrown =
194-
expectThrows(AzureBlobNotFoundException.class, () -> client.delete(java.util.Set.of(path)));
196+
expectThrows(AzureBlobNotFoundException.class, () -> client.delete(Set.of(path)));
195197
assertTrue(
196198
"Exception message should reference the missing path: " + thrown.getMessage(),
197199
thrown.getMessage().contains(path));

0 commit comments

Comments
 (0)