Code samples for Hazelcast Jet, using both jet-core and java.util.stream APIs.
-
Access Log Analyzer (access-log-analyzer)
Analyzes access log files from an HTTP server. Demonstrates the usage of reading from files and writing results to another file.
-
Co-Grouping (cogroup-operator)
A sample demonstrating the implementation of CoGroup processor. The processor does a full outer join on two sources by a given key demonstrating a many-to-many relationship.
-
Data Enrichment (enrichment)
This sample shows how to enrich batch or stream of items with additional information by matching them by key.
-
Hazelcast Connectors (hazelcast-connectors)
An example that shows how to read from and write to Hazelcast IList, IMap and ICache data structures.
-
java.util.stream API (java.util.stream)
An example that shows how to sort and filter the data residing in Hazelcast IMap using java.util.stream API.
-
Dumping data from Hazelcast IMap (map-dump)
This example does a distributed dump of the contents of a Hazelcast IMap into several files and illustrates how a simple distributed sink can be implemented.
-
Migrating from Hazelcat MapReduce (mapreduce-migration)
This project shows how a word-count implementation in Hazelcast MapReduce can be implemented in Hazelcast Jet.
-
Prime Number Finder (prime-finder)
This example finds the prime numbers up to a certain number and writes the output to a Hazelcast IList. A distributed number generator is used to distribute the numbers across the processors. This example is mostly aimed at illustrating how a custom partitioning at the source can be achieved using the ProcessorMetaSupplier API.
-
TF-IDF Calculation (tf-idf)
This example builds, for a given set of text documents, an inverted index that maps each word to the set of documents that contain it. Each document in the set is assigned a TF-IDF score which tells how relevant the document is to the search term.
-
Word-Count (wordcount-core-api)
Analyzes a set of documents and finds the number of occurrences of each word they contain.
-
Word-Count with Hadoop (wordcount-hadoop)
Analyzes a set of documents from HDFS and finds the number of occurrences of each word they contain and outputs that number to HDFS.
-
Word-Count with java.util.stream API (wordcount-j.u.s)
Analyzes a set of documents and finds the number of occurrences of each word they contain using the java.util.stream API.
-
Access Stream Analyzer (access-stream-analyzer)
Analyzes access log files from an HTTP server. Demonstrates reading files line by line in streaming fashion - by running indefinitely and watching for changes as they appear. It uses sliding window aggregation to output frequency of visits to each page continuously.
-
Kafka Consumer Example (kafka)
A sample which does a distributed read from two Kafka topics and writes to a Hazelcast IMap.
-
Session Window Aggregation (session-windows)
A sample demonstrating the use of session windows to track the behavior of the users of an online shop application.
-
Socket Producer and Consumer (socket)
This project contains examples showing how to consume from and produce to sockets.
-
Stock Exchange Simulation (stock-exchange)
A simple demonstration of Jet's continuous operators on an infinite stream. Initially a Hazelcast IMap is populated with some stock ticker names; the job reads the map and feeds the data to the vertex that simulates an event stream coming from a stock market. The job then computes the number of trades per ticker within a sliding window of a given duration and dumps the results to a set of files.
-
Finding Top-N Stocks (top-n-stocks)
This sample shows how to nest accumulations. It first calculates the linear trend for each stock, then finds the top 5 stocks with the highest price growth and top 5 stocks with the highest price drop.
Hazelcast is available under the Apache 2 License. Please see the Licensing section for more information.
Copyright (c) 2008-2017, Hazelcast, Inc. All Rights Reserved.
Visit www.hazelcast.com for more info.