Skip to content

Commit

Permalink
Add description to Java pipeline examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Amar3tto committed Feb 26, 2024
1 parent ab29225 commit 8c4df3b
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Java/src/main/java/jdbc/ReadPartitionsJdbc.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
import java.sql.ResultSet;
import java.util.Objects;

/**
* Pipeline for reading data from a JDBC source with partitioning. The pipeline reads records from a
* specified table using the {@code JdbcIO.readWithPartitions()} transform, which partitions the
* table based on the specified number of partitions, the partition column, and the lower and upper
* bounds for the partitioning.
*/
public class ReadPartitionsJdbc {

private static final Logger LOG = LoggerFactory.getLogger(ReadPartitionsJdbc.class);
Expand Down
5 changes: 5 additions & 0 deletions Java/src/main/java/jdbc/WriteJdbc.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
import java.util.Arrays;
import java.util.List;

/**
* The pipeline uses the {@code JdbcIO.write()} transform to insert {@code ExampleRow} instances
* into a specified JDBC table using {@code PreparedStatementSetter} to map {@code ExampleRow}
* fields to the SQL statement parameters.
*/
public class WriteJdbc {

/**
Expand Down
3 changes: 3 additions & 0 deletions Java/src/main/java/mongodb/ReadMongoDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Pipeline for reading data from MongoDB using the {@code MongoDbIO.read()} transform.
*/
public class ReadMongoDB {

private static final Logger LOG =
Expand Down
3 changes: 3 additions & 0 deletions Java/src/main/java/mongodb/WriteMongoDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import java.util.Arrays;
import java.util.List;

/**
* Pipeline for writing data to MongoDB using the {@code MongoDbIO.write()} transform.
*/
public class WriteMongoDB {

private static final String ID_COLUMN = "id";
Expand Down
3 changes: 3 additions & 0 deletions Java/src/main/java/parquet/ReadParquet.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Pipeline for reading data from Parquet files using the{@code ParquetIO.read()} transform.
*/
public class ReadParquet {

private static final Logger LOG = LoggerFactory.getLogger(ReadParquet.class);
Expand Down
3 changes: 3 additions & 0 deletions Java/src/main/java/parquet/WriteParquet.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
import org.apache.beam.sdk.transforms.MapElements;
import org.apache.beam.sdk.transforms.SimpleFunction;

/**
* Pipeline for writing data to Parquet files using the {@code ParquetIO.sink()} sink.
*/
public class WriteParquet {

/** Represents an Example Parquet record. */
Expand Down
5 changes: 5 additions & 0 deletions Java/src/main/java/spanner/ReadWithTransactionSpanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Pipeline for reading data from Google Cloud Spanner with transactional consistency. The pipeline
* retrieves records from a specified Spanner table, using a high-priority transaction bound to the
* strong timestamp consistency mode.
*/
public class ReadWithTransactionSpanner {

private static final Logger LOG = LoggerFactory.getLogger(ReadWithTransactionSpanner.class);
Expand Down
3 changes: 3 additions & 0 deletions Java/src/main/java/tfrecord/ReadTFRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Pipeline for reading data from TFRecord files using the {@code TFRecordIO.read()} transform.
*/
public class ReadTFRecord {

private static final Logger LOG =
Expand Down
3 changes: 3 additions & 0 deletions Java/src/main/java/tfrecord/WriteTFRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
import java.util.Arrays;
import java.util.List;

/**
* Pipeline for writing data to TFRecord files using the {@code TFRecordIO.write()} transform.
*/
public class WriteTFRecord {

/**
Expand Down

0 comments on commit 8c4df3b

Please sign in to comment.