Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KYLIN-4833 create hfile on hadoop hdfs and distcp to hbase hdfs #1494

Merged
merged 2 commits into from
Jan 4, 2021

Conversation

fengpod
Copy link

@fengpod fengpod commented Dec 2, 2020

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce to Kylin?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have create an issue on Kylin's jira, and have described the bug/feature there in detail
  • Commit messages in my PR start with the related jira ID, like "KYLIN-0000 Make Kylin project open-source"
  • Compiling and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • If this change need a document change, I will prepare another pr against the document branch
  • Any dependent changes have been merged

Further comments

If this is a relatively large or complex change, kick off the discussion at user@kylin or dev@kylin by explaining why you chose the solution you did and what alternatives you considered, etc...

@fengpod
Copy link
Author

fengpod commented Dec 2, 2020

When a large data is written to hbase cluster at the same time,the cluster load will become very high,which will affect the query performance. This pr allows data to be written data to hadoop hdfs when doing step “Convert Cuboid Data to HFile”,and then hfile will be transferred to the hbase cluster by DistCp。DistCp controls the speed of write data so as to reduce the pressure of cluster。 This pr adds a new step " HFile Distcp To HBase" between “Convert Cuboid Data to HFile” and "Load HFile to HBase Table" 。As look like this:
image

@fengpod fengpod changed the title create hfile on hadoop hdfs and distcp to hbase hdfs KYLIN-4833 create hfile on hadoop hdfs and distcp to hbase hdfs Dec 2, 2020
@coveralls
Copy link

coveralls commented Dec 2, 2020

Pull Request Test Coverage Report for Build 6684

  • 0 of 93 (0.0%) changed or added relevant lines in 9 files are covered.
  • 299 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.06%) to 27.972%

Changes Missing Coverage Covered Lines Changed/Added Lines %
storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HDFSPathGarbageCollectionStep.java 0 2 0.0%
core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java 0 3 0.0%
storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseFlinkOutputTransition.java 0 4 0.0%
storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseSparkOutputTransition.java 0 4 0.0%
storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMROutput2Transition.java 0 6 0.0%
storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseFlinkSteps.java 0 8 0.0%
storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMRSteps.java 0 8 0.0%
storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseJobSteps.java 0 19 0.0%
storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HFileDistcpJob.java 0 39 0.0%
Files with Coverage Reduction New Missed Lines %
core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java 1 13.57%
core-cube/src/main/java/org/apache/kylin/cube/cuboid/TreeCuboidScheduler.java 2 68.46%
engine-spark/src/main/java/org/apache/kylin/engine/spark/SparkCubingByLayer.java 56 0%
core-common/src/main/java/org/apache/kylin/common/KylinConfig.java 91 42.66%
tool/src/main/java/org/apache/kylin/tool/CubeMigrationCLI.java 149 0%
Totals Coverage Status
Change from base Build 6595: -0.06%
Covered Lines: 26258
Relevant Lines: 93871

💛 - Coveralls

@hit-lacus
Copy link
Member

This is a good idea. @guangxuCheng , would you like to have a look ?


appendMapReduceParameters(cmd);
appendExecCmdParameters(cmd, BatchConstants.ARG_CUBE_NAME, seg.getRealization().getName());
// appendExecCmdParameters(cmd, BatchConstants.ARG_PARTITION, getRowkeyDistributionOutputPath(jobId) + "/part-r-00000_hfile");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented code if not needed , will help in code readability going forward.

@@ -91,7 +91,8 @@ private void dropHdfsPathOnCluster(List<String> oldHdfsPaths, FileSystem fileSys
}
// If hbase was deployed on another cluster, the job dir is empty and should be dropped,
// because of rowkey_stats and hfile dirs are both dropped.
if (fileSystem.listStatus(oldPath.getParent()).length == 0) {
Path parentPath = oldPath.getParent();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to use final if variable is not mutated : final Path parentPath

Configuration configuration = new Configuration();
HBaseConnection.addHBaseClusterNNHAConfiguration(configuration);

Path input = new Path(getOptionValue(OPTION_INPUT_PATH));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to change to final

String partitionOutputPath = getRealizationRootPath(jobId) + "/rowkey_stats/part-r-00000_hfile";
appendExecCmdParameters(cmd, BatchConstants.ARG_PARTITION, partitionOutputPath);
}else {
appendExecCmdParameters(cmd, BatchConstants.ARG_PARTITION,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Append paramters twice for BatchConstants.ARG_PARTITION .

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new commit fixed this

@codecov-io
Copy link

Codecov Report

Merging #1494 (d37b1e7) into master (3e12b6d) will decrease coverage by 0.08%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1494      +/-   ##
============================================
- Coverage     25.51%   25.43%   -0.09%     
+ Complexity     6765     6764       -1     
============================================
  Files          1505     1508       +3     
  Lines         93618    93871     +253     
  Branches      13111    13144      +33     
============================================
- Hits          23886    23873      -13     
- Misses        67356    67617     +261     
- Partials       2376     2381       +5     
Impacted Files Coverage Δ Complexity Δ
.../java/org/apache/kylin/common/KylinConfigBase.java 12.46% <0.00%> (-0.10%) 51.00 <0.00> (ø)
...torage/hbase/steps/HBaseFlinkOutputTransition.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...che/kylin/storage/hbase/steps/HBaseFlinkSteps.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...pache/kylin/storage/hbase/steps/HBaseJobSteps.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../storage/hbase/steps/HBaseMROutput2Transition.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...apache/kylin/storage/hbase/steps/HBaseMRSteps.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...torage/hbase/steps/HBaseSparkOutputTransition.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...age/hbase/steps/HDFSPathGarbageCollectionStep.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ache/kylin/storage/hbase/steps/HFileDistcpJob.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
.../apache/kylin/tool/query/ProbabilityGenerator.java 71.05% <0.00%> (-5.27%) 11.00% <0.00%> (ø%)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e12b6d...d37b1e7. Read the comment docs.

Copy link
Member

@hit-lacus hit-lacus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@hit-lacus hit-lacus merged commit 804334f into apache:master Jan 4, 2021
hit-lacus pushed a commit to hit-lacus/kylin that referenced this pull request Apr 19, 2021
…he#1494)

* create hfile on hadoop hdfs and distcp to hbase hdfs

* code style

Co-authored-by: zhangrusong <zhangrusong@ke.com>
zhangayqian pushed a commit that referenced this pull request Nov 5, 2021
* create hfile on hadoop hdfs and distcp to hbase hdfs

* code style

Co-authored-by: zhangrusong <zhangrusong@ke.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants