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:
PCollection<Row> rows = pipeline.apply(
Managed.read(ICEBERG)
.withConfig(ImmutableMap.<String, Object>.builder()
.put("foo", "abc")
.put("bar", 123)
.build()))
.getOutput();
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 config.yaml
file:
foo: "abc"
bar: 123
The file's path can be passed in to the Managed API like so:
PCollection<Row> inputRows = pipeline.apply(Create.of(...));
inputRows.apply(Managed.write(ICEBERG).withConfigUrl("path/to/config.yaml"));
Modifier and Type | Class and Description |
---|---|
static class |
Managed.ManagedTransform |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ICEBERG |
static java.lang.String |
KAFKA |
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.lang.String KAFKA
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