- Mastering Apache Storm
- Ankit Jain
- 214字
- 2021-07-02 20:32:27
The Storm data model
The basic unit of data that can be processed by a Storm application is called a tuple. Each tuple consists of a predefined list of fields. The value of each field can be a byte, char, integer, long, float, double, Boolean, or byte array. Storm also provides an API to define your own datatypes, which can be serialized as fields in a tuple.
A tuple is dynamically typed, that is, you just need to define the names of the fields in a tuple and not their datatype. The choice of dynamic typing helps to simplify the API and makes it easy to use. Also, since a processing unit in Storm can process multiple types of tuples, it's not practical to declare field types.
Each of the fields in a tuple can be accessed by its name, getValueByField(String), or its positional index, getValue(int), in the tuple. Tuples also provide convenient methods such as getIntegerByField(String) that save you from typecasting the objects. For example, if you have a Fraction (numerator, denominator) tuple, representing fractional numbers, then you can get the value of the numerator by either using getIntegerByField("numerator") or getInteger(0).
You can see the full set of operations supported by org.apache.storm.tuple.Tuple in the Java doc that is located at https://storm.apache.org/releases/1.0.2/javadocs/org/apache/storm/tuple/Tuple.html.
- Flask Blueprints
- CockroachDB權(quán)威指南
- 單片機(jī)C語(yǔ)言程序設(shè)計(jì)實(shí)訓(xùn)100例:基于STC8051+Proteus仿真與實(shí)戰(zhàn)
- 跟小海龜學(xué)Python
- Apache Hive Essentials
- PySide GUI Application Development(Second Edition)
- 微信小程序入門指南
- BIM概論及Revit精講
- C語(yǔ)言程序設(shè)計(jì)
- Learning R for Geospatial Analysis
- Scratch3.0趣味編程動(dòng)手玩:比賽訓(xùn)練營(yíng)
- 匯編語(yǔ)言編程基礎(chǔ):基于LoongArch
- C語(yǔ)言程序設(shè)計(jì)實(shí)踐
- 深入淺出Python數(shù)據(jù)分析
- Learning Concurrency in Python