Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit ce17798

Browse files
Initial commit
Signed-off-by: teodordelibasic-db <teodor.delibasic@databricks.com>
1 parent f4a9819 commit ce17798

42 files changed

Lines changed: 5183 additions & 3380 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ buildNumber.properties
1919
.settings/
2020
.project
2121
.classpath
22+
.metals/
23+
.bsp/
24+
.bazelbsp/
2225

2326
# OS
2427
.DS_Store
2528
Thumbs.db
29+
30+
# Compiled class files
31+
*.class
32+
33+
# Generated proto files in examples
34+
examples/proto/**/AirQualityProto.java

CHANGELOG.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,73 @@
11
# Version changelog
22

3+
## Release v0.2.0
4+
5+
### Native Rust Backend (JNI Migration)
6+
- The SDK now uses JNI (Java Native Interface) to call the Zerobus Rust SDK instead of pure Java gRPC calls
7+
- Native library is automatically loaded from the classpath or system library path
8+
- Token management and background processing handled by native code
9+
10+
### New Stream Classes
11+
12+
**ZerobusProtoStream** - Protocol Buffer ingestion with method-level generics:
13+
- `ingestRecordOffset(T record)` - Auto-encoded: SDK encodes Message to bytes
14+
- `ingestRecordOffset(byte[] bytes)` - Pre-encoded: User provides encoded bytes
15+
- `ingestRecordsOffset(List<T> records)` - Batch auto-encoded ingestion
16+
- `ingestRecordsOffset(List<byte[]> bytes)` - Batch pre-encoded ingestion
17+
- `getUnackedRecords()` - Returns `List<byte[]>` of unacked records
18+
- `getUnackedRecords(Parser<T>)` - Returns parsed `List<T>` of unacked records
19+
- `getUnackedBatches()` - Returns `List<EncodedBatch>` preserving batch grouping
20+
21+
**ZerobusJsonStream** - JSON ingestion without Protocol Buffer dependency:
22+
- `ingestRecordOffset(String json)` - Pre-serialized: User provides JSON string
23+
- `ingestRecordOffset(T obj, JsonSerializer<T>)` - Auto-serialized: SDK serializes object
24+
- `ingestRecordsOffset(List<String> jsons)` - Batch pre-serialized ingestion
25+
- `ingestRecordsOffset(List<T> objs, JsonSerializer<T>)` - Batch auto-serialized ingestion
26+
- `getUnackedRecords()` - Returns `List<String>` of unacked JSON records
27+
- `getUnackedRecords(JsonDeserializer<T>)` - Returns parsed `List<T>` of unacked records
28+
- `getUnackedBatches()` - Returns `List<EncodedBatch>` preserving batch grouping
29+
30+
### New Factory Methods
31+
32+
- `ZerobusSdk.createProtoStream(tableName, descriptorProto, clientId, clientSecret)` - Create proto stream
33+
- `ZerobusSdk.createProtoStream(tableName, descriptorProto, clientId, clientSecret, options)` - With options
34+
- `ZerobusSdk.createJsonStream(tableName, clientId, clientSecret)` - Create JSON stream
35+
- `ZerobusSdk.createJsonStream(tableName, clientId, clientSecret, options)` - With options
36+
- `ZerobusSdk.recreateStream(ZerobusProtoStream)` - Recreate proto stream with unacked record re-ingestion
37+
- `ZerobusSdk.recreateStream(ZerobusJsonStream)` - Recreate JSON stream with unacked record re-ingestion
38+
- `ZerobusSdk.recreateStream(ZerobusStream)` - Recreate legacy stream (deprecated)
39+
40+
### New Supporting Types
41+
42+
- `BaseZerobusStream` - Abstract base class with native JNI methods
43+
- `JsonSerializer<T>` - Functional interface for object-to-JSON serialization
44+
- `JsonDeserializer<T>` - Functional interface for JSON-to-object deserialization
45+
- `EncodedBatch` - Represents a batch of encoded records for recovery
46+
- `AckCallback` - Callback interface with `onAck(long)` and `onError(long, String)`
47+
48+
### Deprecated (Backward Compatible)
49+
50+
**ZerobusStream<T>** - Use `ZerobusProtoStream` instead:
51+
- `ingestRecord(T record)` - Returns `CompletableFuture<Void>`, use `ingestRecordOffset()` instead
52+
- `getStreamId()` - No longer exposed by native backend, returns empty string
53+
- `getState()` - Returns `OPENED` or `CLOSED` only
54+
- `getUnackedRecords()` - **Breaking:** Returns empty iterator (records stored in native, type erasure prevents deserialization). Use `ZerobusProtoStream.getUnackedRecords(Parser<T>)` for typed access, or use `recreateStream()` which handles re-ingestion automatically using cached raw bytes.
55+
56+
**StreamConfigurationOptions**:
57+
- `setAckCallback(Consumer<IngestRecordResponse>)` - No longer invoked by native backend. Use `setAckCallback(AckCallback)` instead
58+
59+
### Removed
60+
61+
- `TokenFactory` - Token management now handled by native Rust SDK
62+
- `BackgroundTask` - Background processing now handled by native Rust SDK
63+
- `ZerobusSdkStubUtils` - gRPC stub utilities no longer needed with native backend
64+
65+
### Platform Support
66+
67+
- Linux x86_64: Supported
68+
- Windows x86_64: Supported
69+
- **macOS: Not yet supported**
70+
371
## Release v0.1.0
472

573
Initial release of the Databricks Zerobus Ingest SDK for Java.

NEXT_CHANGELOG.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,13 @@
11
# NEXT CHANGELOG
22

3-
## Release v0.2.0
3+
## Release v0.3.0
44

55
### New Features and Improvements
66

7-
- Updated Protocol Buffers from 3.24.0 to 4.33.0 for improved performance and latest features
8-
- Updated gRPC dependencies from 1.58.0 to 1.76.0 for enhanced stability and security
9-
- Updated SLF4J logging framework from 1.7.36 to 2.0.17 for modern logging capabilities
10-
117
### Bug Fixes
128

139
### Documentation
1410

15-
- Updated README.md with new dependency versions
16-
- Updated protoc compiler version recommendations
17-
- Updated Logback version compatibility for SLF4J 2.0
18-
1911
### Internal Changes
2012

21-
- Updated maven-compiler-plugin from 3.11.0 to 3.14.1
22-
- All gRPC artifacts now consistently use version 1.76.0
23-
2413
### API Changes
25-
26-
**Breaking Changes**
27-
28-
- **Protocol Buffers 4.x Migration**: If you use the regular JAR (not the fat JAR), you must upgrade to protobuf-java 4.33.0 and regenerate any custom `.proto` files using protoc 4.x
29-
- Download protoc 4.33.0 from: https://github.com/protocolbuffers/protobuf/releases/tag/v33.0
30-
- Regenerate proto files: `protoc --java_out=src/main/java src/main/proto/record.proto`
31-
- Protobuf 4.x is binary-compatible over the wire with 3.x, but generated Java code may differ
32-
33-
- **SLF4J 2.0 Migration**: If you use a logging implementation, you may need to update it:
34-
- `slf4j-simple`: Use version 2.0.17 or later
35-
- `logback-classic`: Use version 1.4.14 or later (for SLF4J 2.0 compatibility)
36-
- `log4j-slf4j-impl`: Use version 2.20.0 or later
37-
38-
**Note**: If you use the fat JAR (`jar-with-dependencies`), all dependencies are bundled and no action is required.

0 commit comments

Comments
 (0)