eric-maynard commented on code in PR #1261: URL: https://github.com/apache/polaris/pull/1261#discussion_r2017318096
########## polaris-core/src/main/java/org/apache/polaris/core/policy/validator/maintenance/SnapshotRetentionPolicyValidator.java: ########## @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.polaris.core.policy.validator.maintenance; + +import org.apache.polaris.core.policy.content.maintenance.SnapshotRetentionPolicyContent; +import org.apache.polaris.core.policy.validator.InvalidPolicyException; + +public class SnapshotRetentionPolicyValidator extends BaseMaintenancePolicyValidator { + public static final SnapshotRetentionPolicyValidator INSTANCE = + new SnapshotRetentionPolicyValidator(); + + @Override + public void validate(String content) throws InvalidPolicyException { + SnapshotRetentionPolicyContent.fromString(content); Review Comment: If there's no logic in the validators, can we drop them for now? It seems reasonable enough for the policies to confirm the policy is valid during construction, which is what we have right now. If we have really complex validation in the future, it could make sense to move it out -- 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]
