feat: expose mapped raw and uns data through grpc adapters
This commit is contained in:
@@ -72,7 +72,8 @@ internal sealed class DataWriteExecutor(DataAuthenticatedContext context, Func<L
|
||||
if (!string.Equals(current.Serving.Role, "Primary", StringComparison.OrdinalIgnoreCase)
|
||||
|| !node.SourceEnabled || !node.Supported || !node.Metadata.Writable
|
||||
|| !ValueMatches(node.Metadata, item.Value) || item.ExpectedCatalogRevision != current.Serving.CatalogEpoch
|
||||
|| item.ExpectedServingIncarnation != current.Serving.Incarnation)
|
||||
|| item.ExpectedServingIncarnation != current.Serving.Incarnation
|
||||
|| item.ExpectedServingGeneration is { } generation && (generation <= 0 || generation != current.Serving.ServingGeneration))
|
||||
return Reject("Write unavailable before dispatch.");
|
||||
if (string.IsNullOrWhiteSpace(item.OperationId) || string.IsNullOrWhiteSpace(item.CorrelationId))
|
||||
return Reject("Invalid write identity.");
|
||||
@@ -82,8 +83,10 @@ internal sealed class DataWriteExecutor(DataAuthenticatedContext context, Func<L
|
||||
catch (Exception ex) when (ex is ArgumentException or InvalidOperationException)
|
||||
{ return Reject("Invalid write value."); }
|
||||
var result = registry.Claim(context.PrincipalId, item.OperationId, item.ExpectedServingIncarnation, hash);
|
||||
if (result.Kind is WriteClaimKind.Conflict or WriteClaimKind.Stale or WriteClaimKind.Capacity || result.Claim is null)
|
||||
return Reject("Write operation conflict or capacity exhausted.");
|
||||
if (result.Kind is WriteClaimKind.Conflict or WriteClaimKind.Stale)
|
||||
return new(item.CorrelationId, Unknown);
|
||||
if (result.Kind == WriteClaimKind.Capacity || result.Claim is null)
|
||||
return Reject("Write operation capacity exhausted.");
|
||||
var claim = result.Claim;
|
||||
if (result.Kind == WriteClaimKind.Existing)
|
||||
{
|
||||
@@ -185,6 +188,8 @@ internal sealed class DataWriteExecutor(DataAuthenticatedContext context, Func<L
|
||||
DataFingerprintEncoding.AppendString(hash, canonicalView.Subject);
|
||||
DataFingerprintEncoding.AppendInt64(hash, item.ExpectedCatalogRevision);
|
||||
DataFingerprintEncoding.AppendString(hash, item.ExpectedServingIncarnation);
|
||||
DataFingerprintEncoding.AppendByte(hash, item.ExpectedServingGeneration.HasValue ? (byte)1 : (byte)0);
|
||||
if (item.ExpectedServingGeneration is { } generation) DataFingerprintEncoding.AppendInt64(hash, generation);
|
||||
item.Value.AppendSemanticFingerprint(hash);
|
||||
return hash.GetHashAndReset();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user