[2/5] phoenix git commit: Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from indexTool
Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from indexTool Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/670e14fc Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/670e14fc Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/670e14fc Branch: refs/heads/4.x-cdh5.14 Commit: 670e14fc109d8580e88adf9f97b725ef32042f88 Parents: 3768da3 Author: Xu CangAuthored: Tue May 8 00:21:46 2018 +0100 Committer: Pedro Boado Committed: Sun May 13 10:45:44 2018 +0100 -- .../phoenix/mapreduce/index/IndexTool.java | 6 ++-- .../index/automation/PhoenixAsyncIndex.java | 2 +- .../index/automation/PhoenixMRJobSubmitter.java | 2 +- .../index/automated/MRJobSubmitterTest.java | 30 +++- 4 files changed, 28 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java index 671e4cf..e3aa729 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java @@ -123,7 +123,7 @@ public class IndexTool extends Configured implements Tool { private static final Option SNAPSHOT_OPTION = new Option("snap", "snapshot", false, "If specified, uses Snapshots for async index building (optional)"); private static final Option HELP_OPTION = new Option("h", "help", false, "Help"); -public static final String INDEX_JOB_NAME_TEMPLATE = "PHOENIX_%s_INDX_%s"; +public static final String INDEX_JOB_NAME_TEMPLATE = "PHOENIX_%s.%s_INDX_%s"; private Options getOptions() { final Options options = new Options(); @@ -373,9 +373,9 @@ public class IndexTool extends Configured implements Tool { PhoenixRuntime.generateColumnInfo(connection, qIndexTable, indexColumns); ColumnInfoToStringEncoderDecoder.encode(configuration, columnMetadataList); fs = outputPath.getFileSystem(configuration); -fs.delete(outputPath, true); +fs.delete(outputPath, true); -final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, pdataTable.getName().toString(), indexTable); +final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, schemaName, dataTable, indexTable); final Job job = Job.getInstance(configuration, jobName); job.setJarByClass(IndexTool.class); job.setMapOutputKeyClass(ImmutableBytesWritable.class); http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java index 3e88cd0..a61e49a 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java @@ -59,7 +59,7 @@ public class PhoenixAsyncIndex { } public String getJobName() { -return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, dataTableName, tableName); +return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, tableSchem, dataTableName, tableName); } @Override http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java index d86802a..3e20bd2 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java @@ -216,7 +216,7 @@ public class PhoenixMRJobSubmitter { indexInfo.setTableSchem(rs.getString(PhoenixDatabaseMetaData.TABLE_SCHEM)); indexInfo.setTableName(rs.getString(PhoenixDatabaseMetaData.TABLE_NAME));
[2/5] phoenix git commit: Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from indexTool
Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from indexTool Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/670e14fc Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/670e14fc Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/670e14fc Branch: refs/heads/4.x-cdh5.12 Commit: 670e14fc109d8580e88adf9f97b725ef32042f88 Parents: 3768da3 Author: Xu CangAuthored: Tue May 8 00:21:46 2018 +0100 Committer: Pedro Boado Committed: Sun May 13 10:45:44 2018 +0100 -- .../phoenix/mapreduce/index/IndexTool.java | 6 ++-- .../index/automation/PhoenixAsyncIndex.java | 2 +- .../index/automation/PhoenixMRJobSubmitter.java | 2 +- .../index/automated/MRJobSubmitterTest.java | 30 +++- 4 files changed, 28 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java index 671e4cf..e3aa729 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java @@ -123,7 +123,7 @@ public class IndexTool extends Configured implements Tool { private static final Option SNAPSHOT_OPTION = new Option("snap", "snapshot", false, "If specified, uses Snapshots for async index building (optional)"); private static final Option HELP_OPTION = new Option("h", "help", false, "Help"); -public static final String INDEX_JOB_NAME_TEMPLATE = "PHOENIX_%s_INDX_%s"; +public static final String INDEX_JOB_NAME_TEMPLATE = "PHOENIX_%s.%s_INDX_%s"; private Options getOptions() { final Options options = new Options(); @@ -373,9 +373,9 @@ public class IndexTool extends Configured implements Tool { PhoenixRuntime.generateColumnInfo(connection, qIndexTable, indexColumns); ColumnInfoToStringEncoderDecoder.encode(configuration, columnMetadataList); fs = outputPath.getFileSystem(configuration); -fs.delete(outputPath, true); +fs.delete(outputPath, true); -final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, pdataTable.getName().toString(), indexTable); +final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, schemaName, dataTable, indexTable); final Job job = Job.getInstance(configuration, jobName); job.setJarByClass(IndexTool.class); job.setMapOutputKeyClass(ImmutableBytesWritable.class); http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java index 3e88cd0..a61e49a 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java @@ -59,7 +59,7 @@ public class PhoenixAsyncIndex { } public String getJobName() { -return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, dataTableName, tableName); +return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, tableSchem, dataTableName, tableName); } @Override http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java index d86802a..3e20bd2 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java @@ -216,7 +216,7 @@ public class PhoenixMRJobSubmitter { indexInfo.setTableSchem(rs.getString(PhoenixDatabaseMetaData.TABLE_SCHEM)); indexInfo.setTableName(rs.getString(PhoenixDatabaseMetaData.TABLE_NAME));
[2/5] phoenix git commit: Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from indexTool
Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from indexTool Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/670e14fc Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/670e14fc Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/670e14fc Branch: refs/heads/4.x-cdh5.13 Commit: 670e14fc109d8580e88adf9f97b725ef32042f88 Parents: 3768da3 Author: Xu CangAuthored: Tue May 8 00:21:46 2018 +0100 Committer: Pedro Boado Committed: Sun May 13 10:45:44 2018 +0100 -- .../phoenix/mapreduce/index/IndexTool.java | 6 ++-- .../index/automation/PhoenixAsyncIndex.java | 2 +- .../index/automation/PhoenixMRJobSubmitter.java | 2 +- .../index/automated/MRJobSubmitterTest.java | 30 +++- 4 files changed, 28 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java index 671e4cf..e3aa729 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java @@ -123,7 +123,7 @@ public class IndexTool extends Configured implements Tool { private static final Option SNAPSHOT_OPTION = new Option("snap", "snapshot", false, "If specified, uses Snapshots for async index building (optional)"); private static final Option HELP_OPTION = new Option("h", "help", false, "Help"); -public static final String INDEX_JOB_NAME_TEMPLATE = "PHOENIX_%s_INDX_%s"; +public static final String INDEX_JOB_NAME_TEMPLATE = "PHOENIX_%s.%s_INDX_%s"; private Options getOptions() { final Options options = new Options(); @@ -373,9 +373,9 @@ public class IndexTool extends Configured implements Tool { PhoenixRuntime.generateColumnInfo(connection, qIndexTable, indexColumns); ColumnInfoToStringEncoderDecoder.encode(configuration, columnMetadataList); fs = outputPath.getFileSystem(configuration); -fs.delete(outputPath, true); +fs.delete(outputPath, true); -final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, pdataTable.getName().toString(), indexTable); +final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, schemaName, dataTable, indexTable); final Job job = Job.getInstance(configuration, jobName); job.setJarByClass(IndexTool.class); job.setMapOutputKeyClass(ImmutableBytesWritable.class); http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java index 3e88cd0..a61e49a 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java @@ -59,7 +59,7 @@ public class PhoenixAsyncIndex { } public String getJobName() { -return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, dataTableName, tableName); +return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, tableSchem, dataTableName, tableName); } @Override http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java index d86802a..3e20bd2 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java @@ -216,7 +216,7 @@ public class PhoenixMRJobSubmitter { indexInfo.setTableSchem(rs.getString(PhoenixDatabaseMetaData.TABLE_SCHEM)); indexInfo.setTableName(rs.getString(PhoenixDatabaseMetaData.TABLE_NAME));