public class Managed
extends java.lang.Object
PTransform
s that build and instantiate turnkey
transforms.
This API currently supports two operations: read(java.lang.String)
and write(java.lang.String)
.
Each one enumerates the available transforms in a TRANSFORMS
map.
Turnkey transforms are represented as SchemaTransform
s, which means each one has a
defined configuration. A given transform can be built with a Map<String, Object>
that
specifies arguments using like so:
PCollectionRowTuple output = PCollectionRowTuple.empty(pipeline).apply(
Managed.read(ICEBERG)
.withConfig(ImmutableMap.<String, Object>.builder()
.put("foo", "abc")
.put("bar", 123)
.build()));
Instead of specifying configuration arguments directly in the code, one can provide the location to a YAML file that contains this information. Say we have the following YAML file:
foo: "abc"
bar: 123
The file's path can be passed in to the Managed API like so:
PCollectionRowTuple input = PCollectionRowTuple.of("input", pipeline.apply(Create.of(...)))
PCollectionRowTuple output = input.apply(
Managed.write(ICEBERG)
.withConfigUrl(<config path>));
Modifier and Type | Class and Description |
---|---|
static class |
Managed.ManagedTransform |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ICEBERG |
static java.util.Map<java.lang.String,java.lang.String> |
READ_TRANSFORMS |
static java.util.Map<java.lang.String,java.lang.String> |
WRITE_TRANSFORMS |
Constructor and Description |
---|
Managed() |
Modifier and Type | Method and Description |
---|---|
static Managed.ManagedTransform |
read(java.lang.String source)
Instantiates a
Managed.ManagedTransform transform for the specified source. |
static Managed.ManagedTransform |
write(java.lang.String sink)
Instantiates a
Managed.ManagedTransform transform for the specified sink. |
public static final java.lang.String ICEBERG
public static final java.util.Map<java.lang.String,java.lang.String> READ_TRANSFORMS
public static final java.util.Map<java.lang.String,java.lang.String> WRITE_TRANSFORMS
public static Managed.ManagedTransform read(java.lang.String source)
Managed.ManagedTransform
transform for the specified source. The
supported managed sources are:
ICEBERG
: Read from Apache Iceberg
public static Managed.ManagedTransform write(java.lang.String sink)
Managed.ManagedTransform
transform for the specified sink. The supported
managed sinks are:
ICEBERG
: Write to Apache Iceberg