public static void main(String[] args) {
    CommandLine cmdLine = new CommandLine();
    Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
    PageViewCounterExample app = new PageViewCounterExample();
    ApplicationRunner runner = ApplicationRunners.getApplicationRunner(app, config);
    runner.run();
    runner.waitForFinish();
  }
Example code to implement window-based counter
samza-test/src/main/java/org/apache/samza/example/PageViewCounterExample.java