From 387af43ad60fe4347fc5be3e4b416e202858d741 Mon Sep 17 00:00:00 2001 From: Ziya Suzen Date: Wed, 9 Oct 2024 13:23:21 +0100 Subject: [PATCH] Add placement configuration to object store --- src/NATS.Client.ObjectStore/NatsObjConfig.cs | 7 +++++++ src/NATS.Client.ObjectStore/NatsObjContext.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NATS.Client.ObjectStore/NatsObjConfig.cs b/src/NATS.Client.ObjectStore/NatsObjConfig.cs index 9df981fbb..bef5d7d03 100644 --- a/src/NATS.Client.ObjectStore/NatsObjConfig.cs +++ b/src/NATS.Client.ObjectStore/NatsObjConfig.cs @@ -1,3 +1,5 @@ +using NATS.Client.JetStream.Models; + namespace NATS.Client.ObjectStore; /// @@ -40,6 +42,11 @@ public record NatsObjConfig(string Bucket) /// public int NumberOfReplicas { get; init; } = 1; + /// + /// Placement requirements for a object store stream. + /// + public Placement? Placement { get; init; } + /// /// Additional metadata for the bucket. /// diff --git a/src/NATS.Client.ObjectStore/NatsObjContext.cs b/src/NATS.Client.ObjectStore/NatsObjContext.cs index 969239e17..61c23a8f3 100644 --- a/src/NATS.Client.ObjectStore/NatsObjContext.cs +++ b/src/NATS.Client.ObjectStore/NatsObjContext.cs @@ -43,7 +43,7 @@ public async ValueTask CreateObjectStoreAsync(NatsObjConfig confi MaxBytes = config.MaxBytes ?? -1, Storage = storage, NumReplicas = config.NumberOfReplicas, - /* TODO: Placement = */ + Placement = config.Placement, Discard = StreamConfigDiscard.New, AllowRollupHdrs = true, AllowDirect = true,