In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to modify the report with JAVA custom class and restart the application? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.
This is determined by JAVA compiled language features, and it is normal to modify JAVA programs and restart applications. Just change the report will restart the entire application is a bit of an exaggeration, the report changes more frequently, restart the application every time will affect the business.
The root cause of this problem is the coupling problem. Once the JAVA code is involved in the report, it will be packaged and deployed with the main application, that is, coupled, so it is impossible to modify the report to take effect in real time (hot swap), so the idea to solve this problem is to decouple the report and the main application.
Generally speaking, the use of JAVA coding in reports is mainly for the following reasons:
1. Data calculation involves complex process and logic control.
The calculation involved in preparing data for the report is too complex, or more complex logic control is required, which is not easy to achieve through SQL and can only be hard-coded by JAVA.
2. Involving diverse data sources
Reports come from a variety of data sources. When it comes to NoSQL, text, XML, Hadoop, time series database, Webservice and other data sources, report tools can not achieve mixed calculation, so it is necessary to use JAVA to prepare report data.
3. Easy to apply and expand
Future business growth requires horizontal expansion (split) of applications. The use of SQL is not conducive to future sub-libraries, and report data calculation can only be realized with JAVA.
4. For management
In order to manage the needs, it is sometimes necessary to record the report visitors, the number of report queries, the data queried each time and other information, which can be realized by writing a listening class in JAVA.
From this point of view, it is not easy to decouple report modules, and it is best to directly use report tools with these capabilities:
1. Strong complex computing ability, can complete more complex operations, but also easy to achieve logical control
two。 Multiple data sources support, preferably mixed computing, such as CSV and DB to do join
3. The calculation does not depend on the database, so it is easy to expand.
4. Hot switching is supported. You don't have to restart the application to modify the report.
You can take a look at how to reduce the coupling of the report application, introduce how to use the report tool to decouple the report from the main application, and draw a picture to feel it:
The original JAVA program tightly tied the report and the main application together, but now the report module can be split and maintained separately, interpretation and execution can be hot switched, and it is not necessary to restart the whole application to modify the report. You can even deploy report templates separately to physically separate them.
For the tool's support for complex computing, you can refer to how to deal with complex logic in report development.
Reference for support for diverse data sources using diverse data sources directly in reports
This is the answer to how to modify the report with JAVA custom class and restart the application to solve the problem. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel for more related knowledge.
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.