You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "xunliu (via GitHub)" <gi...@apache.org> on 2024/08/23 06:58:14 UTC
[PR] [MINOR]: fix authorization ranger compile lib path [gravitino]
xunliu opened a new pull request, #4651:
URL: https://github.com/apache/gravitino/pull/4651
### What changes were proposed in this pull request?
Compile distribution authorization ranger using the error path.
### Why are the changes needed?
Doesn't copy authorization ranger library to `/distribution/package/libs`
Fix: # (issue)
### Does this PR introduce _any_ user-facing change?
N/A
### How was this patch tested?
CI
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1729077938
##########
LICENSE.bin:
##########
@@ -310,6 +310,8 @@
Apache Yetus - Audience Annotations
Apache Kerby
Apache Kyuubi
+ Apache Ranger
+ Apache Ranger intg
Review Comment:
OK
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730644394
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the "main" branch
+ push:
+ branches: [ "main", "branch-*" ]
+ pull_request:
+ branches: [ "main", "branch-*" ]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ changes:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ source_changes:
+ - .github/**
+ - api/**
+ - authorizations/**
+ - bin/**
+ - catalogs/**
+ - clients/client-java/**
+ - clients/client-java-runtime/**
+ - clients/filesystem-hadoop3/**
+ - clients/filesystem-hadoop3-runtime/**
+ - common/**
+ - conf/**
+ - core/**
+ - gradle/**
+ - integration-test-common/**
+ - iceberg/**
+ - meta/**
+ - server/**
+ - server-common/**
+ - trino-connector/**
+ - web/**
+ - build.gradle.kts
+ - gradle.properties
+ - gradlew
+ - setting.gradle.kts
+ outputs:
+ source_changes: ${{ steps.filter.outputs.source_changes }}
+
+ # Integration test for AMD64 architecture
+ test-amd64-arch:
+ needs: changes
+ if: needs.changes.outputs.source_changes == 'true'
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ strategy:
+ matrix:
+ # Integration test for AMD64 architecture
+ architecture: [linux/amd64]
+ java-version: [ 8, 11, 17 ]
+ test-mode: [ embedded, deploy ]
Review Comment:
Reduce to only use JDK-17 to test, Currently we only have two CI pipelines.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730748521
##########
catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/JdbcCatalogPropertiesMetadata.java:
##########
@@ -94,7 +95,11 @@ public class JdbcCatalogPropertiesMetadata extends BaseCatalogPropertiesMetadata
JdbcConfig.POOL_MAX_SIZE.getDefaultValue(),
true /* hidden */,
false /* reserved */));
- PROPERTIES_METADATA = Maps.uniqueIndex(propertyEntries, PropertyEntry::getName);
+ PROPERTIES_METADATA =
+ ImmutableMap.<String, PropertyEntry<?>>builder()
+ .putAll(BASIC_CATALOG_PROPERTY_ENTRIES)
+ .putAll(Maps.uniqueIndex(propertyEntries, PropertyEntry::getName))
+ .build();
Review Comment:
@yuqi1129 can you please check this part?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730628432
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the "main" branch
+ push:
+ branches: [ "main", "branch-*" ]
+ pull_request:
+ branches: [ "main", "branch-*" ]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ changes:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ source_changes:
+ - .github/**
+ - api/**
+ - authorizations/**
+ - bin/**
+ - catalogs/**
+ - clients/client-java/**
+ - clients/client-java-runtime/**
+ - clients/filesystem-hadoop3/**
+ - clients/filesystem-hadoop3-runtime/**
+ - common/**
+ - conf/**
+ - core/**
+ - gradle/**
+ - integration-test-common/**
+ - iceberg/**
+ - meta/**
+ - server/**
+ - server-common/**
+ - trino-connector/**
+ - web/**
+ - build.gradle.kts
+ - gradle.properties
+ - gradlew
+ - setting.gradle.kts
Review Comment:
OK
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730493414
##########
authorizations/authorization-ranger/build.gradle.kts:
##########
@@ -69,24 +75,34 @@ dependencies {
exclude("org.elasticsearch")
exclude("org.elasticsearch.client")
exclude("org.elasticsearch.plugin")
+ exclude("javax.ws.rs")
}
+ testImplementation(libs.javax.ws.rs.api)
Review Comment:
Fixed
##########
core/src/main/java/org/apache/gravitino/utils/IsolatedClassLoader.java:
##########
@@ -39,6 +39,11 @@
* controlled loading of classes from specified jars and shared classes from the base class loader.
*/
public class IsolatedClassLoader implements Closeable {
+ // Gravitino have two compound (catalog and authorization) types use isolated class loader
Review Comment:
Fixed
##########
core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java:
##########
@@ -181,53 +182,64 @@ public CatalogOperations ops() {
public AuthorizationPlugin getAuthorizationPlugin() {
if (authorization == null) {
- synchronized (this) {
- if (authorization == null) {
- BaseAuthorization<?> baseAuthorization = createAuthorizationPluginInstance();
- if (baseAuthorization == null) {
- return null;
- }
- authorization = baseAuthorization;
- }
- }
+ return null;
}
return authorization.plugin(provider(), this.conf);
}
- private BaseAuthorization<?> createAuthorizationPluginInstance() {
+ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
+ if (authorization != null) {
+ return;
+ }
+
String authorizationProvider =
catalogPropertiesMetadata().containsProperty(AUTHORIZATION_PROVIDER)
? (String) catalogPropertiesMetadata().getOrDefault(conf, AUTHORIZATION_PROVIDER)
: null;
if (authorizationProvider == null) {
LOG.info("Authorization provider is not set!");
- return null;
+ return;
}
- ServiceLoader<AuthorizationProvider> loader =
- ServiceLoader.load(
- AuthorizationProvider.class, Thread.currentThread().getContextClassLoader());
-
- List<Class<? extends AuthorizationProvider>> providers =
- Streams.stream(loader.iterator())
- .filter(p -> p.shortName().equalsIgnoreCase(authorizationProvider))
- .map(AuthorizationProvider::getClass)
- .collect(Collectors.toList());
- if (providers.isEmpty()) {
- throw new IllegalArgumentException(
- "No authorization provider found for: " + authorizationProvider);
- } else if (providers.size() > 1) {
- throw new IllegalArgumentException(
- "Multiple authorization providers found for: " + authorizationProvider);
- }
+ BaseAuthorization<?> baseAuthorization;
try {
- return (BaseAuthorization<?>)
- Iterables.getOnlyElement(providers).getDeclaredConstructor().newInstance();
+ baseAuthorization =
+ classLoader.withClassLoader(
+ cl -> {
+ try {
+ ServiceLoader<AuthorizationProvider> loader =
+ ServiceLoader.load(AuthorizationProvider.class, cl);
+
+ List<Class<? extends AuthorizationProvider>> providers =
+ Streams.stream(loader.iterator())
+ .filter(p -> p.shortName().equalsIgnoreCase(authorizationProvider))
+ .map(AuthorizationProvider::getClass)
+ .collect(Collectors.toList());
+ if (providers.isEmpty()) {
+ throw new IllegalArgumentException(
+ "No authorization provider found for: " + authorizationProvider);
+ } else if (providers.size() > 1) {
+ throw new IllegalArgumentException(
+ "Multiple authorization providers found for: " + authorizationProvider);
+ }
+ return (BaseAuthorization<?>)
+ Iterables.getOnlyElement(providers).getDeclaredConstructor().newInstance();
+ } catch (Exception e) {
+ LOG.error("Failed to create authorization instance", e);
+ throw new RuntimeException(e);
+ }
+ });
} catch (Exception e) {
- LOG.error("Failed to create authorization instance", e);
+ LOG.error("Failed to load authorization with class loader", e);
throw new RuntimeException(e);
}
+
+ if (baseAuthorization == null) {
Review Comment:
Removed these codes.
##########
authorizations/authorization-ranger/src/test/java/org/apache/gravitino/authorization/ranger/integration/test/RangerITEnv.java:
##########
@@ -50,16 +54,25 @@ public class RangerITEnv {
protected static final String RANGER_HDFS_REPO_NAME = "hdfsDev";
private static final String RANGER_HDFS_TYPE = "hdfs";
protected static RangerClient rangerClient;
-
+ private static volatile Boolean initRangerService = Boolean.FALSE;
Review Comment:
Fixed.
##########
core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java:
##########
@@ -181,53 +182,64 @@ public CatalogOperations ops() {
public AuthorizationPlugin getAuthorizationPlugin() {
if (authorization == null) {
- synchronized (this) {
- if (authorization == null) {
- BaseAuthorization<?> baseAuthorization = createAuthorizationPluginInstance();
- if (baseAuthorization == null) {
- return null;
- }
- authorization = baseAuthorization;
- }
- }
+ return null;
}
return authorization.plugin(provider(), this.conf);
}
- private BaseAuthorization<?> createAuthorizationPluginInstance() {
+ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
+ if (authorization != null) {
+ return;
+ }
+
String authorizationProvider =
catalogPropertiesMetadata().containsProperty(AUTHORIZATION_PROVIDER)
? (String) catalogPropertiesMetadata().getOrDefault(conf, AUTHORIZATION_PROVIDER)
: null;
if (authorizationProvider == null) {
LOG.info("Authorization provider is not set!");
- return null;
+ return;
Review Comment:
Yes, the Authorization plugin is an option in the Catalog. It may or may not be configured.
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
Review Comment:
I think the authorization module is very important, and testing depends on many Docker containers (hive, ranger, MySQL, IAM, ...) , So I think better to split to a single CI pipeline.
Don't worry, I also disable the authorization IT test in the backend tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730756999
##########
catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/JdbcCatalogPropertiesMetadata.java:
##########
@@ -94,7 +95,11 @@ public class JdbcCatalogPropertiesMetadata extends BaseCatalogPropertiesMetadata
JdbcConfig.POOL_MAX_SIZE.getDefaultValue(),
true /* hidden */,
false /* reserved */));
- PROPERTIES_METADATA = Maps.uniqueIndex(propertyEntries, PropertyEntry::getName);
+ PROPERTIES_METADATA =
+ ImmutableMap.<String, PropertyEntry<?>>builder()
+ .putAll(BASIC_CATALOG_PROPERTY_ENTRIES)
+ .putAll(Maps.uniqueIndex(propertyEntries, PropertyEntry::getName))
+ .build();
Review Comment:
This part is fine with me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730331792
##########
authorizations/authorization-ranger/src/test/java/org/apache/gravitino/authorization/ranger/integration/test/RangerITEnv.java:
##########
@@ -50,16 +54,25 @@ public class RangerITEnv {
protected static final String RANGER_HDFS_REPO_NAME = "hdfsDev";
private static final String RANGER_HDFS_TYPE = "hdfs";
protected static RangerClient rangerClient;
-
+ private static volatile Boolean initRangerService = Boolean.FALSE;
Review Comment:
Primitive type boolean is enough
##########
authorizations/authorization-ranger/build.gradle.kts:
##########
@@ -69,24 +75,34 @@ dependencies {
exclude("org.elasticsearch")
exclude("org.elasticsearch.client")
exclude("org.elasticsearch.plugin")
+ exclude("javax.ws.rs")
}
+ testImplementation(libs.javax.ws.rs.api)
Review Comment:
This line is repeated with L56.
##########
core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java:
##########
@@ -181,53 +182,64 @@ public CatalogOperations ops() {
public AuthorizationPlugin getAuthorizationPlugin() {
if (authorization == null) {
- synchronized (this) {
- if (authorization == null) {
- BaseAuthorization<?> baseAuthorization = createAuthorizationPluginInstance();
- if (baseAuthorization == null) {
- return null;
- }
- authorization = baseAuthorization;
- }
- }
+ return null;
}
return authorization.plugin(provider(), this.conf);
}
- private BaseAuthorization<?> createAuthorizationPluginInstance() {
+ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
+ if (authorization != null) {
+ return;
+ }
+
String authorizationProvider =
catalogPropertiesMetadata().containsProperty(AUTHORIZATION_PROVIDER)
? (String) catalogPropertiesMetadata().getOrDefault(conf, AUTHORIZATION_PROVIDER)
: null;
if (authorizationProvider == null) {
LOG.info("Authorization provider is not set!");
- return null;
+ return;
Review Comment:
Do we only add logs if the authorization provider is not set?
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
Review Comment:
Can you put authorization tests to the backend tests? I'm afraid the CI pipeline is already too large.
##########
core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java:
##########
@@ -181,53 +182,64 @@ public CatalogOperations ops() {
public AuthorizationPlugin getAuthorizationPlugin() {
if (authorization == null) {
- synchronized (this) {
- if (authorization == null) {
- BaseAuthorization<?> baseAuthorization = createAuthorizationPluginInstance();
- if (baseAuthorization == null) {
- return null;
- }
- authorization = baseAuthorization;
- }
- }
+ return null;
}
return authorization.plugin(provider(), this.conf);
}
- private BaseAuthorization<?> createAuthorizationPluginInstance() {
+ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
+ if (authorization != null) {
+ return;
+ }
+
String authorizationProvider =
catalogPropertiesMetadata().containsProperty(AUTHORIZATION_PROVIDER)
? (String) catalogPropertiesMetadata().getOrDefault(conf, AUTHORIZATION_PROVIDER)
: null;
if (authorizationProvider == null) {
LOG.info("Authorization provider is not set!");
- return null;
+ return;
}
- ServiceLoader<AuthorizationProvider> loader =
- ServiceLoader.load(
- AuthorizationProvider.class, Thread.currentThread().getContextClassLoader());
-
- List<Class<? extends AuthorizationProvider>> providers =
- Streams.stream(loader.iterator())
- .filter(p -> p.shortName().equalsIgnoreCase(authorizationProvider))
- .map(AuthorizationProvider::getClass)
- .collect(Collectors.toList());
- if (providers.isEmpty()) {
- throw new IllegalArgumentException(
- "No authorization provider found for: " + authorizationProvider);
- } else if (providers.size() > 1) {
- throw new IllegalArgumentException(
- "Multiple authorization providers found for: " + authorizationProvider);
- }
+ BaseAuthorization<?> baseAuthorization;
try {
- return (BaseAuthorization<?>)
- Iterables.getOnlyElement(providers).getDeclaredConstructor().newInstance();
+ baseAuthorization =
+ classLoader.withClassLoader(
+ cl -> {
+ try {
+ ServiceLoader<AuthorizationProvider> loader =
+ ServiceLoader.load(AuthorizationProvider.class, cl);
+
+ List<Class<? extends AuthorizationProvider>> providers =
+ Streams.stream(loader.iterator())
+ .filter(p -> p.shortName().equalsIgnoreCase(authorizationProvider))
+ .map(AuthorizationProvider::getClass)
+ .collect(Collectors.toList());
+ if (providers.isEmpty()) {
+ throw new IllegalArgumentException(
+ "No authorization provider found for: " + authorizationProvider);
+ } else if (providers.size() > 1) {
+ throw new IllegalArgumentException(
+ "Multiple authorization providers found for: " + authorizationProvider);
+ }
+ return (BaseAuthorization<?>)
+ Iterables.getOnlyElement(providers).getDeclaredConstructor().newInstance();
+ } catch (Exception e) {
+ LOG.error("Failed to create authorization instance", e);
+ throw new RuntimeException(e);
+ }
+ });
} catch (Exception e) {
- LOG.error("Failed to create authorization instance", e);
+ LOG.error("Failed to load authorization with class loader", e);
throw new RuntimeException(e);
}
+
+ if (baseAuthorization == null) {
Review Comment:
so it seems that if the code goes here, `baseAuthorization` is not null.
##########
core/src/main/java/org/apache/gravitino/utils/IsolatedClassLoader.java:
##########
@@ -39,6 +39,11 @@
* controlled loading of classes from specified jars and shared classes from the base class loader.
*/
public class IsolatedClassLoader implements Closeable {
+ // Gravitino have two compound (catalog and authorization) types use isolated class loader
Review Comment:
have two -> has two
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730573584
##########
core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java:
##########
@@ -181,53 +182,59 @@ public CatalogOperations ops() {
public AuthorizationPlugin getAuthorizationPlugin() {
if (authorization == null) {
- synchronized (this) {
- if (authorization == null) {
- BaseAuthorization<?> baseAuthorization = createAuthorizationPluginInstance();
- if (baseAuthorization == null) {
- return null;
- }
- authorization = baseAuthorization;
- }
- }
+ return null;
}
return authorization.plugin(provider(), this.conf);
}
- private BaseAuthorization<?> createAuthorizationPluginInstance() {
+ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
+ if (authorization != null) {
+ return;
+ }
+
String authorizationProvider =
catalogPropertiesMetadata().containsProperty(AUTHORIZATION_PROVIDER)
? (String) catalogPropertiesMetadata().getOrDefault(conf, AUTHORIZATION_PROVIDER)
: null;
if (authorizationProvider == null) {
LOG.info("Authorization provider is not set!");
- return null;
+ return;
}
- ServiceLoader<AuthorizationProvider> loader =
- ServiceLoader.load(
- AuthorizationProvider.class, Thread.currentThread().getContextClassLoader());
-
- List<Class<? extends AuthorizationProvider>> providers =
- Streams.stream(loader.iterator())
- .filter(p -> p.shortName().equalsIgnoreCase(authorizationProvider))
- .map(AuthorizationProvider::getClass)
- .collect(Collectors.toList());
- if (providers.isEmpty()) {
- throw new IllegalArgumentException(
- "No authorization provider found for: " + authorizationProvider);
- } else if (providers.size() > 1) {
- throw new IllegalArgumentException(
- "Multiple authorization providers found for: " + authorizationProvider);
- }
+ BaseAuthorization<?> baseAuthorization;
try {
- return (BaseAuthorization<?>)
- Iterables.getOnlyElement(providers).getDeclaredConstructor().newInstance();
+ baseAuthorization =
Review Comment:
Because `private volatile BaseAuthorization<?> authorization;`
Just like `CatalogManager::createCatalogInstance()` to create a `BaseCatalog`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730637524
##########
gradle/libs.versions.toml:
##########
@@ -79,6 +79,7 @@ flink = "1.18.0"
cglib = "2.2"
ranger = "2.4.0"
javax-jaxb-api = "2.3.1"
+javax-ws-rs-api = "2.1.1"
Review Comment:
I use it `implementation(libs.javax.ws.rs.api)` in the authorizations/authorization-ranger/build.gradle.kts:L56
Because JDK-17 removed `Javax` library internally, So we need to manually add it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730555588
##########
core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java:
##########
@@ -181,53 +182,59 @@ public CatalogOperations ops() {
public AuthorizationPlugin getAuthorizationPlugin() {
if (authorization == null) {
- synchronized (this) {
- if (authorization == null) {
- BaseAuthorization<?> baseAuthorization = createAuthorizationPluginInstance();
- if (baseAuthorization == null) {
- return null;
- }
- authorization = baseAuthorization;
- }
- }
+ return null;
}
return authorization.plugin(provider(), this.conf);
}
- private BaseAuthorization<?> createAuthorizationPluginInstance() {
+ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
+ if (authorization != null) {
+ return;
+ }
+
String authorizationProvider =
catalogPropertiesMetadata().containsProperty(AUTHORIZATION_PROVIDER)
? (String) catalogPropertiesMetadata().getOrDefault(conf, AUTHORIZATION_PROVIDER)
: null;
if (authorizationProvider == null) {
LOG.info("Authorization provider is not set!");
- return null;
+ return;
}
- ServiceLoader<AuthorizationProvider> loader =
- ServiceLoader.load(
- AuthorizationProvider.class, Thread.currentThread().getContextClassLoader());
-
- List<Class<? extends AuthorizationProvider>> providers =
- Streams.stream(loader.iterator())
- .filter(p -> p.shortName().equalsIgnoreCase(authorizationProvider))
- .map(AuthorizationProvider::getClass)
- .collect(Collectors.toList());
- if (providers.isEmpty()) {
- throw new IllegalArgumentException(
- "No authorization provider found for: " + authorizationProvider);
- } else if (providers.size() > 1) {
- throw new IllegalArgumentException(
- "Multiple authorization providers found for: " + authorizationProvider);
- }
+ BaseAuthorization<?> baseAuthorization;
try {
- return (BaseAuthorization<?>)
- Iterables.getOnlyElement(providers).getDeclaredConstructor().newInstance();
+ baseAuthorization =
Review Comment:
Why not assign it directly to authorization?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730741175
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
Review Comment:
It's hard to test them with a single pipeline. They don't use a standalone module.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MINOR]: fix authorization ranger jar conflict [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1728771087
##########
LICENSE.bin:
##########
@@ -310,6 +310,8 @@
Apache Yetus - Audience Annotations
Apache Kerby
Apache Kyuubi
+ Apache Ranger
+ Apache Ranger intg
Review Comment:
Maybe you should add NOTICE.bin, too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730598765
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the "main" branch
+ push:
+ branches: [ "main", "branch-*" ]
+ pull_request:
+ branches: [ "main", "branch-*" ]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ changes:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ source_changes:
+ - .github/**
+ - api/**
+ - authorizations/**
+ - bin/**
+ - catalogs/**
+ - clients/client-java/**
+ - clients/client-java-runtime/**
+ - clients/filesystem-hadoop3/**
+ - clients/filesystem-hadoop3-runtime/**
+ - common/**
+ - conf/**
+ - core/**
+ - gradle/**
+ - integration-test-common/**
+ - iceberg/**
+ - meta/**
+ - server/**
+ - server-common/**
+ - trino-connector/**
+ - web/**
+ - build.gradle.kts
+ - gradle.properties
+ - gradlew
+ - setting.gradle.kts
+ outputs:
+ source_changes: ${{ steps.filter.outputs.source_changes }}
+
+ # Integration test for AMD64 architecture
+ test-amd64-arch:
+ needs: changes
+ if: needs.changes.outputs.source_changes == 'true'
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ strategy:
+ matrix:
+ # Integration test for AMD64 architecture
+ architecture: [linux/amd64]
+ java-version: [ 8, 11, 17 ]
+ test-mode: [ embedded, deploy ]
Review Comment:
I'm afraid there are so many pipelines that ASF will not allow us to run so many runners. I would suggest we don't split them so many, maybe one "java-version" is enough, what do you think?
##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -802,25 +812,60 @@ private String buildConfPath(Map<String, String> properties, String provider) {
return confPath;
}
- private String buildPkgPath(Map<String, String> conf, String provider) {
+ private String buildPkgPath(
+ Map<String, String> conf, String provider, IsolatedClassLoader.IsolatedType isolatedType) {
String gravitinoHome = System.getenv("GRAVITINO_HOME");
Preconditions.checkArgument(gravitinoHome != null, "GRAVITINO_HOME not set");
boolean testEnv = System.getenv("GRAVITINO_TEST") != null;
String pkg = conf.get(Catalog.PROPERTY_PACKAGE);
- String pkgPath;
if (pkg != null) {
- pkgPath = String.join(File.separator, pkg, "libs");
- } else if (testEnv) {
- // In test, the catalog package is under the build directory.
- pkgPath =
- String.join(
- File.separator, gravitinoHome, "catalogs", "catalog-" + provider, "build", "libs");
- } else {
- // In real environment, the catalog package is under the catalog directory.
- pkgPath = String.join(File.separator, gravitinoHome, "catalogs", provider, "libs");
+ return String.join(File.separator, pkg, "libs");
Review Comment:
How do we handle this case if `Catalog.PROPERTY_PACKAGE` is set? From the current code, if `Catalog.PROPERTY_PACKAGE` is set, then we'll directly return without handling authorization related packages.
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the "main" branch
+ push:
+ branches: [ "main", "branch-*" ]
+ pull_request:
+ branches: [ "main", "branch-*" ]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ changes:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ source_changes:
+ - .github/**
+ - api/**
+ - authorizations/**
+ - bin/**
+ - catalogs/**
+ - clients/client-java/**
+ - clients/client-java-runtime/**
+ - clients/filesystem-hadoop3/**
+ - clients/filesystem-hadoop3-runtime/**
+ - common/**
+ - conf/**
+ - core/**
+ - gradle/**
+ - integration-test-common/**
+ - iceberg/**
+ - meta/**
+ - server/**
+ - server-common/**
+ - trino-connector/**
+ - web/**
+ - build.gradle.kts
+ - gradle.properties
+ - gradlew
+ - setting.gradle.kts
Review Comment:
I think maybe only the code changes in catalog, core, and some other places is enough to trigger this test, some parts like client, web, etc maybe unrelated.
##########
gradle/libs.versions.toml:
##########
@@ -79,6 +79,7 @@ flink = "1.18.0"
cglib = "2.2"
ranger = "2.4.0"
javax-jaxb-api = "2.3.1"
+javax-ws-rs-api = "2.1.1"
Review Comment:
Why do we need to add this library? I don't find there's a place using it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730636057
##########
core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java:
##########
@@ -181,53 +182,59 @@ public CatalogOperations ops() {
public AuthorizationPlugin getAuthorizationPlugin() {
if (authorization == null) {
- synchronized (this) {
- if (authorization == null) {
- BaseAuthorization<?> baseAuthorization = createAuthorizationPluginInstance();
- if (baseAuthorization == null) {
- return null;
- }
- authorization = baseAuthorization;
- }
- }
+ return null;
}
return authorization.plugin(provider(), this.conf);
}
- private BaseAuthorization<?> createAuthorizationPluginInstance() {
+ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
+ if (authorization != null) {
+ return;
+ }
+
String authorizationProvider =
catalogPropertiesMetadata().containsProperty(AUTHORIZATION_PROVIDER)
? (String) catalogPropertiesMetadata().getOrDefault(conf, AUTHORIZATION_PROVIDER)
: null;
if (authorizationProvider == null) {
LOG.info("Authorization provider is not set!");
- return null;
+ return;
}
- ServiceLoader<AuthorizationProvider> loader =
- ServiceLoader.load(
- AuthorizationProvider.class, Thread.currentThread().getContextClassLoader());
-
- List<Class<? extends AuthorizationProvider>> providers =
- Streams.stream(loader.iterator())
- .filter(p -> p.shortName().equalsIgnoreCase(authorizationProvider))
- .map(AuthorizationProvider::getClass)
- .collect(Collectors.toList());
- if (providers.isEmpty()) {
- throw new IllegalArgumentException(
- "No authorization provider found for: " + authorizationProvider);
- } else if (providers.size() > 1) {
- throw new IllegalArgumentException(
- "Multiple authorization providers found for: " + authorizationProvider);
- }
+ BaseAuthorization<?> baseAuthorization;
try {
- return (BaseAuthorization<?>)
- Iterables.getOnlyElement(providers).getDeclaredConstructor().newInstance();
+ baseAuthorization =
Review Comment:
Fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730787866
##########
catalogs/catalog-kafka/src/main/java/org/apache/gravitino/catalog/kafka/KafkaCatalogPropertiesMetadata.java:
##########
@@ -30,13 +30,17 @@ public class KafkaCatalogPropertiesMetadata extends BaseCatalogPropertiesMetadat
public static final String BOOTSTRAP_SERVERS = "bootstrap.servers";
private static final Map<String, PropertyEntry<?>> KAFKA_CATALOG_PROPERTY_ENTRIES =
- Collections.singletonMap(
- BOOTSTRAP_SERVERS,
- PropertyEntry.stringRequiredPropertyEntry(
+ ImmutableMap.<String, PropertyEntry<?>>builder()
+ .put(
BOOTSTRAP_SERVERS,
- "The Kafka broker(s) to connect to, allowing for multiple brokers by comma-separating them",
- false /* immutable */,
- false /* hidden */));
+ PropertyEntry.stringRequiredPropertyEntry(
+ BOOTSTRAP_SERVERS,
+ "The Kafka broker(s) to connect to, allowing for multiple brokers by "
+ + "comma-separating them",
+ false /* immutable */,
+ false /* hidden */))
+ .putAll(BASIC_CATALOG_PROPERTY_ENTRIES)
+ .build();
Review Comment:
This part LGTM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730578462
##########
core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java:
##########
@@ -181,53 +182,59 @@ public CatalogOperations ops() {
public AuthorizationPlugin getAuthorizationPlugin() {
if (authorization == null) {
- synchronized (this) {
- if (authorization == null) {
- BaseAuthorization<?> baseAuthorization = createAuthorizationPluginInstance();
- if (baseAuthorization == null) {
- return null;
- }
- authorization = baseAuthorization;
- }
- }
+ return null;
}
return authorization.plugin(provider(), this.conf);
}
- private BaseAuthorization<?> createAuthorizationPluginInstance() {
+ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
+ if (authorization != null) {
+ return;
+ }
+
String authorizationProvider =
catalogPropertiesMetadata().containsProperty(AUTHORIZATION_PROVIDER)
? (String) catalogPropertiesMetadata().getOrDefault(conf, AUTHORIZATION_PROVIDER)
: null;
if (authorizationProvider == null) {
LOG.info("Authorization provider is not set!");
- return null;
+ return;
}
- ServiceLoader<AuthorizationProvider> loader =
- ServiceLoader.load(
- AuthorizationProvider.class, Thread.currentThread().getContextClassLoader());
-
- List<Class<? extends AuthorizationProvider>> providers =
- Streams.stream(loader.iterator())
- .filter(p -> p.shortName().equalsIgnoreCase(authorizationProvider))
- .map(AuthorizationProvider::getClass)
- .collect(Collectors.toList());
- if (providers.isEmpty()) {
- throw new IllegalArgumentException(
- "No authorization provider found for: " + authorizationProvider);
- } else if (providers.size() > 1) {
- throw new IllegalArgumentException(
- "Multiple authorization providers found for: " + authorizationProvider);
- }
+ BaseAuthorization<?> baseAuthorization;
try {
- return (BaseAuthorization<?>)
- Iterables.getOnlyElement(providers).getDeclaredConstructor().newInstance();
+ baseAuthorization =
Review Comment:
I could not it clearly, as `authorization` is marked as `volatile`, so we can't assign value to it directly?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730637343
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
Review Comment:
Should the `Authorization Integration Test` include authentication tests? There are some AuthenticationIT in catalogIT
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#issuecomment-2309336868
@jerryshao Please help me review this PR, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao merged PR #4651:
URL: https://github.com/apache/gravitino/pull/4651
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730614620
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
Review Comment:
Could we reduce the number of the pipeline? The yaml will increase 6 pipelines.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730625969
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the "main" branch
+ push:
+ branches: [ "main", "branch-*" ]
+ pull_request:
+ branches: [ "main", "branch-*" ]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ changes:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ source_changes:
+ - .github/**
+ - api/**
+ - authorizations/**
+ - bin/**
+ - catalogs/**
+ - clients/client-java/**
+ - clients/client-java-runtime/**
+ - clients/filesystem-hadoop3/**
+ - clients/filesystem-hadoop3-runtime/**
+ - common/**
+ - conf/**
+ - core/**
+ - gradle/**
+ - integration-test-common/**
+ - iceberg/**
+ - meta/**
+ - server/**
+ - server-common/**
+ - trino-connector/**
+ - web/**
+ - build.gradle.kts
+ - gradle.properties
+ - gradlew
+ - setting.gradle.kts
+ outputs:
+ source_changes: ${{ steps.filter.outputs.source_changes }}
+
+ # Integration test for AMD64 architecture
+ test-amd64-arch:
+ needs: changes
+ if: needs.changes.outputs.source_changes == 'true'
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ strategy:
+ matrix:
+ # Integration test for AMD64 architecture
+ architecture: [linux/amd64]
+ java-version: [ 8, 11, 17 ]
+ test-mode: [ embedded, deploy ]
Review Comment:
OK, If only one, I hope to use high version JDK to test.
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the "main" branch
+ push:
+ branches: [ "main", "branch-*" ]
+ pull_request:
+ branches: [ "main", "branch-*" ]
+
Review Comment:
1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730635893
##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -802,25 +812,60 @@ private String buildConfPath(Map<String, String> properties, String provider) {
return confPath;
}
- private String buildPkgPath(Map<String, String> conf, String provider) {
+ private String buildPkgPath(
+ Map<String, String> conf, String provider, IsolatedClassLoader.IsolatedType isolatedType) {
String gravitinoHome = System.getenv("GRAVITINO_HOME");
Preconditions.checkArgument(gravitinoHome != null, "GRAVITINO_HOME not set");
boolean testEnv = System.getenv("GRAVITINO_TEST") != null;
String pkg = conf.get(Catalog.PROPERTY_PACKAGE);
- String pkgPath;
if (pkg != null) {
- pkgPath = String.join(File.separator, pkg, "libs");
- } else if (testEnv) {
- // In test, the catalog package is under the build directory.
- pkgPath =
- String.join(
- File.separator, gravitinoHome, "catalogs", "catalog-" + provider, "build", "libs");
- } else {
- // In real environment, the catalog package is under the catalog directory.
- pkgPath = String.join(File.separator, gravitinoHome, "catalogs", provider, "libs");
+ return String.join(File.separator, pkg, "libs");
Review Comment:
I refactor these codes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730749137
##########
catalogs/catalog-kafka/src/main/java/org/apache/gravitino/catalog/kafka/KafkaCatalogPropertiesMetadata.java:
##########
@@ -30,13 +30,17 @@ public class KafkaCatalogPropertiesMetadata extends BaseCatalogPropertiesMetadat
public static final String BOOTSTRAP_SERVERS = "bootstrap.servers";
private static final Map<String, PropertyEntry<?>> KAFKA_CATALOG_PROPERTY_ENTRIES =
- Collections.singletonMap(
- BOOTSTRAP_SERVERS,
- PropertyEntry.stringRequiredPropertyEntry(
+ ImmutableMap.<String, PropertyEntry<?>>builder()
+ .put(
BOOTSTRAP_SERVERS,
- "The Kafka broker(s) to connect to, allowing for multiple brokers by comma-separating them",
- false /* immutable */,
- false /* hidden */));
+ PropertyEntry.stringRequiredPropertyEntry(
+ BOOTSTRAP_SERVERS,
+ "The Kafka broker(s) to connect to, allowing for multiple brokers by "
+ + "comma-separating them",
+ false /* immutable */,
+ false /* hidden */))
+ .putAll(BASIC_CATALOG_PROPERTY_ENTRIES)
+ .build();
Review Comment:
@mchades can you please check this part?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730749907
##########
catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/JdbcCatalogPropertiesMetadata.java:
##########
@@ -94,7 +95,11 @@ public class JdbcCatalogPropertiesMetadata extends BaseCatalogPropertiesMetadata
JdbcConfig.POOL_MAX_SIZE.getDefaultValue(),
true /* hidden */,
false /* reserved */));
- PROPERTIES_METADATA = Maps.uniqueIndex(propertyEntries, PropertyEntry::getName);
+ PROPERTIES_METADATA =
+ ImmutableMap.<String, PropertyEntry<?>>builder()
+ .putAll(BASIC_CATALOG_PROPERTY_ENTRIES)
+ .putAll(Maps.uniqueIndex(propertyEntries, PropertyEntry::getName))
+ .build();
Review Comment:
OK
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730625836
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the "main" branch
+ push:
+ branches: [ "main", "branch-*" ]
+ pull_request:
+ branches: [ "main", "branch-*" ]
+
Review Comment:
1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4662] improve(IT): Add ranger authorization Hive E2E test [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4651:
URL: https://github.com/apache/gravitino/pull/4651#discussion_r1730642641
##########
.github/workflows/authorization-integration-test.yml:
##########
@@ -0,0 +1,110 @@
+name: Authorization Integration Test
Review Comment:
@jerqi Please create an issue to track and fix this problem. Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org