Vihang Karajgaonkar has uploaded this change for review. ( http://gerrit.cloudera.org:8080/16030
Change subject: IMPALA-9824: MetastoreClientPool should be singleton ...................................................................... IMPALA-9824: MetastoreClientPool should be singleton This patch is a refactor-only patch. It changes the MetastoreClientPool into process wide singleton object. Currently, it is possible to instantiate multiple MetastoreClientPool although it doesn't seem to be a problem since all the places which instantiate it happen to run in separate processes. It would be better to enforce this in code. Making MetastoreClientPool a singleton also makes it easier to access from anywhere in the code without the need to explicitly pass its reference around which complicates the code flow unnecessarily. Note that one side-effect of this patch is that number of initial clients that the pool instantiates is controlled using a configuration num_metadata_loading_threads which defaults to 16 instead of current default size of 10 in Catalog. Alternatively, we can introduce a separate config, but given that any metadata load operation needs a HMS client, we might be better off creating the clients same as num_metadata_loading_threads. Testing: 1. No new tests were added since this was mostly a refactor-only patch. 2. [WIP] Ran existing core tests. Change-Id: I5477cba68b9053dfae8e7ed785f4d7519c12cd0f --- M fe/src/main/java/org/apache/impala/catalog/Catalog.java M fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java M fe/src/main/java/org/apache/impala/catalog/MetaStoreClientPool.java M fe/src/main/java/org/apache/impala/catalog/local/DirectMetaProvider.java M fe/src/main/java/org/apache/impala/service/Frontend.java M fe/src/main/java/org/apache/impala/service/JniCatalog.java M fe/src/test/java/org/apache/impala/catalog/events/MetastoreEventsProcessorTest.java M fe/src/test/java/org/apache/impala/testutil/CatalogServiceTestCatalog.java 8 files changed, 43 insertions(+), 23 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/30/16030/1 -- To view, visit http://gerrit.cloudera.org:8080/16030 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5477cba68b9053dfae8e7ed785f4d7519c12cd0f Gerrit-Change-Number: 16030 Gerrit-PatchSet: 1 Gerrit-Owner: Vihang Karajgaonkar <[email protected]>
