Skip to content

Commit

Permalink
Add placement configuration to object store
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmk committed Oct 9, 2024
1 parent 1d4a55b commit 387af43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/NATS.Client.ObjectStore/NatsObjConfig.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using NATS.Client.JetStream.Models;

namespace NATS.Client.ObjectStore;

/// <summary>
Expand Down Expand Up @@ -40,6 +42,11 @@ public record NatsObjConfig(string Bucket)
/// </summary>
public int NumberOfReplicas { get; init; } = 1;

/// <summary>
/// Placement requirements for a object store stream.
/// </summary>
public Placement? Placement { get; init; }

/// <summary>
/// Additional metadata for the bucket.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/NATS.Client.ObjectStore/NatsObjContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async ValueTask<INatsObjStore> CreateObjectStoreAsync(NatsObjConfig confi
MaxBytes = config.MaxBytes ?? -1,
Storage = storage,
NumReplicas = config.NumberOfReplicas,
/* TODO: Placement = */
Placement = config.Placement,
Discard = StreamConfigDiscard.New,
AllowRollupHdrs = true,
AllowDirect = true,
Expand Down

0 comments on commit 387af43

Please sign in to comment.