com.google.cloud.dataflow.sdk.coders.package-info Maven / Gradle / Ivy
Show all versions of google-cloud-dataflow-java-sdk-all Show documentation
/*
* Copyright (C) 2015 Google Inc.
*
* Licensed 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.
*/
/**
* Defines {@link com.google.cloud.dataflow.sdk.coders.Coder Coders}
* to specify how data is encoded to and decoded from byte strings.
*
* During execution of a Pipeline, elements in a
* {@link com.google.cloud.dataflow.sdk.values.PCollection}
* may need to be encoded into byte strings.
* This happens both at the beginning and end of a pipeline when data is read from and written to
* persistent storage and also during execution of a pipeline when elements are communicated between
* machines.
*
*
Exactly when PCollection elements are encoded during execution depends on which
* {@link com.google.cloud.dataflow.sdk.runners.PipelineRunner} is being used and how that runner
* chooses to execute the pipeline. As such, Dataflow requires that all PCollections have an
* appropriate Coder in case it becomes necessary. In many cases, the Coder can be inferred from
* the available Java type
* information and the Pipeline's {@link com.google.cloud.dataflow.sdk.coders.CoderRegistry}. It
* can be specified per PCollection via
* {@link com.google.cloud.dataflow.sdk.values.PCollection#setCoder(Coder)} or per type using the
* {@link com.google.cloud.dataflow.sdk.coders.DefaultCoder} annotation.
*
*
This package provides a number of coders for common types like {@code Integer},
* {@code String}, and {@code List}, as well as coders like
* {@link com.google.cloud.dataflow.sdk.coders.AvroCoder} that can be used to encode many custom
* types.
*
*/
package com.google.cloud.dataflow.sdk.coders;