In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
The background framework application introduced in the previous article about improving efficiency now introduces the specific functions of the plug-ins. This article uses a specific plug-in to explain in detail, and selects the plug-in "filter" to explain the specific functions in detail. And the direction of the framework data flow to the filtering plug-in is as follows:
The "filter record 22" is a typical filter judgment function. If the previously passed content is judged to be successful in the plug-in, the next step is the "login and user information" plug-in, and if it fails, go to the "CacheGet" plug-in.
Click the plug-in to display the configuration interface:
Among them, step name is configured with the name displayed in the interface, so just enter a recognizable name.
Send 'true' data to step: configure the next action plug-in when the the condition conditions are met.
Send 'false' data to step: is the next step if the condition is not met.
The condition is configured with condition expressions (all visual processing) plug-in description:
There are a variety of plug-ins, some plug-ins do not add data and delete data after execution, just as a distribution judgment operation such as filtering plug-in, just judge and give it to the next plug-in.
Some plug-ins are responsible for reading database data, some plug-ins are responsible for modifying the incoming data, etc., in short, there are many plug-ins, there are not one by one described here, interested people can contact me, you can also refer to the Kettle plug-in.
Data flow of the plug-in:
When Java calls the configured graphical transformation plug-in, you only need to know the INPUT plug-in entry, such as:
Here, we need to pass in three parameters and the corresponding values, which can be in the following format {"username": ", password:", valicode: "}, or other formats, as long as the data is acceptable to the INPUT plug-in when it is written. Generally, the simpler the better (you don't like complex code after writing code for a long time).
When the code is running, the running controller (KtrController) is called, and the parameter value is passed in. After running, the controller first passes in the first plug-in (INPUT). After running INPUT, the INPUT outputs the parameters (field, corresponding value), and the controller passes the parameters to the second plug-in. If the second plug-in is a filtering plug-in, if the filter plug-in is judged to be completed, if it is judged to be true The controller is distributed to the plug-in corresponding to the Send 'true' data to step configured by the filter plug-in, and vice versa to the plug-in corresponding to Send' false' data to step.
According to this rule, run it step by step until the last plug-in has no corresponding next plug-in deadline, and the output is returned after the run is completed.
Usually we need to set some constants for later judgment, which is what the "add constant" plug-in does:
Later, if you use the "filter" plug-in to determine whether the user name or password meets the conditions and whether it is not empty, you need to output the corresponding content according to the filtering situation. You can select it through the "Select" plug-in, as shown in the following figure:
Set and select the content field that needs to be output, and modify it to the desired name. For example, the output json of the above configuration is roughly as follows: {result:true,msg: "user name does not exist!"} to see if it is very simple. For example, the json is generally output from the request data in the api API.
The next article will describe in detail the specific use of plug-ins and the logical implementation of the plug-in code, along with the corresponding source code.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.