Thanks Carlo Curino for the accurate review. Let me go in order.
1. Every process should have at most 1 connection open to the StateStore except for Router. It has 10. This is for performance and scalability reason of the Database. FederationInterceptor open one connection for each application running in the node. More than that can cause a possible DoS to StateStore.
5. When I do auto-format from eclipse by using hadoop-format.xml it gives me it in 2 lines.
7. We can improve/reduce the amount of code later under a different Jira. I am quite confident in this part and I would avoid to change it.
9. We can improve/reduce the amount of code later under a different Jira. I am quite confident in this part and I would avoid to change it.
10. That is a safe check, since admin's cluster can setup their own database.
2. I tried to move in a file but I am adding a lot of complexity and I did not find a way to let it work. I tried to format in SQL standard inside the file itself but the autoformat messes it up.
4. Fixed it - good catch.
5. In that way I only insert a new application. That code is like if (! app exists) add app.
3. Increased to 6000.
4. My bad, it was a for a performance test - introduced in the patch by mistake.
5. We can DEREGISTER it or put it in a LOST state.
6. We did not run in any issues with those settings. I would keep like this.
7. Let's open a JIRA about it.
9. Increase to 6000.
10. As I said before, let's keep this one since we have one stored procedure for each function. We can reduce/improve later.
Top level concerns:
1. The current design was not edited over the last year. However in case we need to evolve the schema we will need to add them.
2. This cannot happen because we have input validators.
3. For that scenario, we have to add only the stored procedure for the specific database.
4. I edited some tests to cover some scenario we did not check. However, the current state covers all the possible scenarios.