官术网_书友最值得收藏!

  • Learning Apache Apex
  • Thomas Weise Munagala V. Ramanath David Yan Kenneth Knowles
  • 268字
  • 2021-07-02 22:38:37

Apex DAG Java API

The low-level DAG API is defined by the Apex engine. Any application that runs on Apex, irrespective of the original specification format, will be translated into this API. It is sometimes also referred to as compositional, as it represents the logical DAG, which will be translated into a physical plan and mapped to the execution layer by the Apex runtime.

The following is the Word Count example application, briefly introduced in the Stream Processing section earlier written with the DAG API:

LineReader lineReader = dag.addOperator("input", new LineReader()); 
Parser parser = dag.addOperator("parser", new Parser()); 
UniqueCounter counter = dag.addOperator("counter", new UniqueCounter()); 
ConsoleOutputOperator cons = dag.addOperator("console", new 
ConsoleOutputOperator()); dag.addStream("lines", lineReader.output, parser.input); dag.addStream("words", parser.output, counter.data); dag.addStream("counts", counter.count, cons.input);

The developer implements a method that is provided with a DAG handle by the engine (in this case, dag) through which operators are added and then connected with streams.

As mentioned, the Apex library provides many prebuilt operators. Operators can also be custom and encapsulate use case specific logic, or they can come from a library of an organization to share reusable logic across applications.

The DAG API is referred to as low level because many aspects are explicit. The developer identifies the operators and is aware of the ports for stream connections. In the case of larger applications, the wiring code can become more challenging to navigate. At the same time, the DAG API offers the most flexibility to the developer and is often used in larger projects that typically involve significant operator development and customization and where the complexity of wiring the DAG is normally not a concern.

主站蜘蛛池模板: 榆中县| 津南区| 郓城县| 仪陇县| 阿尔山市| 新竹市| 龙门县| 清苑县| 阳西县| 新和县| 凤台县| 石棉县| 游戏| 河东区| 鲁山县| 会泽县| 西吉县| 凉山| 巴林右旗| 绥芬河市| 五莲县| 鄄城县| 盐城市| 睢宁县| 广昌县| 淳安县| 安平县| 金门县| 年辖:市辖区| 宁城县| 黄骅市| 清徐县| 东乡族自治县| 昔阳县| 广西| 化德县| 城固县| 郑州市| 吉林省| 砚山县| 衡东县|