Skip to content

Commit

Permalink
HAWQ-1652. Update PXF keytab path to use PXF_HOME
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
Co-authored-by: Francisco Guerrero <[email protected]>
  • Loading branch information
Francisco Guerrero and divyabhargov committed Aug 20, 2018
1 parent e6b7021 commit 5d6afbe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -343,7 +344,7 @@ private long getDelayMillis() {
* System}.currentTimeMillis)
*/
private long currentTimeMillis() {
return ticker.read() / 1000;
return ticker.read() / NANOS_PER_MILLIS;
}
}
}
4 changes: 2 additions & 2 deletions pxf/pxf-service/src/scripts/pxf-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]"
export PXF_PRINCIPAL="gpadmin/[email protected]"

# Hadoop Distribution Type (optional), supported values:
# <empty> - for auto discovery of HDP, CDH or tarball based client installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public long read() {
}

long advanceTime(long milliseconds) {
return nanos.addAndGet(milliseconds * 1000) / 1000;
return nanos.addAndGet(milliseconds * UGICache.NANOS_PER_MILLIS) / UGICache.NANOS_PER_MILLIS;
}
}

Expand Down

0 comments on commit 5d6afbe

Please sign in to comment.