[phoenix] branch 5.1 updated: PHOENIX-6953 Creating indexes on a table with old indexing leads to inconsistent co-processors
This is an automated email from the ASF dual-hosted git repository. stoty pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/5.1 by this push: new 57058dd055 PHOENIX-6953 Creating indexes on a table with old indexing leads to inconsistent co-processors 57058dd055 is described below commit 57058dd055d6d783cacfbaf2acf413ebc315edbf Author: Istvan Toth AuthorDate: Thu May 11 15:58:26 2023 +0200 PHOENIX-6953 Creating indexes on a table with old indexing leads to inconsistent co-processors --- .../org/apache/phoenix/end2end/CreateTableIT.java | 153 - .../phoenix/query/ConnectionQueryServicesImpl.java | 29 ++-- 2 files changed, 170 insertions(+), 12 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java index df46118165..f1b3a98fcf 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java @@ -17,6 +17,7 @@ */ package org.apache.phoenix.end2end; +import static org.apache.phoenix.mapreduce.index.IndexUpgradeTool.ROLLBACK_OP; import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -36,20 +37,22 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Properties; +import java.util.UUID; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; -import org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory; -import org.apache.hadoop.hbase.regionserver.BloomType; import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.client.TableDescriptorBuilder; +import org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory; +import org.apache.hadoop.hbase.regionserver.BloomType; import org.apache.phoenix.exception.SQLExceptionCode; import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData; import org.apache.phoenix.jdbc.PhoenixStatement; +import org.apache.phoenix.mapreduce.index.IndexUpgradeTool; import org.apache.phoenix.query.BaseTest; import org.apache.phoenix.query.KeyRange; import org.apache.phoenix.query.QueryConstants; @@ -71,6 +74,7 @@ import org.apache.phoenix.util.QueryUtil; import org.apache.phoenix.util.ReadOnlyProps; import org.apache.phoenix.util.SchemaUtil; import org.apache.phoenix.util.TestUtil; +import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -1518,6 +1522,151 @@ public class CreateTableIT extends ParallelStatsDisabledIT { .getColumnQualifierBytes())); } +// Test for PHOENIX-6953 +@Test +public void testCoprocessorsForCreateIndexOnOldImplementation() throws Exception { +String tableName = generateUniqueName(); +String index1Name = generateUniqueName(); +String index2Name = generateUniqueName(); + +String ddl = +"create table " + tableName + " ( k integer PRIMARY KEY," + " v1 integer," ++ " v2 integer)"; +String index1Ddl = "create index " + index1Name + " on " + tableName + " (v1)"; +String index2Ddl = "create index " + index2Name + " on " + tableName + " (v2)"; + +Properties props = new Properties(); +Admin admin = driver.getConnectionQueryServices(getUrl(), props).getAdmin(); + +try (Connection conn = DriverManager.getConnection(getUrl()); +Statement stmt = conn.createStatement();) { +stmt.execute(ddl); +stmt.execute(index1Ddl); + +TableDescriptor index1DescriptorBefore = +admin.getDescriptor(TableName.valueOf(index1Name)); +assertTrue(index1DescriptorBefore + .hasCoprocessor(org.apache.phoenix.index.GlobalIndexChecker.class.getName())); + +// Now roll back to the old indexing +IndexUpgradeTool iut = +new IndexUpgradeTool(ROLLBACK_OP, tableName, null, +"/tmp/index_upgrade_" + UUID.randomUUID().toString(), false, null, +false); +iut.setConf(getUtility().getConfiguration()); +iut.prepareToolSetup(); +assertEquals(0, iut.executeTool()); + +TableDescriptor index1DescriptorAfter = +admin.getDescriptor(TableName.valueOf(index1Name)); +assertFalse(index1DescriptorAfter +
[phoenix] branch master updated: PHOENIX-6953 Creating indexes on a table with old indexing leads to inconsistent co-processors
This is an automated email from the ASF dual-hosted git repository. stoty pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/master by this push: new db16b53b9d PHOENIX-6953 Creating indexes on a table with old indexing leads to inconsistent co-processors db16b53b9d is described below commit db16b53b9d0d7f7c142799f417fb90e1d3d8fe75 Author: Istvan Toth AuthorDate: Thu May 11 15:58:26 2023 +0200 PHOENIX-6953 Creating indexes on a table with old indexing leads to inconsistent co-processors --- .../org/apache/phoenix/end2end/CreateTableIT.java | 101 - .../phoenix/query/ConnectionQueryServicesImpl.java | 32 --- 2 files changed, 119 insertions(+), 14 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java index 680dba1baf..8e622f40b9 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java @@ -17,6 +17,7 @@ */ package org.apache.phoenix.end2end; +import static org.apache.phoenix.mapreduce.index.IndexUpgradeTool.ROLLBACK_OP; import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -37,20 +38,22 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Properties; +import java.util.UUID; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; -import org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory; -import org.apache.hadoop.hbase.regionserver.BloomType; import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.client.TableDescriptorBuilder; +import org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory; +import org.apache.hadoop.hbase.regionserver.BloomType; import org.apache.phoenix.exception.SQLExceptionCode; import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData; import org.apache.phoenix.jdbc.PhoenixStatement; +import org.apache.phoenix.mapreduce.index.IndexUpgradeTool; import org.apache.phoenix.query.BaseTest; import org.apache.phoenix.query.KeyRange; import org.apache.phoenix.query.QueryConstants; @@ -65,7 +68,6 @@ import org.apache.phoenix.schema.PTableType; import org.apache.phoenix.schema.SchemaNotFoundException; import org.apache.phoenix.schema.TableAlreadyExistsException; import org.apache.phoenix.schema.TableNotFoundException; -import org.apache.phoenix.schema.export.DefaultSchemaRegistryRepository; import org.apache.phoenix.util.EnvironmentEdgeManager; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.PropertiesUtil; @@ -1574,6 +1576,99 @@ public class CreateTableIT extends ParallelStatsDisabledIT { .getColumnQualifierBytes())); } +// Test for PHOENIX-6953 +@Test +public void testCoprocessorsForCreateIndexOnOldImplementation() throws Exception { +String tableName = generateUniqueName(); +String index1Name = generateUniqueName(); +String index2Name = generateUniqueName(); + +String ddl = +"create table " + tableName + " ( k integer PRIMARY KEY," + " v1 integer," ++ " v2 integer)"; +String index1Ddl = "create index " + index1Name + " on " + tableName + " (v1)"; +String index2Ddl = "create index " + index2Name + " on " + tableName + " (v2)"; + +Properties props = new Properties(); +Admin admin = driver.getConnectionQueryServices(getUrl(), props).getAdmin(); + +try (Connection conn = DriverManager.getConnection(getUrl()); +Statement stmt = conn.createStatement();) { +stmt.execute(ddl); +stmt.execute(index1Ddl); + +TableDescriptor index1DescriptorBefore = +admin.getDescriptor(TableName.valueOf(index1Name)); +assertTrue(index1DescriptorBefore + .hasCoprocessor(org.apache.phoenix.index.GlobalIndexChecker.class.getName())); + +// Now roll back to the old indexing +IndexUpgradeTool iut = +new IndexUpgradeTool(ROLLBACK_OP, tableName, null, +"/tmp/index_upgrade_" + UUID.randomUUID().toString(), false, null, +false); +iut.setConf(getUtility().getConfiguration()); +iut.prepareToolSetup(); +assertEquals(0, iut.executeTool()); + +TableDescriptor index1DescriptorAfter = +
Apache-Phoenix | 5.1 | HBase 2.1 | Build #227 FAILURE
5.1 branch HBase 2.1 build #227 status FAILURE Build #227 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/227/
Apache-Phoenix | 5.1 | HBase 2.2 | Build #227 FAILURE
5.1 branch HBase 2.2 build #227 status FAILURE Build #227 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/227/
Apache-Phoenix | master | HBase 2.4 | Build #532 FAILURE
master branch HBase 2.4 build #532 status FAILURE Build #532 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/532/
Apache-Phoenix | 5.1 | HBase 2.3 | Build #227 FAILURE
5.1 branch HBase 2.3 build #227 status FAILURE Build #227 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/227/
Apache-Phoenix | master | HBase 2.5 | Build #532 SUCCESS
master branch HBase 2.5 build #532 status SUCCESS Build #532 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/532/
Apache-Phoenix | 5.1 | HBase 2.4 | Build #227 FAILURE
5.1 branch HBase 2.4 build #227 status FAILURE Build #227 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/227/
Apache-Phoenix | 5.1 | HBase 2.5 | Build #227 FAILURE
5.1 branch HBase 2.5 build #227 status FAILURE Build #227 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/227/
[phoenix] branch 5.1 updated: PHOENIX-6954 Fix Category for some index related ITs
This is an automated email from the ASF dual-hosted git repository. stoty pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/5.1 by this push: new cc00905b96 PHOENIX-6954 Fix Category for some index related ITs cc00905b96 is described below commit cc00905b964bd8d629a9c68825e8692569f0a8ff Author: Istvan Toth AuthorDate: Thu May 11 16:12:00 2023 +0200 PHOENIX-6954 Fix Category for some index related ITs --- .../apache/phoenix/end2end/IndexUpgradeToolIT.java | 38 -- .../phoenix/end2end/IndexWithDefaultValueIT.java | 3 +- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexUpgradeToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexUpgradeToolIT.java index dcfd8d50a5..45ca69993a 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexUpgradeToolIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexUpgradeToolIT.java @@ -17,20 +17,7 @@ */ package org.apache.phoenix.end2end; -import org.apache.phoenix.mapreduce.index.IndexUpgradeTool; -import org.apache.phoenix.query.BaseTest; -import org.apache.phoenix.util.PhoenixRuntime; -import org.apache.phoenix.util.PropertiesUtil; -import org.apache.phoenix.util.ReadOnlyProps; -import org.apache.phoenix.util.SchemaUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; - +import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES; import java.sql.Connection; import java.sql.DriverManager; @@ -39,16 +26,23 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.Properties; -import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES; +import org.apache.phoenix.mapreduce.index.IndexUpgradeTool; +import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.PropertiesUtil; +import org.apache.phoenix.util.SchemaUtil; +import org.junit.Assert; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) -//FIXME this test is never run by maven, as it has no @Category -public class IndexUpgradeToolIT extends BaseTest { +@Category(ParallelStatsDisabledTest.class) +public class IndexUpgradeToolIT extends ParallelStatsDisabledIT { public static final String VERIFY_COUNT_ASSERT_MESSAGE = "view-index count in system table doesn't match"; @@ -66,12 +60,6 @@ public class IndexUpgradeToolIT extends BaseTest { }); } -@BeforeClass -public static synchronized void setup() throws Exception { -Map props = Collections.emptyMap(); -setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator())); -} - @Test public void verifyViewAndViewIndexes() throws Exception { String tableName = generateUniqueName(); diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexWithDefaultValueIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexWithDefaultValueIT.java index a93f4abddf..d1827ae3d2 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexWithDefaultValueIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexWithDefaultValueIT.java @@ -19,6 +19,7 @@ package org.apache.phoenix.end2end; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.sql.Connection; import java.sql.DriverManager; @@ -30,7 +31,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertEquals; - +@Category(ParallelStatsDisabledTest.class) public class IndexWithDefaultValueIT extends ParallelStatsDisabledIT { @Test
[phoenix] branch master updated: PHOENIX-6954 Fix Category for some index related ITs
This is an automated email from the ASF dual-hosted git repository. stoty pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/master by this push: new 76055aa060 PHOENIX-6954 Fix Category for some index related ITs 76055aa060 is described below commit 76055aa06084548a59716dedb38084e4ae3eb5dc Author: Istvan Toth AuthorDate: Thu May 11 16:12:00 2023 +0200 PHOENIX-6954 Fix Category for some index related ITs --- .../apache/phoenix/end2end/IndexUpgradeToolIT.java | 38 -- .../phoenix/end2end/IndexWithDefaultValueIT.java | 3 +- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexUpgradeToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexUpgradeToolIT.java index dcfd8d50a5..45ca69993a 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexUpgradeToolIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexUpgradeToolIT.java @@ -17,20 +17,7 @@ */ package org.apache.phoenix.end2end; -import org.apache.phoenix.mapreduce.index.IndexUpgradeTool; -import org.apache.phoenix.query.BaseTest; -import org.apache.phoenix.util.PhoenixRuntime; -import org.apache.phoenix.util.PropertiesUtil; -import org.apache.phoenix.util.ReadOnlyProps; -import org.apache.phoenix.util.SchemaUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; - +import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES; import java.sql.Connection; import java.sql.DriverManager; @@ -39,16 +26,23 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.Properties; -import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES; +import org.apache.phoenix.mapreduce.index.IndexUpgradeTool; +import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.PropertiesUtil; +import org.apache.phoenix.util.SchemaUtil; +import org.junit.Assert; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) -//FIXME this test is never run by maven, as it has no @Category -public class IndexUpgradeToolIT extends BaseTest { +@Category(ParallelStatsDisabledTest.class) +public class IndexUpgradeToolIT extends ParallelStatsDisabledIT { public static final String VERIFY_COUNT_ASSERT_MESSAGE = "view-index count in system table doesn't match"; @@ -66,12 +60,6 @@ public class IndexUpgradeToolIT extends BaseTest { }); } -@BeforeClass -public static synchronized void setup() throws Exception { -Map props = Collections.emptyMap(); -setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator())); -} - @Test public void verifyViewAndViewIndexes() throws Exception { String tableName = generateUniqueName(); diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexWithDefaultValueIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexWithDefaultValueIT.java index a93f4abddf..d1827ae3d2 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexWithDefaultValueIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexWithDefaultValueIT.java @@ -19,6 +19,7 @@ package org.apache.phoenix.end2end; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.sql.Connection; import java.sql.DriverManager; @@ -30,7 +31,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertEquals; - +@Category(ParallelStatsDisabledTest.class) public class IndexWithDefaultValueIT extends ParallelStatsDisabledIT { @Test
Apache-Phoenix | 5.1 | HBase 2.1 | Build #226 FAILURE
5.1 branch HBase 2.1 build #226 status FAILURE Build #226 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/226/
Apache-Phoenix | master | HBase 2.5 | Build #531 FAILURE
master branch HBase 2.5 build #531 status FAILURE Build #531 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/531/
Apache-Phoenix | 5.1 | HBase 2.5 | Build #226 FAILURE
5.1 branch HBase 2.5 build #226 status FAILURE Build #226 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/226/
Apache-Phoenix-Connectors | Build #78 SUCCESS
build #78 status SUCCESS Build #78 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-connectors/78/
Apache-Phoenix | 5.1 | HBase 2.3 | Build #226 FAILURE
5.1 branch HBase 2.3 build #226 status FAILURE Build #226 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/226/
Apache-Phoenix | 5.1 | HBase 2.4 | Build #226 FAILURE
5.1 branch HBase 2.4 build #226 status FAILURE Build #226 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/226/
Apache-Phoenix | 5.1 | HBase 2.2 | Build #226 FAILURE
5.1 branch HBase 2.2 build #226 status FAILURE Build #226 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/226/
Apache-Phoenix | master | HBase 2.4 | Build #531 FAILURE
master branch HBase 2.4 build #531 status FAILURE Build #531 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/531/
[phoenix] branch 5.1 updated: PHOENIX-6944 Randomize mapper task ordering for Index MR tools
This is an automated email from the ASF dual-hosted git repository. stoty pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/5.1 by this push: new f6f0016c43 PHOENIX-6944 Randomize mapper task ordering for Index MR tools f6f0016c43 is described below commit f6f0016c439b4df39a01622eccf5d898c1a4ad96 Author: Istvan Toth AuthorDate: Fri Apr 28 08:16:35 2023 +0200 PHOENIX-6944 Randomize mapper task ordering for Index MR tools --- .../phoenix/mapreduce/PhoenixInputFormat.java | 129 + .../phoenix/mapreduce/PhoenixInputSplit.java | 21 ++-- .../phoenix/mapreduce/index/IndexScrutinyTool.java | 4 + .../apache/phoenix/mapreduce/index/IndexTool.java | 4 + .../mapreduce/util/PhoenixConfigurationUtil.java | 13 +++ 5 files changed, 114 insertions(+), 57 deletions(-) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java index c294fede6f..f9c93e0554 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java @@ -55,6 +55,7 @@ import java.sql.Statement; import java.util.Collections; import java.util.List; import java.util.Properties; +import java.util.concurrent.ThreadLocalRandom; /** * {@link InputFormat} implementation from Phoenix. @@ -87,74 +88,106 @@ public class PhoenixInputFormat extends InputFormat generateSplits(final QueryPlan qplan, Configuration config) throws IOException { +/** + * Randomise the length parameter of the splits to ensure random execution order. + * Yarn orders splits by size before execution. + * + * @param splits + */ +protected void randomizeSplitLength(List splits) { +LOGGER.info("Randomizing split size"); +if (splits.size() == 0) { +return; +} +double defaultLength = 100d; +double totalLength = splits.stream().mapToDouble(s -> { +try { +return (double) s.getLength(); +} catch (IOException | InterruptedException e1) { +return defaultLength; +} +}).sum(); +long avgLength = (long) (totalLength / splits.size()); +splits.stream().forEach(s -> ((PhoenixInputSplit) s) +.setLength(avgLength + ThreadLocalRandom.current().nextInt(1))); +} + +protected List generateSplits(final QueryPlan qplan, Configuration config) +throws IOException { // We must call this in order to initialize the scans and splits from the query plan setupParallelScansFromQueryPlan(qplan); final List splits = qplan.getSplits(); Preconditions.checkNotNull(splits); // Get the RegionSizeCalculator -try(org.apache.hadoop.hbase.client.Connection connection = - HBaseFactoryProvider.getHConnectionFactory().createConnection(config)) { -RegionLocator regionLocator = connection.getRegionLocator(TableName.valueOf(qplan -.getTableRef().getTable().getPhysicalName().toString())); -RegionSizeCalculator sizeCalculator = new RegionSizeCalculator(regionLocator, connection -.getAdmin()); +try (org.apache.hadoop.hbase.client.Connection connection = + HBaseFactoryProvider.getHConnectionFactory().createConnection(config)) { +RegionLocator regionLocator = +connection.getRegionLocator(TableName + .valueOf(qplan.getTableRef().getTable().getPhysicalName().toString())); +RegionSizeCalculator sizeCalculator = +new RegionSizeCalculator(regionLocator, connection.getAdmin()); -final List psplits = Lists.newArrayListWithExpectedSize(splits.size()); -for (List scans : qplan.getScans()) { -// Get the region location -HRegionLocation location = regionLocator.getRegionLocation( -scans.get(0).getStartRow(), -false -); +final List psplits = Lists.newArrayListWithExpectedSize(splits.size()); +for (List scans : qplan.getScans()) { +// Get the region location +HRegionLocation location = + regionLocator.getRegionLocation(scans.get(0).getStartRow(), false); -String regionLocation = location.getHostname(); +String regionLocation = location.getHostname(); -// Get the region size -long regionSize = sizeCalculator.getRegionSize( -location.getRegion().getRegionName() -); +// Get the region size +long regionSize = +
[phoenix] branch master updated: PHOENIX-6944 Randomize mapper task ordering for Index MR tools
This is an automated email from the ASF dual-hosted git repository. stoty pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/master by this push: new deb4694a73 PHOENIX-6944 Randomize mapper task ordering for Index MR tools deb4694a73 is described below commit deb4694a73170534bc49019b506cad0ef075c5c5 Author: Istvan Toth AuthorDate: Fri Apr 28 08:16:35 2023 +0200 PHOENIX-6944 Randomize mapper task ordering for Index MR tools --- .../phoenix/mapreduce/PhoenixInputFormat.java | 129 + .../phoenix/mapreduce/PhoenixInputSplit.java | 21 ++-- .../phoenix/mapreduce/index/IndexScrutinyTool.java | 4 + .../apache/phoenix/mapreduce/index/IndexTool.java | 4 + .../mapreduce/util/PhoenixConfigurationUtil.java | 12 ++ 5 files changed, 113 insertions(+), 57 deletions(-) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java index 4eeb158300..f9c93e0554 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java @@ -55,6 +55,7 @@ import java.sql.Statement; import java.util.Collections; import java.util.List; import java.util.Properties; +import java.util.concurrent.ThreadLocalRandom; /** * {@link InputFormat} implementation from Phoenix. @@ -87,74 +88,106 @@ public class PhoenixInputFormat extends InputFormat generateSplits(final QueryPlan qplan, Configuration config) throws IOException { +/** + * Randomise the length parameter of the splits to ensure random execution order. + * Yarn orders splits by size before execution. + * + * @param splits + */ +protected void randomizeSplitLength(List splits) { +LOGGER.info("Randomizing split size"); +if (splits.size() == 0) { +return; +} +double defaultLength = 100d; +double totalLength = splits.stream().mapToDouble(s -> { +try { +return (double) s.getLength(); +} catch (IOException | InterruptedException e1) { +return defaultLength; +} +}).sum(); +long avgLength = (long) (totalLength / splits.size()); +splits.stream().forEach(s -> ((PhoenixInputSplit) s) +.setLength(avgLength + ThreadLocalRandom.current().nextInt(1))); +} + +protected List generateSplits(final QueryPlan qplan, Configuration config) +throws IOException { // We must call this in order to initialize the scans and splits from the query plan setupParallelScansFromQueryPlan(qplan); final List splits = qplan.getSplits(); Preconditions.checkNotNull(splits); // Get the RegionSizeCalculator -try(org.apache.hadoop.hbase.client.Connection connection = - HBaseFactoryProvider.getHConnectionFactory().createConnection(config)) { -RegionLocator regionLocator = connection.getRegionLocator(TableName.valueOf(qplan -.getTableRef().getTable().getPhysicalName().toString())); -RegionSizeCalculator sizeCalculator = new RegionSizeCalculator(regionLocator, connection -.getAdmin()); +try (org.apache.hadoop.hbase.client.Connection connection = + HBaseFactoryProvider.getHConnectionFactory().createConnection(config)) { +RegionLocator regionLocator = +connection.getRegionLocator(TableName + .valueOf(qplan.getTableRef().getTable().getPhysicalName().toString())); +RegionSizeCalculator sizeCalculator = +new RegionSizeCalculator(regionLocator, connection.getAdmin()); -final List psplits = Lists.newArrayListWithExpectedSize(splits.size()); -for (List scans : qplan.getScans()) { -// Get the region location -HRegionLocation location = regionLocator.getRegionLocation( -scans.get(0).getStartRow(), -false -); +final List psplits = Lists.newArrayListWithExpectedSize(splits.size()); +for (List scans : qplan.getScans()) { +// Get the region location +HRegionLocation location = + regionLocator.getRegionLocation(scans.get(0).getStartRow(), false); -String regionLocation = location.getHostname(); +String regionLocation = location.getHostname(); -// Get the region size -long regionSize = sizeCalculator.getRegionSize( -location.getRegion().getRegionName() -); +// Get the region size +long regionSize = +
[phoenix-connectors] branch dependabot/maven/phoenix5-spark/com.google.protobuf-protobuf-java-3.16.3 created (now 7cfb33d)
This is an automated email from the ASF dual-hosted git repository. github-bot pushed a change to branch dependabot/maven/phoenix5-spark/com.google.protobuf-protobuf-java-3.16.3 in repository https://gitbox.apache.org/repos/asf/phoenix-connectors.git at 7cfb33d Bump protobuf-java from 2.5.0 to 3.16.3 in /phoenix5-spark No new revisions were added by this update.
[phoenix-connectors] branch dependabot/maven/phoenix5-hive/org.apache.calcite-calcite-core-1.32.0 created (now 940988f)
This is an automated email from the ASF dual-hosted git repository. github-bot pushed a change to branch dependabot/maven/phoenix5-hive/org.apache.calcite-calcite-core-1.32.0 in repository https://gitbox.apache.org/repos/asf/phoenix-connectors.git at 940988f Bump calcite-core from 1.16.0 to 1.32.0 in /phoenix5-hive No new revisions were added by this update.
[phoenix-connectors] branch dependabot/maven/org.apache.hadoop-hadoop-common-3.2.4 created (now 2be9806)
This is an automated email from the ASF dual-hosted git repository. github-bot pushed a change to branch dependabot/maven/org.apache.hadoop-hadoop-common-3.2.4 in repository https://gitbox.apache.org/repos/asf/phoenix-connectors.git at 2be9806 Bump hadoop-common from 3.0.3 to 3.2.4 No new revisions were added by this update.
[phoenix-connectors] branch master updated (bcc3819 -> c3bb91a)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/phoenix-connectors.git from bcc3819 PHOENIX-6922 Javadoc failure while building connectors with Java 11 add c3bb91a PHOENIX-6937 Remove the connectors for Phoenix 4.x (#101) No new revisions were added by this update. Summary of changes: phoenix-connectors-phoenix4-compat/pom.xml | 55 -- .../java/org/apache/phoenix/compat/CompatUtil.java | 60 -- phoenix-connectors-phoenix5-compat/pom.xml | 62 --- .../java/org/apache/phoenix/compat/CompatUtil.java | 60 -- phoenix-flume-base/phoenix4-flume/pom.xml | 59 -- phoenix-flume-base/phoenix5-flume/pom.xml | 69 --- phoenix-hive-base/phoenix4-hive-shaded/pom.xml | 141 - phoenix-hive-base/phoenix4-hive/pom.xml| 126 - .../org/apache/phoenix/compat/HiveCompatUtil.java | 123 - .../java/org/apache/phoenix/compat/MyResult.java | 39 -- .../AbstractPhoenixObjectInspector.java| 59 -- .../PhoenixDateObjectInspectorBase.java| 65 --- .../PhoenixTimestampObjectInspectorBase.java | 62 --- phoenix-hive-base/phoenix5-hive-shaded/pom.xml | 209 --- phoenix-hive-base/phoenix5-hive/pom.xml| 176 -- phoenix-hive-base/pom.xml | 615 - phoenix-kafka-base/phoenix4-kafka/pom.xml | 67 --- phoenix-kafka-base/phoenix5-kafka/pom.xml | 78 --- phoenix-spark-base/phoenix4-spark-shaded/pom.xml | 80 --- phoenix-spark-base/phoenix4-spark/pom.xml | 67 --- phoenix-spark-base/phoenix5-spark-shaded/pom.xml | 90 --- phoenix-spark-base/phoenix5-spark/pom.xml | 77 --- phoenix4-connectors-assembly/pom.xml | 172 -- .../src/build/components/phoenix4-jars.xml | 59 -- .../package-phoenix4-connectors-to-tar-all.xml | 36 -- phoenix5-connectors-assembly/pom.xml | 23 +- .../src/build/components/phoenix5-jars.xml | 16 +- {phoenix-flume-base => phoenix5-flume}/pom.xml | 37 +- .../apache/phoenix/flume/CsvEventSerializerIT.java | 0 .../phoenix/flume/JsonEventSerializerIT.java | 0 .../org/apache/phoenix/flume/PhoenixSinkIT.java| 9 +- .../phoenix/flume/RegexEventSerializerIT.java | 0 .../phoenix/flume/serializer/CustomSerializer.java | 0 .../apache/phoenix/flume/sink/NullPhoenixSink.java | 0 .../apache/phoenix/flume/DefaultKeyGenerator.java | 0 .../org/apache/phoenix/flume/FlumeConstants.java | 0 .../org/apache/phoenix/flume/KeyGenerator.java | 0 .../org/apache/phoenix/flume/SchemaHandler.java| 0 .../flume/serializer/BaseEventSerializer.java | 0 .../flume/serializer/CsvEventSerializer.java | 0 .../phoenix/flume/serializer/EventSerializer.java | 0 .../phoenix/flume/serializer/EventSerializers.java | 0 .../flume/serializer/JsonEventSerializer.java | 0 .../flume/serializer/RegexEventSerializer.java | 0 .../org/apache/phoenix/flume/sink/PhoenixSink.java | 0 .../pom.xml| 300 -- phoenix5-hive/pom.xml | 482 .../hadoop/hive/ql/QTestProcessExecResult.java | 0 .../java/org/apache/hadoop/hive/ql/QTestUtil.java | 16 +- .../hive/ql/security/DummyAuthenticator.java | 0 .../phoenix/hive/BaseHivePhoenixStoreIT.java | 0 .../org/apache/phoenix/hive/HiveMapReduceIT.java | 0 .../apache/phoenix/hive/HivePhoenixStoreIT.java| 0 .../java/org/apache/phoenix/hive/HiveTestUtil.java | 0 .../it/java/org/apache/phoenix/hive/HiveTezIT.java | 0 .../org/apache/phoenix/compat/HiveCompatUtil.java | 0 .../java/org/apache/phoenix/compat/MyResult.java | 0 .../org/apache/phoenix/hive/PhoenixMetaHook.java | 0 .../apache/phoenix/hive/PhoenixRecordUpdater.java | 0 .../java/org/apache/phoenix/hive/PhoenixRow.java | 0 .../org/apache/phoenix/hive/PhoenixRowKey.java | 0 .../java/org/apache/phoenix/hive/PhoenixSerDe.java | 0 .../org/apache/phoenix/hive/PhoenixSerializer.java | 3 +- .../apache/phoenix/hive/PhoenixStorageHandler.java | 0 .../org/apache/phoenix/hive/PrimaryKeyData.java| 0 .../constants/PhoenixStorageHandlerConstants.java | 0 .../phoenix/hive/mapreduce/PhoenixInputFormat.java | 5 +- .../phoenix/hive/mapreduce/PhoenixInputSplit.java | 0 .../hive/mapreduce/PhoenixOutputFormat.java| 0 .../hive/mapreduce/PhoenixRecordReader.java| 0 .../hive/mapreduce/PhoenixRecordWriter.java| 0 .../hive/mapreduce/PhoenixResultWritable.java | 0 .../AbstractPhoenixObjectInspector.java| 0 .../PhoenixBinaryObjectInspector.java | 0 .../PhoenixBooleanObjectInspector.java | 0 .../PhoenixByteObjectInspector.java|