mosche commented on code in PR #27991: URL: https://github.com/apache/beam/pull/27991#discussion_r1298328425
########## sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/SchemaInformationProvider.java: ########## @@ -0,0 +1,29 @@ +/* + * 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.beam.sdk.schemas.utils; + +import javax.annotation.Nullable; +import org.apache.beam.sdk.schemas.Schema; +import org.apache.beam.sdk.schemas.utils.ConvertHelpers.ConvertedSchemaInformation; +import org.apache.beam.sdk.values.TypeDescriptor; + +public interface SchemaInformationProvider { Review Comment: Wondering, the current interface doesn't make it easy to verify / check the provider is deterministic (rather than the first one found if there's multiple providers supporting the same type). But I don't think this is critical as long as it's clearly an internal class. In any case, I'd suggest adding some Javadocs and `@Internal`. ########## sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/ConvertHelpers.java: ########## @@ -58,6 +57,8 @@ "rawtypes" }) public class ConvertHelpers { + private static final ServiceLoader<SchemaInformationProvider> SCHEMA_INFORMATION_PROVIDERS = Review Comment: how about moving this into a private static inner class so initialization is delayed until first use? -- 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]
