Giter Club home page Giter Club logo

pravega-samples's Introduction

Pravega and Analytics Connectors Examples

This repository contains code samples to demonstrate how developers can work with Pravega. We also provide code samples to connect analytics engines such as Flink and Spark with Pravega as a storage substrate for data streams. We also provide samples for using new pravega schema registry with pravega applications.

For more information on Pravega, we recommend to read the documentation and the developer guide.

Repository Structure

This repository is divided into sub-projects (pravega-client-examples, flink-connector-examples, schema-registry-examples, and spark-connector-examples), each one addressed to demonstrate a specific component. In these sub-projects, we provide a battery of simple code examples aimed at illustrating how a particular feature or API works. Moreover, we also include a scenarios folder that contains more complex applications as sub-projects, which show use-cases exploiting one or multiple components.

Hint: Have a look to the terminology and concepts in Pravega.

Pravega Client Examples

Example Name Description Language
gettingstarted Simple example of how to read/write from/to a Pravega Stream. Java
consolerw Application that allows users to work with Stream, Transaction and StreamCut APIs via CLI. Java
noop Example of how to add a simple callback executed upon a read event. Java
statesynchronizer Application that allows users to work with StateSynchronizer API via CLI. Java
streamcuts Application examples demonstrating the use of StreamCuts via CLI. Java
tables Application examples demonstrating the use of KeyValueTables via CLI. Java

The related documentation and instructions are here.

Flink Connector Examples

Example Name Description Language
wordcount Counting the words continuously from a Pravega Stream to demonstrate the usage of Flink connector for Pravega. Java
primer This sample demonstrates Pravega "exactly-once" feature jointly with Flink checkpointing and exactly-once mode. Java
streamcuts This sample demonstrates the use of Pravega StreamCuts in Flink applications. Java

The related documentation and instructions are here.

Scenarios

Example Name Description Language
turbineheatsensor It emulates parallel sensors producing temperature values (writers) and parallel consumers performing real-time statistics (readers) via Pravega client. Java
turbineheatprocessor A Flink streaming application for processing temperature data from a Pravega stream produced by the turbineheatsensor app. The application computes a daily summary of the temperature range observed on that day by each sensor. Java, Scala
anomaly-detection A Flink streaming application for detecting anomalous input patterns using a finite-state machine. Java
pravega-flink-connector-sql-samples Flink connector table api/sql samples. Java
pravega-flink-autoscaling Demonstrates coordinated auto-scaling of Pravega streams and Flink task managers. This sample is build independently in its own folder. Java

Schema Registry Examples

The prerequisite for running Schema Registry Examples is to deploy Pravega and Schema Registry Service. For instructions to run pravga schema registry, please see instructions here

Example Name Description Language
Avro Samples for registering schema in avro format with registry service. Samples demonstrate how to use avro schemas and serializers for writing and reading data from pravega streams. Java
Protobuf Samples for registering schema in protobuf format with registry service. Samples demonstrate how to use protobuf schemas and serializers for writing and reading data from pravega streams. Java
Json Samples for registering schema in json format with registry service. Samples demonstrate how to use json schemas and serializers for writing and reading data from pravega streams. Java
Multiple Formats Samples that demonstrate how to serialize data in different formats and write into same pravega stream. Java
Codec Samples that demonstrate how to use additional codecs and share encoding information using schema registry service. This sample demonstrates using compression codecs for snappy and gzip. Java

The related documentation and instructions are here.

Spark Connector Examples

Example Name Description Language
batch_file_to_pravega PySpark batch job that reads events from the file and writes to a Pravega stream Python
batch_pravega_to_console PySpark batch job that reads from a Pravega stream and writes to the console Python
stream_generated_data_to_pravega PySpark Streaming job that writes generated data to a Pravega stream Python
stream_pravega_to_console PySpark Streaming job that reads from a Pravega stream and writes to the console Python
stream_bounded_pravega_to_console PySpark Streaming job that reads from a bounded Pravega stream and writes to the console Python
stream_pravega_to_pravega PySpark Streaming job that reads from a Pravega stream and writes to another Pravega stream Python
StreamPravegaToConsole Scala Spark Streaming job that reads from a Pravega stream and writes to the console Scala
StreamPravegaToPravega Scala Spark Streaming job that reads from a Pravega stream and writes to another Pravega stream Scala

The related documentation and instructions are here.

Hadoop Connector Examples (Retired: available up to Pravega Samples release 0.10)

Example Name Description Language
wordcount Counts the words from a Pravega Stream filled with random text to demonstrate the usage of Hadoop connector for Pravega. Java
terasort Sort events from an input Pravega Stream and then write sorted events to one or more streams. Java

The related documentation and instructions are here.

Build Instructions

Next, we provide instructions for building the pravega-samples repository. There are two main options:

  • Out-of-the-box: If you want a quick start, run the samples by building pravega-samples out-of-the-box (go straight to section Pravega Samples Build Instructions).
  • Build from source: If you want to have fun building the different projects from source, please read section Building Pravega Components from Source (Optional) before building pravega-samples.

Pre-requisites

  • Java 11
  • Python 3.8 (if you wish to run the python examples)

Building Pravega Components from Source (Optional)

Pravega Build Instructions

If you want to build Pravega from source, you may need to generate the latest Pravega jar files and install them to your local Maven repository. To build Pravega from sources and use it here, please run the following commands:

$ git clone https://github.com/pravega/pravega.git
$ cd pravega
$ ./gradlew install

The above command should generate the required jar files into your local Maven repository.

Hint: For using in the sample applications the Pravega version you just built, you need to update the pravegaVersion=<local_maven_pravega_version> property in gradle.properties file of pravega-samples.

For more information, please visit Pravega.

Flink Connector Build Instructions

To build the Flink connector from source, follow the below steps to build and publish artifacts from source to local Maven repository:

$ git clone --recursive https://github.com/pravega/flink-connectors.git
$ cd flink-connectors
$ ./gradlew install

Hint: For using in the sample applications the Flink connector version you just built, you need to update the flinkConnectorVersion=<local_maven_flink_connector_version> property in gradle.properties file of pravega-samples.

For more information, please visit Flink Connectors.

Schema Registry Build Instructions

Schema registry uses pravega, so make sure pravega is installed and running before installing schema registry. To build Schema Registry from source, follow the below steps to build and publish artifacts from source to local Maven repository:

$ git clone https://github.com/pravega/schema-registry.git
$ cd schema-registry
$ ./gradlew install
$ cd server/build/install/schema-registry
$ # edit conf/schema-registry.config.properties to point to pravega URI (hint: if you are running pravega standalone, it would be tcp://localhost:9090) 
$ ./bin/schema-registry

For more information, please visit Schema Registry.

Configuring Pravega Samples for Running with Source Builds

In the previous instructions, we noted that you will need to change the gradle.properties file in pravega-samples for using the Pravega components built from source. Here we provide an example of how to do so:

  1. Imagine that we want to build Pravega from source. Let us assume that we executed git clone https://github.com/pravega/pravega.git and the last commit of master branch is 2990193xxx.

  2. After executing ./gradlew install, we will see in our local Maven repository (e.g., ~/.m2/repository/io/pravega/*) artifacts that contain in their names that commit version such as 0.3.0-1889.2990193-SNAPSHOT. These artifacts are the result from building Pravega from source.

  3. The only thing you have to do is to set pravegaVersion=0.3.0-1889.2990193-SNAPSHOT in the gradle.properties file of pravega-samples.

While this example is for Pravega, the same procedure applies for Flink and Spark connectors.

Pravega Samples Build Instructions

The pravega-samples project is prepared for working out-of-the-box with release artifacts of Pravega components, which are already available in Maven central. To build pravega-samples from source, use the built-in gradle wrapper as follows:

$ git clone https://github.com/pravega/pravega-samples.git
$ cd pravega-samples
$ ./gradlew clean installDist

That's it! You are good to go and execute the examples :)

To ease their execution, most examples can be run either using the gradle wrapper (gradlew) or scripts. The above gradle command automatically creates the execution scripts that can be found under:

pravega-samples/pravega-client-examples/build/install/pravega-client-examples/bin

There is a Linux/Mac script and a Windows (.bat) script for each separate executable.

Working with dev branch: If you are curious about the most recent sample applications, you may like to try the dev version of pravega-samples as well. To do so, just clone the dev branch instead of master (default):

$ git clone -b dev https://github.com/pravega/pravega-samples.git
$ cd pravega-samples
$ ./gradlew clean installDist

The dev branch works with Pravega snapshots artifacts published in our JFrog repository instead of using release versions.

Proposed Roadmap

We propose a roadmap to proceed with the execution of examples based on their complexity:

  1. Pravega client examples: First step to understand the basics of Pravega and exercise the concepts presented in the documentation.
  2. Flink connector examples: These examples show the basic functionality of the Flink connector for Pravega.
  3. Spark connector examples: These examples show the basic functionality of the Spark connector for Pravega.
  4. Scenarios: Applications that go beyond the basic usage of Pravega APIs, which may include complex interactions between Pravega and analytics engines (e.g., Flink, Spark) to demonstrate analytics use cases.

Where to Find Help

Documentation on Pravega and Analytics Connectors:

Did you find a problem or bug?

Do you want to contribute a new example application?

Have fun!!

pravega-samples's People

Contributors

andreipaduroiu avatar bibinss avatar chrisdail avatar crazyzhou avatar elizabethbain avatar eronwright avatar fpj avatar fyang86 avatar guangfeng-xu avatar hldnova avatar jonny-miller avatar kevinhan88 avatar manishkumarkeshri avatar medvedevigorek avatar ns-dell avatar prabha-veerubhotla avatar raulgracia avatar sggraham32 avatar shiveshr avatar skrishnappa avatar thekingofcity avatar vijikarthi avatar yangb8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pravega-samples's Issues

Update develop branch to pull snapshot dependency from jcenter

The develop branch is currently pointing to both pravega and connector version 0.3.0-SNAPSHOT. Building the samples project will fail unless both pravega and connector dependencies are locally available.

Since the snapshot versions of the both pravega and connector artifacts are published to jcenter repo (https://oss.jfrog.org/jfrog-dependencies/io/pravega), we can update both pravega and connector version from 0.3.0-SNAPSHOT to the most recent SNAPSHOT version published in jcenter repo.

Make sure that pravega snapshot version is the same as used by the connector

Add following headers to all source files

Copyright (c) 2017 Dell Inc., or its subsidiaries. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Add connectors as a source dependency

Issue
The Pravega samples are intended for end-users and thus depend on the latest binary release (e.g. 0.2.1). To also support co-development (where we update the samples to exercise an unreleased feature), a separate branch could point to a recent commit of Pravega rather than to a binary release. I believe it makes sense to treat samples differently because the source code is the final product.

Suggestions
Let's introduce a new branch in the samples called develop which tracks the Pravega/connector master branch. New sample code should be merged into develop. In other words, let's follow the gitflow approach (ref).

To ensure a stable build, let's use a source dependency, similar to pravega/flink-connectors#88. On the develop branch, the submodule should point to a recent commit of the connector and of pravega. It is vital that the Pravega commit-id be consistent with flink-connector and hadoop-connector. Meanwhile, on the sample's master branch, the submodule will be ignored but (as a good practice) should point to the respective release branches.

flink example to demonstrate Pravega exactly_once feature

An example to show how to enable Pravega exactly_once feature.

The potential scenario to demonstrate: a client (flink app) writes events to Pravega via FlinkPravegaWriter with EXACTLY_ONCE mode, but fails occasionally due to network connection issues (e.g., fails to receive acknowledgement, and then re-transmits the failed events).

Ideally, the difference of repeated writes by client and what's in Pravega can be visualized on for example Kibana.

One potential implementation is to enhance the flink anomaly-detection sample.

Remove unnecessary repositories from build.gradle

This repository does not need to be listed any longer:

//TODO temporarily enabled staging repository to pull Flink 1.4.0-RC3 since it is not published yet to maven central
       maven {
            url "https://repository.apache.org/content/repositories/orgapacheflink-1141/"
        }

I'm also wondering why we need the apache snapshot repository. This might have been needed in the past because of Apache Flink:

maven {
             url "https://repository.apache.org/snapshots"
         }

Is it still necessary?

Fix incorrect hadoop connector artifact reference

The fix from #77 introduced few changes to the build configurations that appears incorrect.

#hadoop connector
hadoopVersion=2.8.1
scalaVersion=2.11.8
sparkVersion=2.2.0
hadoopConnectorVersion=0.3.0-17.a171316-SNAPSHOT

The fix should be patched on develop branch.

Use Pravega master rather than Alpha

There are few reasons why we should use master branch for all sample codes:

  • With the merge of package renaming on Pravega pravega/pravega#1096, alpha branch is now out of date. More and more changes and fixes have been being merged to master, which makes alpha more obsolete.

  • All users will eventually be moved to master branch, leaving alpha to be possibly deleted in the near future.

  • Align with Pravega plan toward open sourcing

Remove references to Pravega team under iot

Two files under standalone-examples:

-	code/pravega-samples/standalone-examples/src/main/java/io/pravega/example/iot/PerfStats.java
-	code/pravega-samples/standalone-examples/src/main/java/io/pravega/example/iot/TurbineHeatSensor.java

have the following text:

This code was written by the Pravega team and taken as is, please
do not copy code style or format with the platform.

Let's remove this.

Review and decouple samples documentation

Problem description
A first-time user trying to understand and run Pravega should have a very smooth introduction. It would be nice to provide in the initial README of pravega-samples only the basic information to download and install the samples (+pravega). Then, we can create a high-level roadmap for first time users with short descriptions and links to the different existing subfolder READMEs, according to their degree of complexity.

Moreover, it may be of great help to review and unify all the documentation related with a set of samples in a single README (e.g., the main README talks about flink samples, but there is another README devoted to flink examples in the flink folder). This may be useful not only to first-time users, but also to our development team to keep updated samples in a simplified fashion.

Problem location
Documentation (all README files in this repository).

Suggestions for an improvement
Review, improve and decouple documentation according to the new organization of the repository.

flink word count sample

Develop word count sample using flink connectors

  • writer: read from socket and write to pravega stream
  • reader: read from pravega stream and print word counts
  • readme to run as standalone, with flink cluster, and upload on flink UI

Align with flink-connectors

The master branch of flink connectors will soon be based on flink-1.4 and with pravega master. Since the samples here rely on the connector, we must make a change.

turbineSensor throws occasional NPE

I see this message occasionally:

java.lang.NullPointerException
        at io.pravega.example.iot.TurbineHeatSensor$SensorReader.run(TurbineHeatSensor.java:445)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

Upload of Snapshot Jar fails - from ./gradlew upload, and main method caused error via Nautilus UI

Using the fix #43, Build is successful. However, the upload of the Snapshot fails. I already edited the location of the Nautilus node as 10.240.124.23 in the gradle.properties. . So that shouldn't be the issue.
Via Nautilus UI too (via App -> Artifacts upload), it fails due to "Main method caused error".
Please see more details here:
C:\Users\jains41\pravega-samples>gradlew upload
:anomaly-detection:compileJava UP-TO-DATE
:anomaly-detection:processResources UP-TO-DATE
:anomaly-detection:classes UP-TO-DATE
:anomaly-detection:jar UP-TO-DATE
:anomaly-detection:shadowJar UP-TO-DATE
:anomaly-detection:startScripts UP-TO-DATE
:anomaly-detection:installDist UP-TO-DATE
:anomaly-detection:upload FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':anomaly-detection:upload'.

A problem occurred starting process 'command 'rsync''

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.424 secs

C:\Users\jains41\pravega-samples>

and here:
org.apache.flink.client.program.ProgramInvocationException: The main method caused an error.
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:545)
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:419)
at org.apache.flink.client.program.OptimizerPlanEnvironment.getOptimizedPlan(OptimizerPlanEnvironment.java:80)
at org.apache.flink.client.program.ClusterClient.getOptimizedPlan(ClusterClient.java:318)
at org.apache.flink.runtime.webmonitor.handlers.JarActionHandler.getJobGraphAndClassLoader(JarActionHandler.java:72)
at org.apache.flink.runtime.webmonitor.handlers.JarRunHandler.handleJsonRequest(JarRunHandler.java:61)
at org.apache.flink.runtime.webmonitor.handlers.AbstractJsonRequestHandler.handleRequest(AbstractJsonRequestHandler.java:41)
at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandler.respondAsLeader(RuntimeMonitorHandler.java:109)
at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandlerBase.channelRead0(RuntimeMonitorHandlerBase.java:97)
at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandlerBase.channelRead0(RuntimeMonitorHandlerBase.java:44)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
at io.netty.handler.codec.http.router.Handler.routed(Handler.java:62)
at io.netty.handler.codec.http.router.DualAbstractHandler.channelRead0(DualAbstractHandler.java:57)
at io.netty.handler.codec.http.router.DualAbstractHandler.channelRead0(DualAbstractHandler.java:20)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
at org.apache.flink.runtime.webmonitor.HttpRequestHandler.channelRead0(HttpRequestHandler.java:159)
at org.apache.flink.runtime.webmonitor.HttpRequestHandler.channelRead0(HttpRequestHandler.java:65)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:147)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: io.pravega.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: Transport closed for unknown reason

Update default Pravega endpoint for Flink examples

Problem:
The Flink examples are using a custom/hardcoded Pravega endpoint.

Suggested fix:
Use localhost, consistent with standalone-examples.
Please also check the anomaly-detection sample for consistency.

Channel not shutdown correctly in turbineSensor app

I see the following error when running the standalone turbineSensor app:

SEVERE: *~*~*~ Channel io.grpc.internal.ManagedChannelImpl-27 for target tcp://pravega-controller.pravega.svc.cluster.local:9090 was not shutdown properly!!! ~*~*~*
    Make sure to call shutdown()/shutdownNow() and awaitTermination().
java.lang.RuntimeException: ManagedChannel allocation site
        at io.grpc.internal.ManagedChannelImpl$ManagedChannelReference.<init>(ManagedChannelImpl.java:1007)
        at io.grpc.internal.ManagedChannelImpl.<init>(ManagedChannelImpl.java:430)
        at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:337)
        at io.pravega.client.stream.impl.ControllerImpl.<init>(ControllerImpl.java:164)
        at io.pravega.client.stream.impl.ControllerImpl.<init>(ControllerImpl.java:123)
        at io.pravega.client.ClientFactory.withScope(ClientFactory.java:78)
        at io.pravega.client.ClientFactory.withScope(ClientFactory.java:65)
        at io.pravega.example.iot.TurbineHeatSensor.main(TurbineHeatSensor.java:119)

`./gradlew installDist` hit `Could not find io.pravega:hadoop-connectors:0.3.0-SNPASHOT

...
FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all dependencies for configuration ':hadoop-examples:compileClasspath'.

Could not find io.pravega:hadoop-connectors:0.3.0-SNAPSHOT.
Searched in the following locations:
file:/home/hyin/.m2/repository/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/maven-metadata.xml
file:/home/hyin/.m2/repository/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.pom
file:/home/hyin/.m2/repository/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.jar
https://jcenter.bintray.com/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/maven-metadata.xml
https://jcenter.bintray.com/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.pom
https://jcenter.bintray.com/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.jar
https://repo1.maven.org/maven2/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/maven-metadata.xml
https://repo1.maven.org/maven2/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.pom
https://repo1.maven.org/maven2/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.jar
https://repository.apache.org/snapshots/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/maven-metadata.xml
https://repository.apache.org/snapshots/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.pom
https://repository.apache.org/snapshots/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.jar
https://oss.sonatype.org/content/repositories/snapshots/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/maven-metadata.xml
https://oss.sonatype.org/content/repositories/snapshots/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.pom
https://oss.sonatype.org/content/repositories/snapshots/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.jar
https://oss.jfrog.org/artifactory/jfrog-dependencies/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/maven-metadata.xml
https://oss.jfrog.org/artifactory/jfrog-dependencies/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.pom
https://oss.jfrog.org/artifactory/jfrog-dependencies/io/pravega/hadoop-connectors/0.3.0-SNAPSHOT/hadoop-connectors-0.3.0-SNAPSHOT.jar
Required by:
project :hadoop-examples

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Test and style check for pravega samples

Problem description
Currently, there is no testing or checking mechanism to show if samples have been affected by a change in a Pravega release. Moreover, now the repository does not have a style checker as in pravega repository. It would be necessary to introduce both mechanisms, especially considering an increasing number of sample applications.

Problem location
Testing and style checker as a gradle task.

Suggestions for an improvement
Introduce testing and style checker.

Set the Logging level into WARNING

When user runs sample apps, there are too many not useful information on the console. which makes it difficult for users to know whether their app is running or not.

Suggestion from pravega/pravega#1226

You can change the log level under config/logback.xml to say WARN. Even that won't solve entirely the problem, we have been working on fine-tuning the log, e.g., there are some pretty obscure stack traces that come up all the time. We are working on it, though.

flink alert demo

The sample will

  • stream apache access logs to pravega using pravega logstash output plugin
  • process the stream and generate alerts when there are more than x number of 500 responses in a time window
  • provide a docker image for easy setup of the end to end environment

Problem finding logback.xml in Pravega example applications

Problem description
After executing ./gradlew installDist, running in a terminal any of the generated executable example applications prints the following exception:

Failed to auto configure default logger context
Reported exception:
ch.qos.logback.core.joran.spi.JoranException: Could not open URL [file:conf/logback.xml].
	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:57)
	at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
	at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
	at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
	at io.pravega.client.ClientConfig.<clinit>(ClientConfig.java:32)
	at io.pravega.client.ClientFactory.withScope(ClientFactory.java:65)
	at io.pravega.example.statesynchronizer.SharedConfigCli.<init>(SharedConfigCli.java:66)
	at io.pravega.example.statesynchronizer.SharedConfigCli.main(SharedConfigCli.java:385)
Caused by: java.io.FileNotFoundException: conf/logback.xml (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at java.io.FileInputStream.<init>(FileInputStream.java:93)
	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:52)
	... 13 more

Despite the user can proceed with the example application, the error behind this exception should be solved. In my setting, this does not happen when applications are executed via the IDE (IntelliJ).

Problem location
This is probably due to a bad configuration of logfile.xml location when gradle builds the executable files.

Suggestions for an improvement
Proper configuration of logback.xml when gradle creates the executable files.

pravega-samples: error: scala.reflect.internal.MissingRequirementError

bash-3.2$ ./gradlew installDist

Task :flink-examples:compileScala
error: scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
at scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:102)
at scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:105)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:257)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:257)
at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1390)
at scala.tools.nsc.Global$Run.(Global.scala:1242)
at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
at scala.tools.nsc.Driver.process(Driver.scala:51)
at scala.tools.nsc.Main.process(Main.scala)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at sbt.compiler.RawCompiler.apply(RawCompiler.scala:33)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:159)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:155)
at sbt.IO$.withTemporaryDirectory(IO.scala:358)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:155)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:152)
at sbt.IO$.withTemporaryDirectory(IO.scala:358)
at sbt.compiler.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:152)
at sbt.compiler.IC$.compileInterfaceJar(IncrementalCompiler.scala:58)
at sbt.compiler.IC.compileInterfaceJar(IncrementalCompiler.scala)
at org.gradle.api.internal.tasks.scala.ZincScalaCompilerFactory.getCompilerInterface(ZincScalaCompilerFactory.java:119)
at org.gradle.api.internal.tasks.scala.ZincScalaCompilerFactory.access$200(ZincScalaCompilerFactory.java:48)
at org.gradle.api.internal.tasks.scala.ZincScalaCompilerFactory$2.apply(ZincScalaCompilerFactory.java:90)
at org.gradle.api.internal.tasks.scala.ZincScalaCompilerFactory$2.apply(ZincScalaCompilerFactory.java:87)
at com.typesafe.zinc.Cache.get(Cache.scala:41)
at org.gradle.api.internal.tasks.scala.ZincScalaCompilerFactory.createCompiler(ZincScalaCompilerFactory.java:87)
at org.gradle.api.internal.tasks.scala.ZincScalaCompilerFactory.access$100(ZincScalaCompilerFactory.java:48)
at org.gradle.api.internal.tasks.scala.ZincScalaCompilerFactory$1.create(ZincScalaCompilerFactory.java:76)
at org.gradle.api.internal.tasks.scala.ZincScalaCompilerFactory$1.create(ZincScalaCompilerFactory.java:72)
at org.gradle.internal.SystemProperties.withSystemProperty(SystemProperties.java:141)
at org.gradle.api.internal.tasks.scala.ZincScalaCompilerFactory.createParallelSafeCompiler(ZincScalaCompilerFactory.java:72)
at org.gradle.api.internal.tasks.scala.ZincScalaCompiler$Compiler.execute(ZincScalaCompiler.java:64)
at org.gradle.api.internal.tasks.scala.ZincScalaCompiler.execute(ZincScalaCompiler.java:52)
at org.gradle.api.internal.tasks.scala.ZincScalaCompiler.execute(ZincScalaCompiler.java:38)
at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerRunnable.run(AbstractDaemonCompiler.java:87)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:36)
at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:46)
at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:30)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:100)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:146)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:128)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.base/java.lang.Thread.run(Thread.java:844)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':flink-examples:compileScala'.

org.gradle.internal.serialize.PlaceholderException (no error message)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 37s
8 actionable tasks: 8 executed
bash-3.2$

Streamcuts samples targeting develop branch

Problem description
The streamcuts example (PR #80) has been committed to master instead of develop.

Problem location
master branch.

Suggestions for an improvement
Apply this PR #80 to develop branch.

Change samples to use UTF8StringSerializer

Currently, events that consist of strings are serialized in Pravega using JavaSerializer. This is not ideal because 1) it is difficult to use in non-Java environments, 2) it adds unnecessary framing, and 3) it uses inefficient UTF-16 encoding.

A new commit has been added to Pravega to provide a UTF-8 serializer (pravega/pravega@78c5ade)

All samples that currently use JavaSerializer should be converted to use UTF8StringSerializer to demonstrate this best practice. Note that this is a breaking change as JavaSerializer is a different encoding than UTF-8.

For more information on why UTF-8 is preferred over UTF-16: http://utf8everywhere.org/

Complete community profile of pravega-samples repository

Problem description
pravega-samples repository does not have "code of conduct", "contributing", "issue templates" and "pull request templates". While the "contributing" page is expected to be added after the reorganization of this repository, the rest of them may be simply borrowed from pravega repository. This could make issue/PR management easier and more standard in pravega-samples.

Problem location
pravega-samples repository configuration.

Suggestions for an improvement
Add community profile items.

Reorganize repository structure

Problem description
Currently, the repository lacks from a clear structure that distinguishes between components (standalone, flink, hadoop), features (state synchronizer) and scenarios (IoT, anomaly detection).

Problem location
Repository structure.

Suggestions for an improvement
Reorganize the repository structure in a way that can be cleanly extended with potentially diverse types of examples.

Improve comments in pravega-samples code

Problem description
Sample applications comments should not be as technical and concise as in the main project's code; that is, adding a couple of comment lines in a class/method explaining an important concept (i.e., StreamCut, ReaderGroup) before describing what the code does may be a good idea.

Problem location
Samples code (comments).

Suggestions for an improvement
Review if existing samples lack from comments and improve them.

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.