You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by sh...@apache.org on 2018/08/20 17:49:27 UTC

incubator-hawq git commit: HAWQ-1652. Update PXF keytab path to use PXF_HOME

Repository: incubator-hawq
Updated Branches:
  refs/heads/master e6b70215f -> 5d6afbe75


HAWQ-1652. Update PXF keytab path to use PXF_HOME

- Updates `PXF_KEYTAB` path to live inside `${PXF_HOME}/conf` and
  `PXF_PRINCIPAL` to default to gpadmin.
- Fixes nanoseconds to milliseconds conversion in UGICache.

Co-authored-by: Divya Bhargov <db...@pivotal.io>
Co-authored-by: Francisco Guerrero <ag...@pivotal.io>


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/5d6afbe7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/5d6afbe7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/5d6afbe7

Branch: refs/heads/master
Commit: 5d6afbe75f107a6d785773dec9caf9949f9d0a1e
Parents: e6b7021
Author: Francisco Guerrero <ag...@pivotal.io>
Authored: Fri Aug 17 17:26:44 2018 -0700
Committer: Francisco Guerrero <ag...@pivotal.io>
Committed: Mon Aug 20 10:47:27 2018 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hawq/pxf/service/UGICache.java     | 5 +++--
 pxf/pxf-service/src/scripts/pxf-env.sh                          | 4 ++--
 .../src/test/java/org/apache/hawq/pxf/service/UGICacheTest.java | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5d6afbe7/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/UGICache.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/UGICache.java b/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/UGICache.java
index febb3ed..4fcb481 100644
--- a/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/UGICache.java
+++ b/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/UGICache.java
@@ -48,7 +48,8 @@ public class UGICache {
     private final Map<Integer, DelayQueue<Entry>> expirationQueueMap = new HashMap<>();
     private final UGIProvider ugiProvider;
     private final Ticker ticker;
-    final static long UGI_CACHE_EXPIRY = 15 * 60 * 1000L; // 15 Minutes
+    static final int NANOS_PER_MILLIS = 1000000;
+    static final long UGI_CACHE_EXPIRY = 15 * 60 * 1000L; // 15 Minutes
 
     /**
      * Create a UGICache with the given {@link Ticker} and {@link UGIProvider}. Intended for use by
@@ -343,7 +344,7 @@ public class UGICache {
          * System}.currentTimeMillis)
          */
         private long currentTimeMillis() {
-            return ticker.read() / 1000;
+            return ticker.read() / NANOS_PER_MILLIS;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5d6afbe7/pxf/pxf-service/src/scripts/pxf-env.sh
----------------------------------------------------------------------
diff --git a/pxf/pxf-service/src/scripts/pxf-env.sh b/pxf/pxf-service/src/scripts/pxf-env.sh
index 2bb0ffd..fd82283 100644
--- a/pxf/pxf-service/src/scripts/pxf-env.sh
+++ b/pxf/pxf-service/src/scripts/pxf-env.sh
@@ -46,9 +46,9 @@ export PXF_JVM_OPTS="-Xmx2g -Xms1g"
 
 # Kerberos
 # Path to keytab file owned by pxf service with permissions 0400
-export PXF_KEYTAB="/etc/security/keytab/pxf.service.keytab"
+export PXF_KEYTAB="${PXF_HOME}/conf/pxf.service.keytab"
 # Kerberos principal pxf service should use. _HOST is replaced automatically with hostnames FQDN
-export PXF_PRINCIPAL="pxf/_HOST@EXAMPLE.COM"
+export PXF_PRINCIPAL="gpadmin/_HOST@EXAMPLE.COM"
 
 # Hadoop Distribution Type (optional), supported values:
 # <empty> - for auto discovery of HDP, CDH or tarball based client installation

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5d6afbe7/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/UGICacheTest.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/UGICacheTest.java b/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/UGICacheTest.java
index 44c3f9a..44b8c78 100644
--- a/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/UGICacheTest.java
+++ b/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/UGICacheTest.java
@@ -58,7 +58,7 @@ public class UGICacheTest {
         }
 
         long advanceTime(long milliseconds) {
-            return nanos.addAndGet(milliseconds * 1000) / 1000;
+            return nanos.addAndGet(milliseconds * UGICache.NANOS_PER_MILLIS) / UGICache.NANOS_PER_MILLIS;
         }
     }