Skip to content

feat(java): add async client and interface with CompletableFuture support#316

Merged
jackye1995 merged 1 commit intolance-format:mainfrom
jackye1995:async-java
Mar 13, 2026
Merged

feat(java): add async client and interface with CompletableFuture support#316
jackye1995 merged 1 commit intolance-format:mainfrom
jackye1995:async-java

Conversation

@jackye1995
Copy link
Copy Markdown
Collaborator

Summary

Add two new Java modules for async operations using Java 11+ native HttpClient:

  • lance-namespace-async-client: Generated async HTTP client using library=native,asyncNative=true

    • Uses Java 11+ java.net.http.HttpClient
    • All API methods return CompletableFuture<T>
  • lance-namespace-core-async: Async version of LanceNamespace interface

    • LanceNamespaceAsync interface mirroring LanceNamespace
    • All methods return CompletableFuture<T>
    • Includes async error classes

Key Changes

  • Add async-client-pom.xml (copied after codegen, following Rust's pattern)
  • Update Makefile with async client targets
  • Update checkstyle-suppressions.xml for async client
  • Update java-publish.yml to include async modules in Maven Central check

Usage

// Sync (existing)
LanceNamespace ns = LanceNamespace.connect("rest", props, allocator);
ListTablesResponse response = ns.listTables(request);

// Async (new)
LanceNamespaceAsync ns = LanceNamespaceAsync.connect("rest", props, allocator);
CompletableFuture<ListTablesResponse> future = ns.listTables(request);

Maven Dependencies

<!-- Async interface (Java 11+) -->
<dependency>
  <groupId>org.lance</groupId>
  <artifactId>lance-namespace-core-async</artifactId>
  <version>${version}</version>
</dependency>

<!-- Async client (Java 11+) -->
<dependency>
  <groupId>org.lance</groupId>
  <artifactId>lance-namespace-async-client</artifactId>
  <version>${version}</version>
</dependency>

Test plan

  • make check passes (checkstyle + spotless)
  • make build passes (all modules compile)
  • CI workflows updated to include new modules

🤖 Generated with Claude Code

…port

Add two new Java modules for async operations:

1. lance-namespace-async-client
   - Generated using OpenAPI with library=native,asyncNative=true
   - Uses Java 11+ native java.net.http.HttpClient
   - All API methods return CompletableFuture<T>

2. lance-namespace-core-async
   - LanceNamespaceAsync interface mirroring LanceNamespace
   - All methods return CompletableFuture<T>
   - Includes async error classes

Key changes:
- Add async-client-pom.xml (copied after codegen like Rust pattern)
- Update Makefile with async client targets
- Update checkstyle-suppressions.xml for async client
- Update java-publish.yml to include async modules

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added the enhancement New feature or request label Mar 13, 2026
@jackye1995 jackye1995 merged commit 978dfd1 into lance-format:main Mar 13, 2026
5 checks passed
jackye1995 added a commit that referenced this pull request Mar 13, 2026
## Summary

Add version bump entries for the new async Java modules introduced in
#316:

- `java/async-client-pom.xml` - Template pom.xml for async client
- `java/lance-namespace-core-async/pom.xml` - Async core module

This ensures version bumps will include these new modules.

## Test plan

- [x] Verified entries follow existing pattern in `.bumpversion.toml`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
XuQianJin-Stars pushed a commit to XuQianJin-Stars/lance-namespace that referenced this pull request Mar 16, 2026
…port (lance-format#316)

## Summary

Add two new Java modules for async operations using Java 11+ native
HttpClient:

- **lance-namespace-async-client**: Generated async HTTP client using
`library=native,asyncNative=true`
  - Uses Java 11+ `java.net.http.HttpClient`
  - All API methods return `CompletableFuture<T>`
  
- **lance-namespace-core-async**: Async version of LanceNamespace
interface
  - `LanceNamespaceAsync` interface mirroring `LanceNamespace`
  - All methods return `CompletableFuture<T>`
  - Includes async error classes

### Key Changes
- Add `async-client-pom.xml` (copied after codegen, following Rust's
pattern)
- Update Makefile with async client targets
- Update `checkstyle-suppressions.xml` for async client
- Update `java-publish.yml` to include async modules in Maven Central
check

### Usage

```java
// Sync (existing)
LanceNamespace ns = LanceNamespace.connect("rest", props, allocator);
ListTablesResponse response = ns.listTables(request);

// Async (new)
LanceNamespaceAsync ns = LanceNamespaceAsync.connect("rest", props, allocator);
CompletableFuture<ListTablesResponse> future = ns.listTables(request);
```

### Maven Dependencies

```xml
<!-- Async interface (Java 11+) -->
<dependency>
  <groupId>org.lance</groupId>
  <artifactId>lance-namespace-core-async</artifactId>
  <version>${version}</version>
</dependency>

<!-- Async client (Java 11+) -->
<dependency>
  <groupId>org.lance</groupId>
  <artifactId>lance-namespace-async-client</artifactId>
  <version>${version}</version>
</dependency>
```

## Test plan

- [x] `make check` passes (checkstyle + spotless)
- [x] `make build` passes (all modules compile)
- [x] CI workflows updated to include new modules

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
XuQianJin-Stars pushed a commit to XuQianJin-Stars/lance-namespace that referenced this pull request Mar 16, 2026
## Summary

Add version bump entries for the new async Java modules introduced in
lance-format#316:

- `java/async-client-pom.xml` - Template pom.xml for async client
- `java/lance-namespace-core-async/pom.xml` - Async core module

This ensures version bumps will include these new modules.

## Test plan

- [x] Verified entries follow existing pattern in `.bumpversion.toml`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants