Code Samples for Hazelcast Jet. For the development version samples use master branch
Java Other
Clone or download

README.md

Hazelcast Jet Code Samples

A repository of code samples for Hazelcast Jet. It covers the high-level APIs (pipelines and java.util.stream) as well as the lower-level Core API. This is the basic layout of the directories:

  1. batch: batch jobs with high-level APIs
  2. streaming: streaming jobs with high-level APIs
  3. pcf: a sample application on the Pivotal Cloud Foundry infrastructure
  4. core-api/batch: batch jobs with the Core API
  5. core-api/streaming: streaming jobs with the Core API
  6. sample-data: a module containing the sample data shared by several samples
  7. refman: code snippets used in the Reference Manual

Batch Jobs

  • Access Log Analyzer

    Analyzes access log files from an HTTP server. Demonstrates the usage of file sources and sinks.

  • Batch Enrichment

    This sample shows, how to enrich batch of items with additional information by matching them by key

  • Co-Group Transform

    Uses the co-group transform to perform a full outer join of three streams on a common join key (a many-to-many relationship).

  • Custom Sink Builder

    Demonstrates implementation of a Hazelcast ITopic sink with a sample which does text filtering on the books with the Pipeline API.

  • Hazelcast Connectors

    Demonstrates the usage of Hazelcast IMap, ICache and IList as data sources and sinks.

  • java.util.stream API Samples

    Several basic samples using the java.util.stream API.

  • Inverted Index with TF-IDF Scoring

    The sample builds an inverted index on a corpus of about a 100 MB of book material and then presents you with a GUI dialog where you can enter your search terms. The GUI poignantly demonstrates the speed of the search by instantly responding to every keystroke and displaying a result list.

  • Word Count

    Analyzes a set of documents and finds the number of occurrences of each word they contain.

  • Word Count with HDFS

    A Word Count job with the Hadoop File System as both source and sink.

Streaming Jobs

  • Access Stream Analyzer

    Shows how to use the File Watcher streaming source. It continuously monitors HTTP access log files for new content and applies a sliding window aggregation that tracks the frequency of visits to each page.

  • Fault Tolerance

    Illustrates the effects of different processing guarantees that a Jet job can be configured with a simple application which uses Jet with the event journal reader for to perform rolling average calculations and illustrates the differences in processing guarantees.

  • Job-Management

    Demonstrates Jet's job management capabilities with job submission, job tracking and scaling-up.

  • Kafka Source

    Demonstrates the usage of a Kafka topic as a Jet data source. Pours the data from a Kafka topic to a Hazelcast IMap.

  • Map & Cache Event Journal Source

    Consumes and filters events generated from Hazelcast IMap's and ICache's Event Journal.

  • Session Window Aggregation

    Demonstrates the session window vertex to track the behavior of the users of an online shop application.

  • Socket Connector

    Two code samples showing the usage of a TCP/IP socket as a source and a sink.

  • Stock Exchange Simulation

    A simple demonstration of Jet's sliding window aggregation on an infinite stream

  • Data Enrichment Using Hash-Join

    Uses the hash-join transform to enrich an infinite stream of trade events. Attaches to each event the associated product and broker objects.

  • Finding Top-N Stocks

    Demonstrates cascaded sliding windows where the second one's source is the output of the first one. The first one calculates the frequency of trading each stock and the second one finds the hottest-trading stocks.

  • Windowed Co-Group

    Uses the co-group transform to perform a full outer join of three streams on a common join key (a many-to-many relationship)

Spring Integration

The directory spring contains a sample project which shows how to integrate Hazelcast Jet with Spring.

Pivotal Cloud Foundry

The directory pcf contains a sample Spring Boot application which shows how to use Hazelcast Jet in Pivotal Cloud Foundry environment.

Core API

Refer to the core-api readme for details on its contents.

License

Hazelcast is available under the Apache 2 License. Please see the Licensing section for more information.

Copyright

Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.

Visit www.hazelcast.com for more info.