In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what is the data model of the database". The content of the explanation is simple and clear, and it is easy to learn and understand. let's follow the editor's train of thought to study and learn "what is the data model of the database"!
Data model (Data Model)
Storm uses tuple as its data model. Each tuple is a pile of values, each value has a name, and each value can be of any type. In my understanding, a tuple can be seen as a java object with no methods. Overall, storm supports all basic types, strings, and byte arrays as value class types for tuple. You can also use your own defined types as value types, as long as you implement the corresponding serializer (serializer).
Each node in the topology must define each field of the tuple it wants to emit. For example, the following bolt defines that the tuple emitted by its lock contains two fields of type doble and triple.
Publicclass DoubleAndTripleBolt implements IRichBolt {private OutputCollectorBase _ collector; @ Override
Publicvoid prepare (Map conf, TopologyContext context, OutputCollectorBase collector) {
_ collector = collector;}
@ Override
Publicvoid execute (Tuple input) {int val = input.getInteger (0)
_ collector.emit (input, new Values (val*2, val*3)); _ collector.ack (input);}
@ Override
Publicvoid cleanup () {}
@ Override
Publicvoid declareOutputFields (OutputFieldsDeclarer declarer) {
Declarer.declare (new Fields ("double", "triple");}}
The declareOutputFields method defines the fields to output: ["double", "triple"]. We'll explain the rest of this bolt later.
Thank you for your reading. the above is the content of "what is the data model of the database". After the study of this article, I believe you have a deeper understanding of what the data model of the database is. The specific use of the situation also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.