Skip to content

Commit 80d4d72

Browse files
authored
[Java] Fix format with spotless (#1539)
Changes introduced with #1404 were not formatted correctly Running spotless (via build.sh) fixed the formatting. CC @mythrocks @cjnolet Authors: - Lorenzo Dematté (https://github.com/ldematte) - Jake Awe (https://github.com/AyodeAwe) - gpuCI (https://github.com/GPUtester) - MithunR (https://github.com/mythrocks) Approvers: - MithunR (https://github.com/mythrocks) URL: #1539
1 parent 142110b commit 80d4d72

5 files changed

Lines changed: 8 additions & 22 deletions

File tree

java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSAceParams.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public class CuVSAceParams {
5252
*/
5353
private final boolean useDisk;
5454

55-
private CuVSAceParams(
56-
long npartitions, long efConstruction, String buildDir, boolean useDisk) {
55+
private CuVSAceParams(long npartitions, long efConstruction, String buildDir, boolean useDisk) {
5756
this.npartitions = npartitions;
5857
this.efConstruction = efConstruction;
5958
this.buildDir = buildDir;

java/cuvs-java/src/main/java/com/nvidia/cuvs/HnswIndex.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ static HnswIndex.Builder newBuilder(CuVSResources cuvsResources) {
5151
* @return A new HNSW index
5252
* @throws Throwable if an error occurs during conversion
5353
*/
54-
static HnswIndex fromCagra(HnswIndexParams hnswParams, CagraIndex cagraIndex)
55-
throws Throwable {
54+
static HnswIndex fromCagra(HnswIndexParams hnswParams, CagraIndex cagraIndex) throws Throwable {
5655
Objects.requireNonNull(hnswParams);
5756
Objects.requireNonNull(cagraIndex);
5857
return CuVSProvider.provider().hnswIndexFromCagra(hnswParams, cagraIndex);

java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ HnswIndex.Builder newHnswIndexBuilder(CuVSResources cuVSResources)
121121
* @return A new HNSW index
122122
* @throws Throwable if an error occurs during conversion
123123
*/
124-
HnswIndex hnswIndexFromCagra(HnswIndexParams hnswParams, CagraIndex cagraIndex)
125-
throws Throwable;
124+
HnswIndex hnswIndexFromCagra(HnswIndexParams hnswParams, CagraIndex cagraIndex) throws Throwable;
126125

127126
/** Creates a new TieredIndex Builder. */
128127
TieredIndex.Builder newTieredIndexBuilder(CuVSResources cuVSResources)

java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/HnswIndexImpl.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -268,26 +268,17 @@ public static HnswIndex fromCagra(HnswIndexParams hnswParams, CagraIndex cagraIn
268268
MemorySegment hnswParamsMemorySegment = hnswParamsHandle.handle();
269269

270270
// Set HNSW params
271-
cuvsHnswIndexParams.hierarchy(
272-
hnswParamsMemorySegment,
273-
hnswParams.getHierarchy().value);
274-
cuvsHnswIndexParams.ef_construction(
275-
hnswParamsMemorySegment,
276-
hnswParams.getEfConstruction());
277-
cuvsHnswIndexParams.num_threads(
278-
hnswParamsMemorySegment,
279-
hnswParams.getNumThreads());
271+
cuvsHnswIndexParams.hierarchy(hnswParamsMemorySegment, hnswParams.getHierarchy().value);
272+
cuvsHnswIndexParams.ef_construction(hnswParamsMemorySegment, hnswParams.getEfConstruction());
273+
cuvsHnswIndexParams.num_threads(hnswParamsMemorySegment, hnswParams.getNumThreads());
280274

281275
try (var resourcesAccessor = resources.access()) {
282276
var cuvsRes = resourcesAccessor.handle();
283277

284278
// Call cuvsHnswFromCagra
285279
int returnValue =
286280
cuvsHnswFromCagra(
287-
cuvsRes,
288-
hnswParamsMemorySegment,
289-
cagraImpl.getCagraIndexReference(),
290-
hnswIndex);
281+
cuvsRes, hnswParamsMemorySegment, cagraImpl.getCagraIndexReference(), hnswIndex);
291282
checkCuVSError(returnValue, "cuvsHnswFromCagra");
292283

293284
returnValue = cuvsStreamSync(cuvsRes);

java/cuvs-java/src/test/java/com/nvidia/cuvs/CagraAceBuildAndSearchIT.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import java.util.Arrays;
1616
import java.util.List;
1717
import java.util.Map;
18-
import java.util.UUID;
1918
import org.junit.Before;
2019
import org.junit.Test;
2120
import org.junit.runner.RunWith;
@@ -174,8 +173,7 @@ public void testAceDiskBasedBuild() throws Throwable {
174173

175174
// Verify ACE created the expected output files in the build directory
176175
assertTrue(
177-
"CAGRA graph file should exist",
178-
Files.exists(buildDir.resolve("cagra_graph.npy")));
176+
"CAGRA graph file should exist", Files.exists(buildDir.resolve("cagra_graph.npy")));
179177
assertTrue(
180178
"Reordered dataset file should exist",
181179
Files.exists(buildDir.resolve("reordered_dataset.npy")));

0 commit comments

Comments
 (0)