[2/2] hive git commit: HIVE-19033: Provide an option to purge LLAP IO cache (Prasanth Jayachandran reviewed by Sergey Shelukhin)

2018-04-08 Thread prasanthj
HIVE-19033: Provide an option to purge LLAP IO cache (Prasanth Jayachandran 
reviewed by Sergey Shelukhin)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/a2eb16d0
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/a2eb16d0
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/a2eb16d0

Branch: refs/heads/master
Commit: a2eb16d0f2e0e1f1d939d20943983e09fed313b0
Parents: 6ba33b8
Author: Prasanth Jayachandran 
Authored: Sun Apr 8 16:00:30 2018 -0700
Committer: Prasanth Jayachandran 
Committed: Sun Apr 8 16:00:30 2018 -0700

--
 .../org/apache/hadoop/hive/conf/HiveConf.java   |   3 +-
 .../apache/hive/jdbc/TestActivePassiveHA.java   |  20 +
 .../TestJdbcWithSQLAuthorization.java   |  26 +
 .../apache/hadoop/hive/llap/io/api/LlapIo.java  |   6 +
 .../daemon/rpc/LlapDaemonProtocolProtos.java| 907 ++-
 .../impl/LlapManagementProtocolClientImpl.java  |  11 +
 .../llap/protocol/LlapManagementProtocolPB.java |   2 +
 .../src/protobuf/LlapDaemonProtocol.proto   |   8 +
 .../hive/llap/cache/CacheContentsTracker.java   |   5 +
 .../hive/llap/cache/LowLevelCachePolicy.java|   1 +
 .../llap/cache/LowLevelFifoCachePolicy.java |   8 +
 .../llap/cache/LowLevelLrfuCachePolicy.java |   8 +
 .../daemon/impl/LlapProtocolServerImpl.java |  18 +
 .../services/impl/LlapIoMemoryServlet.java  |   2 +-
 .../hive/llap/io/api/impl/LlapIoImpl.java   |  16 +-
 .../hive/llap/cache/TestLowLevelCacheImpl.java  |   5 +
 .../hive/llap/cache/TestOrcMetadataCache.java   |   5 +
 .../ql/processors/CommandProcessorFactory.java  |   4 +
 .../hadoop/hive/ql/processors/CommandUtil.java  |  44 +
 .../hadoop/hive/ql/processors/HiveCommand.java  |  14 +
 .../processors/LlapCacheResourceProcessor.java  | 195 
 .../LlapClusterResourceProcessor.java   | 134 +++
 .../authorization/plugin/HiveOperationType.java |   2 +
 .../plugin/sqlstd/Operation2Privilege.java  |   2 +
 .../SQLStdHiveAuthorizationValidator.java   |   3 +-
 .../processors/TestCommandProcessorFactory.java |  18 +-
 .../cli/operation/HiveCommandOperation.java |  12 +-
 27 files changed, 1442 insertions(+), 37 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/a2eb16d0/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
