K
- Type of keys to be read.V
- Type of values to be read.public abstract static class HadoopFormatIO.Read<K,V> extends PTransform<PBegin,PCollection<KV<K,V>>>
PTransform
that reads from any data source which implements Hadoop InputFormat. For
e.g. Cassandra, Elasticsearch, HBase, Redis, Postgres, etc. See the class-level Javadoc on
HadoopFormatIO
for more information.HadoopFormatIO
,
Serialized Formname
Constructor and Description |
---|
Read() |
Modifier and Type | Method and Description |
---|---|
PCollection<KV<K,V>> |
expand(PBegin input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
abstract @Nullable SerializableConfiguration |
getConfiguration() |
<T> Coder<T> |
getDefaultCoder(TypeDescriptor<?> typeDesc,
CoderRegistry coderRegistry)
Returns the default coder for a given type descriptor.
|
abstract @Nullable TypeDescriptor<?> |
getinputFormatClass() |
abstract @Nullable TypeDescriptor<?> |
getinputFormatKeyClass() |
abstract @Nullable TypeDescriptor<?> |
getinputFormatValueClass() |
abstract @Nullable Coder<K> |
getKeyCoder() |
abstract @Nullable SimpleFunction<?,K> |
getKeyTranslationFunction() |
abstract @Nullable TypeDescriptor<K> |
getKeyTypeDescriptor() |
abstract @Nullable java.lang.Boolean |
getSkipKeyClone() |
abstract @Nullable java.lang.Boolean |
getSkipValueClone() |
abstract @Nullable Coder<V> |
getValueCoder() |
abstract @Nullable SimpleFunction<?,V> |
getValueTranslationFunction() |
abstract @Nullable TypeDescriptor<V> |
getValueTypeDescriptor() |
abstract org.apache.beam.sdk.io.hadoop.format.HadoopFormatIO.Read.Builder<K,V> |
toBuilder() |
void |
validateTransform()
Validates construction of this transform.
|
HadoopFormatIO.Read<K,V> |
withConfiguration(Configuration configuration)
Reads from the source using the options provided by the given configuration.
|
HadoopFormatIO.Read<K,V> |
withKeyTranslation(SimpleFunction<?,K> function)
Transforms the keys read from the source using the given key translation function.
|
HadoopFormatIO.Read<K,V> |
withKeyTranslation(SimpleFunction<?,K> function,
Coder<K> coder)
Transforms the keys read from the source using the given key translation function.
|
HadoopFormatIO.Read<K,V> |
withSkipKeyClone(boolean value)
Determines if key clone should be skipped or not (default is 'false').
|
HadoopFormatIO.Read<K,V> |
withSkipValueClone(boolean value)
Determines if value clone should be skipped or not (default is 'false').
|
HadoopFormatIO.Read<K,V> |
withValueTranslation(SimpleFunction<?,V> function)
Transforms the values read from the source using the given value translation function.
|
HadoopFormatIO.Read<K,V> |
withValueTranslation(SimpleFunction<?,V> function,
Coder<V> coder)
Transforms the values read from the source using the given value translation function.
|
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toString, validate
public abstract @Nullable SerializableConfiguration getConfiguration()
public abstract @Nullable SimpleFunction<?,K> getKeyTranslationFunction()
public abstract @Nullable SimpleFunction<?,V> getValueTranslationFunction()
public abstract @Nullable TypeDescriptor<K> getKeyTypeDescriptor()
public abstract @Nullable TypeDescriptor<V> getValueTypeDescriptor()
public abstract @Nullable java.lang.Boolean getSkipKeyClone()
public abstract @Nullable java.lang.Boolean getSkipValueClone()
public abstract @Nullable TypeDescriptor<?> getinputFormatClass()
public abstract @Nullable TypeDescriptor<?> getinputFormatKeyClass()
public abstract @Nullable TypeDescriptor<?> getinputFormatValueClass()
public abstract org.apache.beam.sdk.io.hadoop.format.HadoopFormatIO.Read.Builder<K,V> toBuilder()
public HadoopFormatIO.Read<K,V> withConfiguration(Configuration configuration)
public HadoopFormatIO.Read<K,V> withKeyTranslation(SimpleFunction<?,K> function)
public HadoopFormatIO.Read<K,V> withKeyTranslation(SimpleFunction<?,K> function, Coder<K> coder)
public HadoopFormatIO.Read<K,V> withValueTranslation(SimpleFunction<?,V> function)
public HadoopFormatIO.Read<K,V> withValueTranslation(SimpleFunction<?,V> function, Coder<V> coder)
public HadoopFormatIO.Read<K,V> withSkipKeyClone(boolean value)
public HadoopFormatIO.Read<K,V> withSkipValueClone(boolean value)
public PCollection<KV<K,V>> expand(PBegin input)
PTransform
PTransform
should be expanded on the given
InputT
.
NOTE: This method should not be called directly. Instead apply the PTransform
should
be applied to the InputT
using the apply
method.
Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
expand
in class PTransform<PBegin,PCollection<KV<K,V>>>
public void validateTransform()
public <T> Coder<T> getDefaultCoder(TypeDescriptor<?> typeDesc, CoderRegistry coderRegistry)