lasdf1234 commented on code in PR #12366:
URL: https://github.com/apache/gravitino/pull/12366#discussion_r3748120978
##########
core/src/main/java/org/apache/gravitino/secret/SecretManager.java:
##########
@@ -144,75 +234,155 @@ public List<SecretUrn> getSecretBindingUrns(
* Writes plaintext secrets from {@code secretBindings} values into the
write-through providers
* for {@code secretUrns} (e.g. Vault).
*
- * <p>{@code secretUrns} must come from {@link #getSecretBindingUrns}. On
failure, already-written
- * URNs are rolled back. Callers must put URN strings into properties
themselves (e.g. via {@link
- * SecretPropertyUtils#applySecretUrns}).
+ * <p>{@code secretUrns} must come from {@link #assembleSecretUrns} or {@link
+ * #getSecretBindingUrns}. On failure, already-written URNs are rolled back.
When using {@link
+ * #assembleSecretUrns}, URN strings are already in properties; otherwise
callers must put them
+ * themselves (e.g. via {@link SecretPropertyUtils#putSecretUrns}).
*
- * @param secretBindings property key → write-through binding
- * @param secretUrns write-through URNs from {@link #getSecretBindingUrns}
+ * @param secretBindings property key → write-through binding (null or empty
is a no-op)
+ * @param secretUrns write-through URNs from {@link #assembleSecretUrns} or
{@link
+ * #getSecretBindingUrns}
*/
- public void writeSecrets(Map<String, SecretBinding> secretBindings,
List<SecretUrn> secretUrns) {
- Preconditions.checkArgument(
- secretBindings != null && !secretBindings.isEmpty(),
- "secretBindings must not be null or empty");
- Preconditions.checkArgument(
- secretUrns != null && !secretUrns.isEmpty(), "secretUrns must not be
null or empty");
+ public void writeSecrets(
+ @Nullable Map<String, SecretBinding> secretBindings, @Nullable
List<SecretUrn> secretUrns) {
Review Comment:
Yes, I agree. @nullable has been removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]