K
- Type of keys to be read.V
- Type of values to be read.public abstract static class HadoopInputFormatIO.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
HadoopInputFormatIO
for more information.HadoopInputFormatIO
,
Serialized Formname
Constructor and Description |
---|
Read() |
Modifier and Type | Method and Description |
---|---|
PCollection<KV<K,V>> |
expand(PBegin input)
Applies this
PTransform on the given InputT , and returns its
Output . |
abstract HadoopInputFormatIO.SerializableConfiguration |
getConfiguration() |
<T> Coder<T> |
getDefaultCoder(TypeDescriptor<?> typeDesc,
CoderRegistry coderRegistry)
Returns the default coder for a given type descriptor.
|
abstract TypeDescriptor<?> |
getinputFormatClass() |
abstract TypeDescriptor<?> |
getinputFormatKeyClass() |
abstract TypeDescriptor<?> |
getinputFormatValueClass() |
abstract SimpleFunction<?,K> |
getKeyTranslationFunction() |
abstract TypeDescriptor<K> |
getKeyTypeDescriptor() |
abstract SimpleFunction<?,V> |
getValueTranslationFunction() |
abstract TypeDescriptor<V> |
getValueTypeDescriptor() |
HadoopInputFormatIO.Read<K,V> |
withConfiguration(org.apache.hadoop.conf.Configuration configuration)
Returns a new
HadoopInputFormatIO.Read that will read from the source using the
options provided by the given configuration. |
HadoopInputFormatIO.Read<K,V> |
withKeyTranslation(SimpleFunction<?,K> function)
Returns a new
HadoopInputFormatIO.Read that will transform the keys read from the
source using the given key translation function. |
HadoopInputFormatIO.Read<K,V> |
withValueTranslation(SimpleFunction<?,V> function)
Returns a new
HadoopInputFormatIO.Read that will transform the values read from the
source using the given value translation function. |
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toString, validate
@Nullable public abstract HadoopInputFormatIO.SerializableConfiguration getConfiguration()
@Nullable public abstract SimpleFunction<?,K> getKeyTranslationFunction()
@Nullable public abstract SimpleFunction<?,V> getValueTranslationFunction()
@Nullable public abstract TypeDescriptor<K> getKeyTypeDescriptor()
@Nullable public abstract TypeDescriptor<V> getValueTypeDescriptor()
@Nullable public abstract TypeDescriptor<?> getinputFormatClass()
@Nullable public abstract TypeDescriptor<?> getinputFormatKeyClass()
@Nullable public abstract TypeDescriptor<?> getinputFormatValueClass()
public HadoopInputFormatIO.Read<K,V> withConfiguration(org.apache.hadoop.conf.Configuration configuration)
HadoopInputFormatIO.Read
that will read from the source using the
options provided by the given configuration.
Does not modify this object.
public HadoopInputFormatIO.Read<K,V> withKeyTranslation(SimpleFunction<?,K> function)
HadoopInputFormatIO.Read
that will transform the keys read from the
source using the given key translation function.
Does not modify this object.
public HadoopInputFormatIO.Read<K,V> withValueTranslation(SimpleFunction<?,V> function)
HadoopInputFormatIO.Read
that will transform the values read from the
source using the given value translation function.
Does not modify this object.
public PCollection<KV<K,V>> expand(PBegin input)
PTransform
PTransform
on the given InputT
, and returns its
Output
.
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 <T> Coder<T> getDefaultCoder(TypeDescriptor<?> typeDesc, CoderRegistry coderRegistry)