You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by jl...@apache.org on 2021/11/11 22:44:13 UTC
[pinot] branch handle-null-segment-lineage created (now 31fe098)
This is an automated email from the ASF dual-hosted git repository.
jlli pushed a change to branch handle-null-segment-lineage
in repository https://gitbox.apache.org/repos/asf/pinot.git.
at 31fe098 Handle null segment lineage ZNRecord for getSelectedSegments API
This branch includes the following new commits:
new 31fe098 Handle null segment lineage ZNRecord for getSelectedSegments API
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[pinot] 01/01: Handle null segment lineage ZNRecord for
getSelectedSegments API
Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jlli pushed a commit to branch handle-null-segment-lineage
in repository https://gitbox.apache.org/repos/asf/pinot.git
commit 31fe0984bfdeec4277e61ad1c0d64c593e50defc
Author: Jack Li(Analytics Engineering) <jl...@jlli-mn1.linkedin.biz>
AuthorDate: Thu Nov 11 14:43:05 2021 -0800
Handle null segment lineage ZNRecord for getSelectedSegments API
---
.../controller/helix/core/PinotHelixResourceManager.java | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
index 71d3ede..5d1282b 100644
--- a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
+++ b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
@@ -620,10 +620,14 @@ public class PinotHelixResourceManager {
// Fetch the segment lineage metadata, and filter segments based on segment lineage.
ZNRecord segmentLineageZNRecord =
SegmentLineageAccessHelper.getSegmentLineageZNRecord(_propertyStore, tableNameWithType);
- SegmentLineage segmentLineage = SegmentLineage.fromZNRecord(segmentLineageZNRecord);
- Set<String> selectedSegmentSet = new HashSet<>(selectedSegments);
- SegmentLineageUtils.filterSegmentsBasedOnLineageInPlace(selectedSegmentSet, segmentLineage);
- return new ArrayList<>(selectedSegmentSet);
+ if (segmentLineageZNRecord == null) {
+ return selectedSegments;
+ } else {
+ SegmentLineage segmentLineage = SegmentLineage.fromZNRecord(segmentLineageZNRecord);
+ Set<String> selectedSegmentSet = new HashSet<>(selectedSegments);
+ SegmentLineageUtils.filterSegmentsBasedOnLineageInPlace(selectedSegmentSet, segmentLineage);
+ return new ArrayList<>(selectedSegmentSet);
+ }
}
/**
@@ -3049,7 +3053,7 @@ public class PinotHelixResourceManager {
}
return hosts;
}
-
+
/*
* Uncomment and use for testing on a real cluster
public static void main(String[] args) throws Exception {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org