Skip to content

Commit 5dbeeeb

Browse files
authored
Merge pull request #723 from Aiven-Open/iceberg-demo
Update Iceberg demo
2 parents 386a94b + 1ab9baf commit 5dbeeeb

File tree

6 files changed

+963
-15
lines changed

6 files changed

+963
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The project follows the API specifications according to the latest version of [K
99

1010
## NEW! Iceberg mode 🧊🎉
1111

12-
The Iceberg mode was added recently. It's currenly in the "alpha" stage, but could already be explored. Please have a look at the [whitepaper](iceberg_whitepaper.md).
12+
The Iceberg mode was added recently. It's currenly in the "alpha" stage, but could already be explored. Please have a look at the [whitepaper](iceberg_whitepaper.md) and [demo](demo/iceberg/README.md).
1313

1414
## References
1515

demo/iceberg/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
plugin

demo/iceberg/Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
.PHONY: plugin
22
plugin:
3-
cd ../../ && ./gradlew :core:distTar
4-
cd ../../ && ./gradlew :storage:core:distTar
5-
cd ../../ && ./gradlew :storage:filesystem:distTar
63
rm -r plugin || true
74
mkdir -p plugin
8-
tar -xf ../../core/build/distributions/core-0.0.1-SNAPSHOT.tgz -C plugin --strip-components=1
9-
tar -xf ../../storage/core/build/distributions/core-0.0.1-SNAPSHOT.tgz -C plugin --strip-components=1
10-
tar -xf ../../storage/filesystem/build/distributions/filesystem-0.0.1-SNAPSHOT.tgz -C plugin --strip-components=1
5+
../../gradlew -p ../../ :core:distTar :storage:core:distTar :storage:filesystem:distTar :storage:s3:distTar
6+
tar -xf ../../core/build/distributions/core-1.1.0-SNAPSHOT.tgz -C plugin --strip-components=1
7+
tar -xf ../../storage/core/build/distributions/core-1.1.0-SNAPSHOT.tgz -C plugin --strip-components=1
8+
tar -xf ../../storage/filesystem/build/distributions/filesystem-1.1.0-SNAPSHOT.tgz -C plugin --strip-components=1
9+
tar -xf ../../storage/s3/build/distributions/s3-1.1.0-SNAPSHOT.tgz -C plugin --strip-components=1

demo/iceberg/clients/app/src/main/java/io/aiven/Clients.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ private static void createTopic() throws ExecutionException, InterruptedExceptio
8383
}
8484

8585
private static void produce() {
86-
try (final KafkaProducer<GenericData.Record, GenericData.Record> producer = new KafkaProducer<>(Map.of(
86+
try (final KafkaProducer<Object, GenericData.Record> producer = new KafkaProducer<>(Map.of(
8787
"bootstrap.servers", BOOTSTRAP_SERVER,
88-
"key.serializer", ByteArraySerializer.class.getCanonicalName(),
88+
"key.serializer", KafkaAvroSerializer.class.getCanonicalName(),
8989
"value.serializer", KafkaAvroSerializer.class.getCanonicalName(),
9090
"schema.registry.url", SCHEMA_REGISTRY_URL
9191
))) {
@@ -103,7 +103,7 @@ private static void produce() {
103103
.set("birthdate", person.getBirthdate().toString())
104104
.set("comments", person.getComments())
105105
.build();
106-
producer.send(new ProducerRecord<>(TOPIC_NAME, 0, Time.SYSTEM.milliseconds(), null, value));
106+
producer.send(new ProducerRecord<>(TOPIC_NAME, 0, Time.SYSTEM.milliseconds(), new byte[1], value));
107107
}
108108
producer.flush();
109109
}

demo/iceberg/docker-compose.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,19 @@ services:
3939
KAFKA_RSM_CONFIG_STORAGE_ROOT: "/tmp"
4040
KAFKA_REMOTE_LOG_MANAGER_TASK_INTERVAL_MS: "5000"
4141
KAFKA_LOG_RETENTION_CHECK_INTERVAL_MS: "5000"
42-
# KAFKA_RSM_CONFIG_SCHEMA_REGISTRY_URL: "http://karapace:8081"
43-
# KAFKA_RSM_CONFIG_CATALOG_URL: "http://rest:8181"
44-
# KAFKA_RSM_CONFIG_S3_ENDPOINT: "http://minio:9000"
42+
# Iceberg configuration.
43+
KAFKA_RSM_CONFIG_STRUCTURE_PROVIDER_CLASS: "io.aiven.kafka.tieredstorage.iceberg.AvroSchemaRegistryStructureProvider"
44+
KAFKA_RSM_CONFIG_STRUCTURE_PROVIDER_SERDE_SCHEMA_REGISTRY_URL: "http://karapace:8081"
45+
KAFKA_RSM_CONFIG_SEGMENT_FORMAT: "iceberg"
46+
KAFKA_RSM_CONFIG_ICEBERG_NAMESPACE: "default"
47+
KAFKA_RSM_CONFIG_ICEBERG_CATALOG_CLASS: "org.apache.iceberg.rest.RESTCatalog"
48+
KAFKA_RSM_CONFIG_ICEBERG_CATALOG_URI: "http://rest:8181"
49+
"KAFKA_RSM_CONFIG_ICEBERG_CATALOG_IO-IMPL": "org.apache.iceberg.aws.s3.S3FileIO"
50+
KAFKA_RSM_CONFIG_ICEBERG_CATALOG_WAREHOUSE: "s3://warehouse/"
51+
KAFKA_RSM_CONFIG_ICEBERG_CATALOG_S3_ENDPOINT: "http://minio:9000"
52+
"KAFKA_RSM_CONFIG_ICEBERG_CATALOG_S3_ACCESS-KEY-ID": "admin"
53+
"KAFKA_RSM_CONFIG_ICEBERG_CATALOG_S3_SECRET-ACCESS-KEY": "password"
54+
KAFKA_RSM_CONFIG_ICEBERG_CATALOG_CLIENT_REGION: "us-east-1"
4555

4656
# Karapace schema registry
4757
karapace:

0 commit comments

Comments
 (0)