forked from ExpediaGroup/waggle-dance
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add personalized configuration parameters for each metastore. (Expedi…
…aGroup#315) * Add personalized configuration parameters for each metastore. * Add personalized configuration parameters for each metastore * Recover * Update junit test * Update Junit Test * Update Junit Test * Update Junit Test * Format the code and update the readme * Revert * Update FederatedMetaStoreTest.java * Update PrimaryMetaStoreTest.java * Update AbstractMetaStore.java using new HashMap so the generated Yaml doesn't generate an anchor (reference &id001) * Update YamlFederatedMetaStoreStorageTest.java fixing test --------- Co-authored-by: yangyx <[email protected]> Co-authored-by: Patrick Duin <[email protected]>
- Loading branch information
1 parent
f0460f1
commit bcdd35e
Showing
8 changed files
with
43 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,6 +127,8 @@ Example: | |
- my_writable_db2 | ||
- user_db_.* | ||
- ... | ||
configuration-properties: | ||
hive.metastore.kerberos.principal: hive/[email protected] | ||
federated-meta-stores: # List of read only metastores to federate | ||
- remote-meta-store-uris: thrift://10.0.0.1:9083 | ||
name: secondary | ||
|
@@ -147,6 +149,8 @@ Example: | |
- database: prod_db2 | ||
mapped-tables: | ||
- tbl2 | ||
configuration-properties: | ||
hive.metastore.kerberos.principal: hive/[email protected] | ||
- ... | ||
|
||
The table below describes all the available configuration values for Waggle Dance federations: | ||
|
@@ -166,6 +170,7 @@ The table below describes all the available configuration values for Waggle Danc | |
| `primary-meta-store.mapped-tables` | No | List of mappings from databases to tables to federate from the primary metastore, similar to `mapped-databases`. By default, all tables are available. See `mapped-tables` configuration below. | | ||
| `primary-meta-stores.hive-metastore-filter-hook` | No | Name of the class which implements the `MetaStoreFilterHook` interface from Hive. This allows a metastore filter hook to be applied to the corresponding Hive metastore calls. Can be configured with the `configuration-properties` specified in the `waggle-dance-server.yml` configuration. They will be added in the HiveConf object that is given to the constructor of the `MetaStoreFilterHook` implementation you provide. | | ||
| `primary-meta-stores.database-name-mapping` | No | BiDirectional Map of database names and mapped name, where key=`<database name as known in the primary metastore>` and value=`<name that should be shown to a client>`. See the [Database Name Mapping](#database-name-mapping) section.| | ||
| `primary-meta-stores.configuration-properties` | No | Map of the primary metastore personalized properties that will be added to the HiveConf used when creating the Thrift clients (they will be effect only on this client),the priority is higher than the properites of the same name in waggle-dance-server.yml. | | ||
| `federated-meta-stores` | No | Possible empty list of read only federated metastores. | | ||
| `federated-meta-stores[n].remote-meta-store-uris` | Yes | Thrift URIs of the federated read-only metastore. | | ||
| `federated-meta-stores[n].name` | Yes | Name that uniquely identifies this metastore. Used internally. Cannot be empty. | | ||
|
@@ -178,6 +183,7 @@ The table below describes all the available configuration values for Waggle Danc | |
| `federated-meta-stores[n].hive-metastore-filter-hook` | No | Name of the class which implements the `MetaStoreFilterHook` interface from Hive. This allows a metastore filter hook to be applied to the corresponding Hive metastore calls. Can be configured with the `configuration-properties` specified in the `waggle-dance-server.yml` configuration. They will be added in the HiveConf object that is given to the constructor of the `MetaStoreFilterHook` implementation you provide. | | ||
| `federated-meta-stores[n].database-name-mapping` | No | BiDirectional Map of database names and mapped names where key=`<database name as known in the federated metastore>` and value=`<name that should be shown to a client>`. See the [Database Name Mapping](#database-name-mapping) section.| | ||
| `federated-meta-stores[n].writable-database-white-list` | No | White-list of databases used to verify write access used in conjunction with `federated-meta-stores[n].access-control-type`. The list of databases should be listed without a `federated-meta-stores[n].database-prefix`. This property supports both full database names and (case-insensitive) [Java RegEx patterns](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html).| | ||
| `federated-meta-stores[n].configuration-properties` | No | Map of the federate metastore personalized properties that will be added to the HiveConf used when creating the Thrift clients (they will be effect only on this client),the priority is higher than the properites of the same name in waggle-dance-server.yml. | | ||
|
||
#### Metastore tunnel | ||
The table below describes the metastore tunnel configuration values: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* Copyright (C) 2016-2021 Expedia, Inc. | ||
* Copyright (C) 2016-2024 Expedia, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -24,6 +24,7 @@ | |
|
||
import static com.hotels.bdp.waggledance.api.model.AbstractMetaStore.newFederatedInstance; | ||
|
||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.concurrent.TimeUnit; | ||
|
@@ -38,6 +39,7 @@ | |
import org.mockito.junit.MockitoJUnitRunner; | ||
|
||
import com.hotels.bdp.waggledance.api.model.AbstractMetaStore; | ||
import com.hotels.bdp.waggledance.api.model.FederatedMetaStore; | ||
import com.hotels.bdp.waggledance.client.tunnelling.TunnelingMetaStoreClientFactory; | ||
import com.hotels.bdp.waggledance.conf.WaggleDanceConfiguration; | ||
import com.hotels.hcommon.hive.metastore.client.tunnelling.MetastoreTunnel; | ||
|
@@ -68,8 +70,9 @@ public void setUp() { | |
@Test | ||
public void defaultFactory() { | ||
ArgumentCaptor<HiveConf> hiveConfCaptor = ArgumentCaptor.forClass(HiveConf.class); | ||
|
||
factory.newInstance(newFederatedInstance("fed1", THRIFT_URI)); | ||
FederatedMetaStore fed1 = newFederatedInstance("fed1", THRIFT_URI); | ||
fed1.setConfigurationProperties(Collections.singletonMap(ConfVars.METASTORE_KERBEROS_PRINCIPAL.varname, "hive/[email protected]")); | ||
factory.newInstance(fed1); | ||
verify(defaultMetaStoreClientFactory).newInstance(hiveConfCaptor.capture(), eq( | ||
"waggledance-fed1"), eq(3), eq(2000)); | ||
verifyNoInteractions(tunnelingMetaStoreClientFactory); | ||
|
@@ -80,6 +83,7 @@ public void defaultFactory() { | |
assertThat(hiveConf.getTimeVar(ConfVars.METASTORE_CLIENT_CONNECT_RETRY_DELAY, TimeUnit.SECONDS), is(5L)); | ||
assertThat(hiveConf.getBoolVar(ConfVars.METASTORE_USE_THRIFT_FRAMED_TRANSPORT), is(true)); | ||
assertThat(hiveConf.getBoolVar(ConfVars.METASTORE_USE_THRIFT_COMPACT_PROTOCOL), is(false)); | ||
assertThat(hiveConf.getVar(ConfVars.METASTORE_KERBEROS_PRINCIPAL), is("hive/[email protected]")); | ||
} | ||
|
||
@Test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters