[4/7] phoenix git commit: PHOENIX-4231 Support restriction of remote UDF load sources
PHOENIX-4231 Support restriction of remote UDF load sources Signed-off-by: Andrew PurtellProject: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/cfd548c1 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/cfd548c1 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/cfd548c1 Branch: refs/heads/4.x-HBase-1.1 Commit: cfd548c145423588509e2c6df9bfac2e27549ff3 Parents: c6b98ce Author: aertoria Authored: Tue Feb 27 15:02:07 2018 -0800 Committer: Josh Elser Committed: Wed Mar 28 09:31:30 2018 -0400 -- .../phoenix/end2end/UserDefinedFunctionsIT.java | 127 +-- .../expression/function/UDFExpression.java | 20 +-- 2 files changed, 120 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/cfd548c1/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java index f58f750..943119d 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java @@ -27,15 +27,12 @@ import static org.apache.phoenix.util.PhoenixRuntime.PHOENIX_TEST_DRIVER_URL_PAR import static org.apache.phoenix.util.TestUtil.JOIN_ITEM_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.JOIN_SUPPLIER_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.LOCALHOST; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -53,6 +50,10 @@ import java.util.jar.Manifest; import javax.tools.JavaCompiler; import javax.tools.ToolProvider; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.FileUtil; +import org.apache.hadoop.fs.Path; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -66,13 +67,15 @@ import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.QueryUtil; import org.apache.phoenix.util.ReadOnlyProps; import org.junit.After; +import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; import com.google.common.collect.Maps; +import org.junit.rules.TestName; public class UserDefinedFunctionsIT extends BaseOwnClusterIT { - protected static final String TENANT_ID = "ZZTop"; private static String url; private static PhoenixTestDriver driver; @@ -190,10 +193,36 @@ public class UserDefinedFunctionsIT extends BaseOwnClusterIT { private static String GETY_CLASSNAME_PROGRAM = getProgram(GETY_CLASSNAME, GETY_EVALUATE_METHOD, "return PInteger.INSTANCE;"); private static Properties EMPTY_PROPS = new Properties(); +@Rule +public TestName name = new TestName(); @Override @After -public void cleanUpAfterTest() throws Exception {} +public void cleanUpAfterTest() throws Exception { +Connection conn = driver.connect(url, EMPTY_PROPS); +Statement stmt = conn.createStatement(); +ResultSet rs = stmt.executeQuery("list jars"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar1.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar2.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar3.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar4.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar5.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar6.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar7.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar8.jar'");
phoenix git commit: PHOENIX-4231 Support restriction of remote UDF load sources
Repository: phoenix Updated Branches: refs/heads/4.x-cdh5.11.2 25026b6cc -> 1f0416616 PHOENIX-4231 Support restriction of remote UDF load sources Signed-off-by: Andrew PurtellProject: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/1f041661 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/1f041661 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/1f041661 Branch: refs/heads/4.x-cdh5.11.2 Commit: 1f041661681efa9030e1292f8fba4926e856fba5 Parents: 25026b6 Author: aertoria Authored: Tue Feb 27 23:02:07 2018 + Committer: Pedro Boado Committed: Fri Mar 16 00:54:38 2018 + -- .../phoenix/end2end/UserDefinedFunctionsIT.java | 127 +-- .../expression/function/UDFExpression.java | 20 +-- 2 files changed, 120 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/1f041661/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java index f58f750..943119d 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java @@ -27,15 +27,12 @@ import static org.apache.phoenix.util.PhoenixRuntime.PHOENIX_TEST_DRIVER_URL_PAR import static org.apache.phoenix.util.TestUtil.JOIN_ITEM_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.JOIN_SUPPLIER_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.LOCALHOST; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -53,6 +50,10 @@ import java.util.jar.Manifest; import javax.tools.JavaCompiler; import javax.tools.ToolProvider; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.FileUtil; +import org.apache.hadoop.fs.Path; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -66,13 +67,15 @@ import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.QueryUtil; import org.apache.phoenix.util.ReadOnlyProps; import org.junit.After; +import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; import com.google.common.collect.Maps; +import org.junit.rules.TestName; public class UserDefinedFunctionsIT extends BaseOwnClusterIT { - protected static final String TENANT_ID = "ZZTop"; private static String url; private static PhoenixTestDriver driver; @@ -190,10 +193,36 @@ public class UserDefinedFunctionsIT extends BaseOwnClusterIT { private static String GETY_CLASSNAME_PROGRAM = getProgram(GETY_CLASSNAME, GETY_EVALUATE_METHOD, "return PInteger.INSTANCE;"); private static Properties EMPTY_PROPS = new Properties(); +@Rule +public TestName name = new TestName(); @Override @After -public void cleanUpAfterTest() throws Exception {} +public void cleanUpAfterTest() throws Exception { +Connection conn = driver.connect(url, EMPTY_PROPS); +Statement stmt = conn.createStatement(); +ResultSet rs = stmt.executeQuery("list jars"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar1.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar2.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar3.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar4.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar5.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar6.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar7.jar'"); +stmt.execute("delete
phoenix git commit: PHOENIX-4231 Support restriction of remote UDF load sources
Repository: phoenix Updated Branches: refs/heads/5.x-HBase-2.0 3f892a4ed -> f49c8a724 PHOENIX-4231 Support restriction of remote UDF load sources Signed-off-by: Andrew PurtellProject: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/f49c8a72 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/f49c8a72 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/f49c8a72 Branch: refs/heads/5.x-HBase-2.0 Commit: f49c8a7240f3ea705c6e07ec43df9a8d9577ad83 Parents: 3f892a4 Author: aertoria Authored: Tue Feb 27 15:02:07 2018 -0800 Committer: Andrew Purtell Committed: Wed Mar 14 14:55:03 2018 -0700 -- .../phoenix/end2end/UserDefinedFunctionsIT.java | 127 +-- .../expression/function/UDFExpression.java | 20 +-- 2 files changed, 120 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/f49c8a72/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java index f58f750..943119d 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java @@ -27,15 +27,12 @@ import static org.apache.phoenix.util.PhoenixRuntime.PHOENIX_TEST_DRIVER_URL_PAR import static org.apache.phoenix.util.TestUtil.JOIN_ITEM_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.JOIN_SUPPLIER_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.LOCALHOST; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -53,6 +50,10 @@ import java.util.jar.Manifest; import javax.tools.JavaCompiler; import javax.tools.ToolProvider; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.FileUtil; +import org.apache.hadoop.fs.Path; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -66,13 +67,15 @@ import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.QueryUtil; import org.apache.phoenix.util.ReadOnlyProps; import org.junit.After; +import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; import com.google.common.collect.Maps; +import org.junit.rules.TestName; public class UserDefinedFunctionsIT extends BaseOwnClusterIT { - protected static final String TENANT_ID = "ZZTop"; private static String url; private static PhoenixTestDriver driver; @@ -190,10 +193,36 @@ public class UserDefinedFunctionsIT extends BaseOwnClusterIT { private static String GETY_CLASSNAME_PROGRAM = getProgram(GETY_CLASSNAME, GETY_EVALUATE_METHOD, "return PInteger.INSTANCE;"); private static Properties EMPTY_PROPS = new Properties(); +@Rule +public TestName name = new TestName(); @Override @After -public void cleanUpAfterTest() throws Exception {} +public void cleanUpAfterTest() throws Exception { +Connection conn = driver.connect(url, EMPTY_PROPS); +Statement stmt = conn.createStatement(); +ResultSet rs = stmt.executeQuery("list jars"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar1.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar2.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar3.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar4.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar5.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar6.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar7.jar'"); +
[3/4] phoenix git commit: PHOENIX-4231 Support restriction of remote UDF load sources
PHOENIX-4231 Support restriction of remote UDF load sources Signed-off-by: Andrew PurtellProject: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/be634b57 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/be634b57 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/be634b57 Branch: refs/heads/4.x-HBase-1.2 Commit: be634b576589c3c2a523e792efec0c03398b5285 Parents: 8c830a7 Author: aertoria Authored: Tue Feb 27 15:02:07 2018 -0800 Committer: Andrew Purtell Committed: Wed Mar 14 12:43:04 2018 -0700 -- .../phoenix/end2end/UserDefinedFunctionsIT.java | 127 +-- .../expression/function/UDFExpression.java | 20 +-- 2 files changed, 120 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/be634b57/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java index f58f750..943119d 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java @@ -27,15 +27,12 @@ import static org.apache.phoenix.util.PhoenixRuntime.PHOENIX_TEST_DRIVER_URL_PAR import static org.apache.phoenix.util.TestUtil.JOIN_ITEM_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.JOIN_SUPPLIER_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.LOCALHOST; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -53,6 +50,10 @@ import java.util.jar.Manifest; import javax.tools.JavaCompiler; import javax.tools.ToolProvider; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.FileUtil; +import org.apache.hadoop.fs.Path; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -66,13 +67,15 @@ import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.QueryUtil; import org.apache.phoenix.util.ReadOnlyProps; import org.junit.After; +import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; import com.google.common.collect.Maps; +import org.junit.rules.TestName; public class UserDefinedFunctionsIT extends BaseOwnClusterIT { - protected static final String TENANT_ID = "ZZTop"; private static String url; private static PhoenixTestDriver driver; @@ -190,10 +193,36 @@ public class UserDefinedFunctionsIT extends BaseOwnClusterIT { private static String GETY_CLASSNAME_PROGRAM = getProgram(GETY_CLASSNAME, GETY_EVALUATE_METHOD, "return PInteger.INSTANCE;"); private static Properties EMPTY_PROPS = new Properties(); +@Rule +public TestName name = new TestName(); @Override @After -public void cleanUpAfterTest() throws Exception {} +public void cleanUpAfterTest() throws Exception { +Connection conn = driver.connect(url, EMPTY_PROPS); +Statement stmt = conn.createStatement(); +ResultSet rs = stmt.executeQuery("list jars"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar1.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar2.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar3.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar4.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar5.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar6.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar7.jar'"); +stmt.execute("delete jar '"+
[2/4] phoenix git commit: PHOENIX-4231 Support restriction of remote UDF load sources
PHOENIX-4231 Support restriction of remote UDF load sources Signed-off-by: Andrew PurtellProject: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/ae3618ff Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ae3618ff Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ae3618ff Branch: refs/heads/4.x-HBase-1.3 Commit: ae3618ff88c36eb04734fad78ac64c8989fc470f Parents: c115b6a Author: aertoria Authored: Tue Feb 27 15:02:07 2018 -0800 Committer: Andrew Purtell Committed: Wed Mar 14 12:42:55 2018 -0700 -- .../phoenix/end2end/UserDefinedFunctionsIT.java | 127 +-- .../expression/function/UDFExpression.java | 20 +-- 2 files changed, 120 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/ae3618ff/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java index f58f750..943119d 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java @@ -27,15 +27,12 @@ import static org.apache.phoenix.util.PhoenixRuntime.PHOENIX_TEST_DRIVER_URL_PAR import static org.apache.phoenix.util.TestUtil.JOIN_ITEM_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.JOIN_SUPPLIER_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.LOCALHOST; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -53,6 +50,10 @@ import java.util.jar.Manifest; import javax.tools.JavaCompiler; import javax.tools.ToolProvider; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.FileUtil; +import org.apache.hadoop.fs.Path; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -66,13 +67,15 @@ import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.QueryUtil; import org.apache.phoenix.util.ReadOnlyProps; import org.junit.After; +import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; import com.google.common.collect.Maps; +import org.junit.rules.TestName; public class UserDefinedFunctionsIT extends BaseOwnClusterIT { - protected static final String TENANT_ID = "ZZTop"; private static String url; private static PhoenixTestDriver driver; @@ -190,10 +193,36 @@ public class UserDefinedFunctionsIT extends BaseOwnClusterIT { private static String GETY_CLASSNAME_PROGRAM = getProgram(GETY_CLASSNAME, GETY_EVALUATE_METHOD, "return PInteger.INSTANCE;"); private static Properties EMPTY_PROPS = new Properties(); +@Rule +public TestName name = new TestName(); @Override @After -public void cleanUpAfterTest() throws Exception {} +public void cleanUpAfterTest() throws Exception { +Connection conn = driver.connect(url, EMPTY_PROPS); +Statement stmt = conn.createStatement(); +ResultSet rs = stmt.executeQuery("list jars"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar1.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar2.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar3.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar4.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar5.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar6.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar7.jar'"); +stmt.execute("delete jar '"+
[4/4] phoenix git commit: PHOENIX-4231 Support restriction of remote UDF load sources
PHOENIX-4231 Support restriction of remote UDF load sources Signed-off-by: Andrew PurtellProject: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/ade93c9d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ade93c9d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ade93c9d Branch: refs/heads/4.x-HBase-0.98 Commit: ade93c9d5ac6ecad2234d22da6fdbb1168c5d32a Parents: 8f8209d Author: aertoria Authored: Tue Feb 27 15:02:07 2018 -0800 Committer: Andrew Purtell Committed: Wed Mar 14 12:43:09 2018 -0700 -- .../phoenix/end2end/UserDefinedFunctionsIT.java | 127 +-- .../expression/function/UDFExpression.java | 20 +-- 2 files changed, 120 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/ade93c9d/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java index f58f750..943119d 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java @@ -27,15 +27,12 @@ import static org.apache.phoenix.util.PhoenixRuntime.PHOENIX_TEST_DRIVER_URL_PAR import static org.apache.phoenix.util.TestUtil.JOIN_ITEM_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.JOIN_SUPPLIER_TABLE_FULL_NAME; import static org.apache.phoenix.util.TestUtil.LOCALHOST; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -53,6 +50,10 @@ import java.util.jar.Manifest; import javax.tools.JavaCompiler; import javax.tools.ToolProvider; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.FileUtil; +import org.apache.hadoop.fs.Path; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -66,13 +67,15 @@ import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.QueryUtil; import org.apache.phoenix.util.ReadOnlyProps; import org.junit.After; +import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; import com.google.common.collect.Maps; +import org.junit.rules.TestName; public class UserDefinedFunctionsIT extends BaseOwnClusterIT { - protected static final String TENANT_ID = "ZZTop"; private static String url; private static PhoenixTestDriver driver; @@ -190,10 +193,36 @@ public class UserDefinedFunctionsIT extends BaseOwnClusterIT { private static String GETY_CLASSNAME_PROGRAM = getProgram(GETY_CLASSNAME, GETY_EVALUATE_METHOD, "return PInteger.INSTANCE;"); private static Properties EMPTY_PROPS = new Properties(); +@Rule +public TestName name = new TestName(); @Override @After -public void cleanUpAfterTest() throws Exception {} +public void cleanUpAfterTest() throws Exception { +Connection conn = driver.connect(url, EMPTY_PROPS); +Statement stmt = conn.createStatement(); +ResultSet rs = stmt.executeQuery("list jars"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar1.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar2.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar3.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar4.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar5.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar6.jar'"); +stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar7.jar'"); +stmt.execute("delete jar '"+