--
diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 
b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
index f2af61d..0627c35 100644
--- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
+++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
@@ -3319,7 +3319,8 @@ public class HiveConf extends Configuration {
 HIVE_SERVER2_XSRF_FILTER_ENABLED("hive.server2.xsrf.filter.enabled",false,
 "If enabled, HiveServer2 will block any requests made to it over http 
" +
 "if an X-XSRF-HEADER header is not present"),
-HIVE_SECURITY_COMMAND_WHITELIST("hive.security.command.whitelist", 
"set,reset,dfs,add,list,delete,reload,compile",
+HIVE_SECURITY_COMMAND_WHITELIST("hive.security.command.whitelist",
+  "set,reset,dfs,add,list,delete,reload,compile,llap",
 "Comma separated list of non-SQL Hive commands users are authorized to 
execute"),
 
HIVE_SERVER2_JOB_CREDENTIAL_PROVIDER_PATH("hive.server2.job.credential.provider.path",
 "",
 "If set, this configuration property should provide a comma-separated 
list of URLs that indicates the type and " +

http://git-wip-us.apache.org/repos/asf/hive/blob/a2eb16d0/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java
--
diff --git 
a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java 
b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java
index d2d0bee..c94c0e1 100644
--- 
a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java
+++ 
b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java
@@ -567,4 +567,24 @@ public class TestActivePassiveHA {
 hiveConf.setBoolVar(ConfVars.HIVE_SERVER2_WEBUI_USE_PAM, false);
 hiveConf.setBoolVar(ConfVars.HIVE_IN_TEST, false);
   }
+
+  // This is test for llap command AuthZ added in HIVE-19033 which require ZK 
access for it to pass
+  @Test(timeout = 6)
+  public void testNoAuthZLlapClusterInfo() throws Exception {
+String instanceId1 = UUID.randomUUID().toString();
+miniHS2_1.start(getConfOverlay(instanceId1));
+Connection hs2Conn = getConnection(miniHS2_1.getJdbcURL(), "user1");
+boolean caughtException = false;
+Statement stmt = hs2Conn.createStatement();
+try {
+  

[2/2] hive git commit: HIVE-19033: Provide an option to purge LLAP IO cache (Prasanth Jayachandran reviewed by Sergey Shelukhin)

2018-04-01 Thread prasanthj
HIVE-19033: Provide an option to purge LLAP IO cache (Prasanth Jayachandran 
reviewed by Sergey Shelukhin)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/13f59a22
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/13f59a22
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/13f59a22

Branch: refs/heads/master
Commit: 13f59a2267ed9c73ee729ba0f1925054e07d424b
Parents: 59483bc
Author: Prasanth Jayachandran 
Authored: Sun Apr 1 22:42:28 2018 -0700
Committer: Prasanth Jayachandran 
Committed: Sun Apr 1 22:42:28 2018 -0700

--
 .../org/apache/hadoop/hive/conf/HiveConf.java   |   3 +-
 .../apache/hive/jdbc/TestActivePassiveHA.java   |  20 +
 .../TestJdbcWithSQLAuthorization.java   |  26 +
 .../apache/hadoop/hive/llap/io/api/LlapIo.java  |   6 +
 .../daemon/rpc/LlapDaemonProtocolProtos.java| 907 ++-
 .../impl/LlapManagementProtocolClientImpl.java  |  11 +
 .../llap/protocol/LlapManagementProtocolPB.java |   2 +
 .../src/protobuf/LlapDaemonProtocol.proto   |   8 +
 .../hive/llap/cache/CacheContentsTracker.java   |   5 +
 .../hive/llap/cache/LowLevelCachePolicy.java|   1 +
 .../llap/cache/LowLevelFifoCachePolicy.java |   8 +
 .../llap/cache/LowLevelLrfuCachePolicy.java |   8 +
 .../daemon/impl/LlapProtocolServerImpl.java |  18 +
 .../services/impl/LlapIoMemoryServlet.java  |   2 +-
 .../hive/llap/io/api/impl/LlapIoImpl.java   |  16 +-
 .../hive/llap/cache/TestLowLevelCacheImpl.java  |   5 +
 .../hive/llap/cache/TestOrcMetadataCache.java   |   5 +
 .../ql/processors/CommandProcessorFactory.java  |   4 +
 .../hadoop/hive/ql/processors/CommandUtil.java  |  44 +
 .../hadoop/hive/ql/processors/HiveCommand.java  |  14 +
 .../processors/LlapCacheResourceProcessor.java  | 195 
 .../LlapClusterResourceProcessor.java   | 134 +++
 .../authorization/plugin/HiveOperationType.java |   2 +
 .../plugin/sqlstd/Operation2Privilege.java  |   2 +
 .../SQLStdHiveAuthorizationValidator.java   |   1 +
 .../cli/operation/HiveCommandOperation.java |   2 +-
 26 files changed, 1424 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/13f59a22/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
--
diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 
b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
index 02367eb..ae2e7d6 100644
--- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
+++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
@@ -2820,7 +2820,8 @@ public class HiveConf extends Configuration {
 HIVE_SERVER2_XSRF_FILTER_ENABLED("hive.server2.xsrf.filter.enabled",false,
 "If enabled, HiveServer2 will block any requests made to it over http 
" +
 "if an X-XSRF-HEADER header is not present"),
-HIVE_SECURITY_COMMAND_WHITELIST("hive.security.command.whitelist", 
"set,reset,dfs,add,list,delete,reload,compile",
+HIVE_SECURITY_COMMAND_WHITELIST("hive.security.command.whitelist",
+  "set,reset,dfs,add,list,delete,reload,compile,llap",
 "Comma separated list of non-SQL Hive commands users are authorized to 
execute"),
 
HIVE_SERVER2_JOB_CREDENTIAL_PROVIDER_PATH("hive.server2.job.credential.provider.path",
 "",
 "If set, this configuration property should provide a comma-separated 
list of URLs that indicates the type and " +

http://git-wip-us.apache.org/repos/asf/hive/blob/13f59a22/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java
--
diff --git 
a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java 
b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java
index d2d0bee..c94c0e1 100644
--- 
a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java
+++ 
b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java
@@ -567,4 +567,24 @@ public class TestActivePassiveHA {
 hiveConf.setBoolVar(ConfVars.HIVE_SERVER2_WEBUI_USE_PAM, false);
 hiveConf.setBoolVar(ConfVars.HIVE_IN_TEST, false);
   }
+
+  // This is test for llap command AuthZ added in HIVE-19033 which require ZK 
access for it to pass
+  @Test(timeout = 6)
+  public void testNoAuthZLlapClusterInfo() throws Exception {
+String instanceId1 = UUID.randomUUID().toString();
+miniHS2_1.start(getConfOverlay(instanceId1));
+Connection hs2Conn = getConnection(miniHS2_1.getJdbcURL(), "user1");
+boolean caughtException = false;
+Statement stmt = hs2Conn.createStatement();
+try {
+  stmt.execute("set hive.llap.daemon.service.hosts=@localhost");
+