Giter Site home page Giter Site logo

applied-duality / dataflowjavasdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlecloudplatform/dataflowjavasdk

0.0 1.0 0.0 838 KB

Dataflow provides a simple, powerful model for building both batch and streaming parallel data processing pipelines.

Home Page: http://cloud.google.com/dataflow

License: Apache License 2.0

Java 100.00%

dataflowjavasdk's Introduction

Cloud Dataflow Java SDK (Alpha)

Google Cloud Dataflow provides a simple, powerful programming model for building both batch and streaming parallel data processing pipelines.

Status

The Cloud Dataflow SDK is used to access the Google Cloud Dataflow service, which is currently in Alpha and restricted to whitelisted users.

The SDK is publicly available and can be used for local execution by anyone. Note, however, that the SDK is also an Alpha release and may change significantly over time. The SDK is built to be extensible and support additional execution environments ("runners") beyond local execution and the Google Cloud Dataflow service. As the product matures, we look forward to working with you to improve Cloud Dataflow.

Overview

The key concepts in this programming model are:

  • PCollection: represents a collection of data, which could be bounded or unbounded in size.
  • PTransform: represents a computation that transform input PCollections into output PCollections.
  • Pipeline: manages a directed acyclic graph of PTransforms and PCollections, which is ready for execution.
  • PipelineRunner: specifies where and how the pipeline should execute.

Currently there are three runners:

  1. The DirectPipelineRunner runs the pipeline on your local machine.
  2. The DataflowPipelineRunner submits the pipeline to the Dataflow Service, where it runs using managed resources in the Google Cloud Platform.
  3. The BlockingDataflowPipelineRunner submits the pipeline to the Dataflow Service via the DataflowPipelineRunner and then prints messages about the job status until execution is complete.

The Dataflow Service is currently in the Alpha phase of development and access is limited to whitelisted users.

Getting Started

This repository consists of two modules:

  • Java SDK module provides a set of basic Java APIs to program against.
  • Examples module provides a few samples to get started. We recommend starting with the WordCount example.

The following command will build both modules and install them in your local Maven repository:

mvn clean install

You can speed up the build and install process by using the following options:

  1. To skip execution of the unit tests, run:

    mvn install -DskipTests

  2. While iterating on a specific module, use the following command to compile and reinstall it. For example, to reinstall the 'examples' module, run:

    mvn install -pl examples

Be careful, however, as this command will use the most recently installed SDK from the local repository (or Maven Central) even if you have changed it locally.

  1. To run Maven using multiple threads, run:

    mvn -T 4 install

After building and installing, the following command will execute the WordCount example using the DirectPipelineRunner on your local machine:

mvn exec:java -pl examples \
-Dexec.mainClass=com.google.cloud.dataflow.examples.WordCount \
-Dexec.args="--input=<INPUT FILE PATTERN> --output=<OUTPUT FILE>"

If you have been whitelisted for Alpha access to the Dataflow Service and followed the developer setup steps, you can use the BlockingDataflowPipelineRunner to run the same program in the Google Cloud Platform (GCP):

mvn exec:java -pl examples \
-Dexec.mainClass=com.google.cloud.dataflow.examples.WordCount \
-Dexec.args="--project=<YOUR GCP PROJECT NAME> --stagingLocation=<YOUR GCS LOCATION> --runner=BlockingDataflowPipelineRunner"

Google Cloud Storage (GCS) location should be entered in the form of gs://bucket/path/to/staging/directory. Google Cloud Platform (GCP) project refers to its name (not number), which has been whitelisted for Cloud Dataflow. Refer here for instructions to get started with Google Cloud Platform.

Other examples can be run similarly by replacing the WordCount class name with BigQueryTornadoes, DatastoreWordCount, TfIdf, TopWikipediaSessions, etc. and adjusting runtime options under Dexec.args parameter, as specified in the example itself.

More Information

dataflowjavasdk's People

Contributors

davorbonaci avatar francesperry avatar kennknowles avatar robertwb avatar lukecwik avatar malo-denielou avatar dpmills avatar peihe avatar reuvenlax avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.