Repository: sentry Updated Branches: refs/heads/master bab5063c6 -> 25c1c6063
SENTRY-1933: hive-authz2 build fails because SentryJSONAlterPartitionMessage is not compatible (Sergio Pena, reviewed by Alexander Kolbasov) Project: http://git-wip-us.apache.org/repos/asf/sentry/repo Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/25c1c606 Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/25c1c606 Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/25c1c606 Branch: refs/heads/master Commit: 25c1c6063dc8ae9c75fa7c800589b2e7bb737b84 Parents: bab5063 Author: Sergio Pena <[email protected]> Authored: Sat Sep 9 12:26:00 2017 -0500 Committer: Sergio Pena <[email protected]> Committed: Sat Sep 9 12:26:00 2017 -0500 ---------------------------------------------------------------------- .../messaging/json/SentryJSONAlterPartitionMessage.java | 12 ++++++++++++ .../messaging/json/SentryJSONAlterPartitionMessage.java | 12 ++++++++++++ .../sentry/service/thrift/TestFullUpdateModifier.java | 3 +-- .../sentry/tests/e2e/hdfs/TestHDFSIntegration.java | 2 ++ 4 files changed, 27 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sentry/blob/25c1c606/sentry-binding/sentry-binding-hive-follower-v2/src/main/java/org/apache/sentry/binding/metastore/messaging/json/SentryJSONAlterPartitionMessage.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-hive-follower-v2/src/main/java/org/apache/sentry/binding/metastore/messaging/json/SentryJSONAlterPartitionMessage.java b/sentry-binding/sentry-binding-hive-follower-v2/src/main/java/org/apache/sentry/binding/metastore/messaging/json/SentryJSONAlterPartitionMessage.java index 64c1515..25de808 100644 --- a/sentry-binding/sentry-binding-hive-follower-v2/src/main/java/org/apache/sentry/binding/metastore/messaging/json/SentryJSONAlterPartitionMessage.java +++ b/sentry-binding/sentry-binding-hive-follower-v2/src/main/java/org/apache/sentry/binding/metastore/messaging/json/SentryJSONAlterPartitionMessage.java @@ -18,7 +18,9 @@ package org.apache.sentry.binding.metastore.messaging.json; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableMap; +import java.util.Collections; import org.apache.hive.hcatalog.messaging.json.JSONAlterPartitionMessage; import org.codehaus.jackson.annotate.JsonProperty; @@ -48,6 +50,16 @@ public class SentryJSONAlterPartitionMessage extends JSONAlterPartitionMessage { this.newValues = newValues; } + @VisibleForTesting + public SentryJSONAlterPartitionMessage(String server, String servicePrincipal, + String db, String table, + Long timestamp, String oldlocation, + String newLocation) { + this(server, servicePrincipal, db, table, + Collections.<String, String>emptyMap(), Collections.<String>emptyList(), + timestamp, oldlocation, newLocation); + } + public String getNewLocation() { return newLocation; } http://git-wip-us.apache.org/repos/asf/sentry/blob/25c1c606/sentry-binding/sentry-binding-hive-follower/src/main/java/org/apache/sentry/binding/metastore/messaging/json/SentryJSONAlterPartitionMessage.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-hive-follower/src/main/java/org/apache/sentry/binding/metastore/messaging/json/SentryJSONAlterPartitionMessage.java b/sentry-binding/sentry-binding-hive-follower/src/main/java/org/apache/sentry/binding/metastore/messaging/json/SentryJSONAlterPartitionMessage.java index b29d727..1e636c9 100644 --- a/sentry-binding/sentry-binding-hive-follower/src/main/java/org/apache/sentry/binding/metastore/messaging/json/SentryJSONAlterPartitionMessage.java +++ b/sentry-binding/sentry-binding-hive-follower/src/main/java/org/apache/sentry/binding/metastore/messaging/json/SentryJSONAlterPartitionMessage.java @@ -18,7 +18,9 @@ package org.apache.sentry.binding.metastore.messaging.json; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; +import java.util.Collections; import org.apache.hive.hcatalog.messaging.json.JSONAlterPartitionMessage; import org.codehaus.jackson.annotate.JsonProperty; @@ -47,6 +49,16 @@ public class SentryJSONAlterPartitionMessage extends JSONAlterPartitionMessage { this.newValues = newValues; } + @VisibleForTesting + public SentryJSONAlterPartitionMessage(String server, String servicePrincipal, + String db, String table, + Long timestamp, String oldlocation, + String newLocation) { + this(server, servicePrincipal, db, table, + Collections.<String>emptyList(), Collections.<String>emptyList(), + timestamp, oldlocation, newLocation); + } + public String getNewLocation() { return newLocation; } http://git-wip-us.apache.org/repos/asf/sentry/blob/25c1c606/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestFullUpdateModifier.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestFullUpdateModifier.java b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestFullUpdateModifier.java index a8fcbf8..4f90c3e 100644 --- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestFullUpdateModifier.java +++ b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestFullUpdateModifier.java @@ -280,8 +280,7 @@ public class TestFullUpdateModifier { SentryJSONAlterPartitionMessage message = new SentryJSONAlterPartitionMessage(SERVER, PRINCIPAL, DB, TABLE, - Collections.<String>emptyList(), Collections.<String>emptyList(), 0L, - partLocation, newLocation); + 0L, partLocation, newLocation); Mockito.when(deserializer.getAlterPartitionMessage("")).thenReturn(message); FullUpdateModifier.applyEvent(update, event, deserializer); http://git-wip-us.apache.org/repos/asf/sentry/blob/25c1c606/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java ---------------------------------------------------------------------- diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java index e9ae6a1..8852cbc 100644 --- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java +++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java @@ -16,6 +16,8 @@ */ package org.apache.sentry.tests.e2e.hdfs; +import static org.apache.sentry.hdfs.ServiceConstants.ServerConfig.SENTRY_HDFS_INTEGRATION_PATH_PREFIXES; + import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream;
