public class AccessLogStreamAnalyzer extends Object
Sources.fileWatcher(String)
(String, Charset, String)} to read
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.
This analyzer could be run on a Jet cluster deployed on the same machines as those forming the web server cluster. This way each instance will process local files locally and subsequently merge the results globally.
This sample does not work well on Windows. On Windows, even though new lines are flushed, WatchService is not notified of changes, until the file is closed.
Constructor and Description |
---|
AccessLogStreamAnalyzer() |
Copyright © 2020 Hazelcast, Inc.. All rights reserved.