zhoufek commented on a change in pull request #16762: URL: https://github.com/apache/beam/pull/16762#discussion_r833279256
########## File path: sdks/java/extensions/sbe/src/main/java/org/apache/beam/sdk/extensions/sbe/SbeSchema.java ########## @@ -0,0 +1,169 @@ +/* + * 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.extensions.sbe; + +import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkState; + +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import org.apache.beam.sdk.annotations.Experimental; +import org.apache.beam.sdk.annotations.Experimental.Kind; +import org.apache.beam.sdk.schemas.Schema; +import org.apache.beam.sdk.schemas.io.payloads.PayloadSerializerProvider; +import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting; +import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; +import org.checkerframework.checker.nullness.qual.Nullable; +import uk.co.real_logic.sbe.ir.Ir; + +/** + * Represents an SBE schema that can be translated to a Beam {@link Schema} and {@link + * PayloadSerializerProvider}. + * + * <p>The schema represents a single SBE message. If the XML schema contains more than one message, + * then a new instance must be created for each message that the pipeline will work with. + * + * <p>The currently supported ways of generating a schema are: + * + * <ul> + * <li>Through an intermediate representation ({@link Ir}). + * </ul> + * + * <h3>Intermediate Representation</h3> + * + * <p>An {@link Ir} allows for a reflection-less way of getting a very accurate representation of + * the SBE schema, since it is a tokenized form of the original XML schema. To help deal with some + * ambiguities, such as which message to base the schema around, passing {@link IrOptions} is + * required. See the Javadoc for the options for more details. Review comment: Done -- 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]
