Skip to content

Conversation

@timmylicheng
Copy link
Contributor

@timmylicheng timmylicheng commented Oct 15, 2019

NOTICE

https://issues.apache.org/jira/browse/HDDS-1569
related PR: apache/hadoop#1431

Changes:

  1. Use PipelinePlacementPolicy as default for Factor THREE Ratis pipeline.
  2. Handle differently in some parts for Factor ONE and Factor THREE pipeline.
  3. Add limits for pipeline creation.
  4. Adjust a bunch of unit tests accordingly.

@timmylicheng
Copy link
Contributor Author

/retest

@timmylicheng
Copy link
Contributor Author

/retest

@timmylicheng
Copy link
Contributor Author

/retest

@timmylicheng timmylicheng force-pushed the HDDS-1569 branch 2 times, most recently from 7dc00e8 to dffbd1b Compare October 22, 2019 12:07
@timmylicheng
Copy link
Contributor Author

/retest

Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to add the dn->pipelineId in 75 since line 73 already add it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Line 73 is adding v to new keyset when key is absent and line 75 is adding v to the existing keyset. Reason why we don't have to have extra if here is computeIfAbsent and computeIfPresent are both judging if key is present or not. So we don't have to see if Map.get(k) is null.

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct me if I'm wrong, dn2ObjectMap.computeIfAbsent(dnId, k -> ConcurrentHashMap.newKeySet()) ensures for a dnId we will have a KeySet().

Then the returned value (KeySet) allows line 73 to continue the operation to add pipeline id with a .add(pipeline.getId).

JDK document can be found here: https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#computeIfAbsent-K-java.util.function.Function-

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea. Line 75 is for when we already one existing keyset. For multi pipeline case, the keyset may be created by previous pipeline allocation and the new one would just be added into the existing keyset.

Copy link
Contributor

Choose a reason for hiding this comment

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

The document says existing value(keyset) will be returned. So the line 74-75 is not necessary.

Returns:
the current (existing or computed) value associated with the specified key,

A good example can be found here: https://stackoverflow.com/a/39268896

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. Thanks for the tipping. Based on the example here, Shall I update the removePipeline method? I'm making a change and please take a look.

Copy link
Contributor

@xiaoyuyao xiaoyuyao left a comment

Choose a reason for hiding this comment

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

LGTM overall. A few comments added inline...

@timmylicheng timmylicheng force-pushed the HDDS-1569 branch 2 times, most recently from bb51565 to 8600ad9 Compare October 24, 2019 06:32
@xiaoyuyao
Copy link
Contributor

+1, pending CI. Thanks for the update @timmylicheng

@xiaoyuyao xiaoyuyao merged commit 22570c4 into apache:HDDS-1564 Oct 29, 2019
ChenSammi pushed a commit that referenced this pull request Nov 4, 2019
timmylicheng added a commit to timmylicheng/hadoop-ozone that referenced this pull request Nov 25, 2019
@timmylicheng timmylicheng deleted the HDDS-1569 branch November 27, 2019 14:25
ChenSammi pushed a commit that referenced this pull request Dec 3, 2019
timmylicheng added a commit to timmylicheng/hadoop-ozone that referenced this pull request Dec 23, 2019
timmylicheng added a commit to timmylicheng/hadoop-ozone that referenced this pull request Jan 7, 2020
timmylicheng added a commit to timmylicheng/hadoop-ozone that referenced this pull request Feb 10, 2020
timmylicheng added a commit to timmylicheng/hadoop-ozone that referenced this pull request Feb 12, 2020
anuengineer pushed a commit that referenced this pull request Feb 19, 2020
* HDDS-1577. Add default pipeline placement policy implementation. (#1366)



(cherry picked from commit b640a5f6d53830aee4b9c2a7d17bf57c987962cd)

* HDDS-1571. Create an interface for pipeline placement policy to support network topologies. (#1395)

(cherry picked from commit 753fc6703a39154ed6013e44dbae572391748906)

* HDDS-2089: Add createPipeline CLI. (#1418)

(cherry picked from commit 326b5acd4a63fe46821919322867f5daff30750c)

* HDDS-1569 Support creating multiple pipelines with same datanode. Contributed by Li Cheng. 

This closes #28

* HDDS-1572 Implement a Pipeline scrubber to clean up non-OPEN pipeline. (#237)

* Rebase Fix

* HDDS-2650 Fix createPipeline CLI. (#340)

* HDDS-2035 Implement datanode level CLI to reveal pipeline relation. (#348)

* Revert "HDDS-2650 Fix createPipeline CLI. (#340)"

This reverts commit 7c71710.

* HDDS-2650 Fix createPipeline CLI and make it message based. (#370)

* HDDS-1574 Average out pipeline allocation on datanodes and add metrcs/test (#291)

* Resolve rebase conflict.

* HDDS-2756. Handle pipeline creation failure in different way when it exceeds pipeline limit

Closes #401

* HDDS-2115 Add acceptance test for createPipeline CLI and datanode list CLI (#375)

* HDDS-2115 Add acceptance test for createPipeline CLI and datanode list CLI.

* HDDS-2772 Better management for pipeline creation limitation. (#410)

*  HDDS-2913 Update config names and CLI for multi-raft feature. (#462)

* HDDS-2924. Fix Pipeline#nodeIdsHash collision issue. (#478)

* HDDS-2923 Add fall-back protection for rack awareness in pipeline creation. (#516)

* HDDS-3007 Fix CI test failure for TestSCMNodeManager. (#550)

Co-authored-by: Sammi Chen <[email protected]>
Co-authored-by: Xiaoyu Yao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants