What are the Bolt interface methods?
This article mainly explains "what are the Bolt interface methods". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn what Bolt interface methods are.
The prepare method is called when worker initializes the task.
The execute method is called every time a tuple comes in
Cleanup is actually only used in local mode (local mode), and it is difficult to ensure that this method is executed correctly every time in cluster mode (cluster mode).
The declearOutputFields method is used to determine the format of the output content stream only when a new topology is submitted to the server (equivalent to defining the name:value format for transferring stream between spout/bolt), and is not called during topology execution.
Thank you for reading, the above is the content of "what is the Bolt interface method?" after the study of this article, I believe you have a deeper understanding of what the Bolt interface method has, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!