[GitHub] carbondata pull request #2091: [CARBONDATA-2258] Separate visible and invisi...

classic Classic list List threaded Threaded
35 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2091: [CARBONDATA-2258] Separate visible and invisible seg...

qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2091
 
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4043/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2091: [CARBONDATA-2258] Separate visible and invisible seg...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2091
 
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4044/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2091: [CARBONDATA-2258] Separate visible and invisible seg...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user zzcclp commented on the issue:

    https://github.com/apache/carbondata/pull/2091
 
    retest this please


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2091: [CARBONDATA-2258] Separate visible and invisible seg...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2091
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/4549/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2091: [CARBONDATA-2258] Separate visible and invisible seg...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2091
 
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/3322/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2091: [CARBONDATA-2258] Separate visible and invisible seg...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user zzcclp commented on the issue:

    https://github.com/apache/carbondata/pull/2091
 
    @jackylk @ravipesala  please help to review, thanks


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2091: [CARBONDATA-2258] Separate visible and invisi...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2091#discussion_r176903880
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/constants/CarbonCommonConstants.java ---
    @@ -1602,8 +1602,20 @@
       // default value is 2 days
       public static final String CARBON_SEGMENT_LOCK_FILES_PRESERVE_HOURS_DEFAULT = "48";
     
    +  /**
    +   * The number of invisible segment info which will be preserved in tablestatus file,
    +   * if it exceeds this value, they will be removed and write to tablestatus.history file.
    +   */
    +  @CarbonProperty
    +  public static final String CARBON_INVISIBLE_SEGMENTS_PRESERVE_COUNT =
    +      "carbon.invisible.segments.preserve.count";
    +
    +  /**
    +   * default value is 20, it means that it will preserve 20 invisible segment info
    --- End diff --
   
    The default is 200 right. Please update comment


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2091: [CARBONDATA-2258] Separate visible and invisi...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2091#discussion_r176903993
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java ---
    @@ -913,4 +950,91 @@ public static void deleteLoadsAndUpdateMetadata(
         CarbonLockUtil.deleteExpiredSegmentLockFiles(carbonTable);
       }
     
    +  /**
    +   * Get the number of invisible segment info from segment info list.
    +   */
    +  public static int countInvisibleSegments(LoadMetadataDetails[] segmentList) {
    +    int invisibleSegmentCnt = 0;
    +    if (segmentList.length != 0) {
    +      for (LoadMetadataDetails eachSeg : segmentList) {
    +        // can not remove segment 0, there are some info will be used later
    +        // for example: updateStatusFileName
    +        if (!eachSeg.getLoadName().equalsIgnoreCase("0")
    +            && eachSeg.getVisibility().equalsIgnoreCase("false")) {
    +          invisibleSegmentCnt += 1;
    +        }
    +      }
    +    }
    +    return invisibleSegmentCnt;
    +  }
    +
    +  private static class TableStatusReturnTuple {
    +    LoadMetadataDetails[] arrayOfLoadDetails;
    +    LoadMetadataDetails[] arrayOfLoadHistoryDetails;
    +    TableStatusReturnTuple(LoadMetadataDetails[] arrayOfLoadDetails,
    +        LoadMetadataDetails[] arrayOfLoadHistoryDetails) {
    +      this.arrayOfLoadDetails = arrayOfLoadDetails;
    +      this.arrayOfLoadHistoryDetails = arrayOfLoadHistoryDetails;
    +    }
    +  }
    +
    +  /**
    +   * Separate visible and invisible segments into two array.
    +   */
    +  public static TableStatusReturnTuple separateVisibleAndInvisibleSegments(
    +      LoadMetadataDetails[] oldList,
    +      LoadMetadataDetails[] newList,
    +      int invisibleSegmentCnt) {
    +    int newSegmentsLength = newList.length;
    +    int visibleSegmentCnt = newSegmentsLength - invisibleSegmentCnt;
    +    LoadMetadataDetails[] arrayOfVisibleSegments = new LoadMetadataDetails[visibleSegmentCnt];
    +    LoadMetadataDetails[] arrayOfInvisibleSegments = new LoadMetadataDetails[invisibleSegmentCnt];
    +    int oldSegmentsLength = oldList.length;
    +    int visibleIdx = 0;
    +    int invisibleIdx = 0;
    +    for (int i = 0; i < newSegmentsLength; i++) {
    +      LoadMetadataDetails newSegment = newList[i];
    +      if (i < oldSegmentsLength) {
    +        LoadMetadataDetails oldSegment = oldList[i];
    +        if (newSegment.getLoadName().equalsIgnoreCase("0")) {
    +          newSegment.setVisibility(oldSegment.getVisibility());
    +          arrayOfVisibleSegments[visibleIdx] = newSegment;
    +          visibleIdx++;
    +        } else if ("false".equalsIgnoreCase(oldSegment.getVisibility())) {
    +          newSegment.setVisibility("false");
    +          arrayOfInvisibleSegments[invisibleIdx] = newSegment;
    +          invisibleIdx++;
    +        } else {
    +          arrayOfVisibleSegments[visibleIdx] = newSegment;
    +          visibleIdx++;
    +        }
    +      } else {
    +        arrayOfVisibleSegments[visibleIdx] = newSegment;
    +        visibleIdx++;
    +      }
    +    }
    +    return new TableStatusReturnTuple(arrayOfVisibleSegments, arrayOfInvisibleSegments);
    +  }
    +
    +  /**
    +   * Append new invisible segment info to old list.
    --- End diff --
   
    change to `Pick all invisible segment entries in appendList and add them into historyList`


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2091: [CARBONDATA-2258] Separate visible and invisi...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user zzcclp commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2091#discussion_r176907586
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/constants/CarbonCommonConstants.java ---
    @@ -1602,8 +1602,20 @@
       // default value is 2 days
       public static final String CARBON_SEGMENT_LOCK_FILES_PRESERVE_HOURS_DEFAULT = "48";
     
    +  /**
    +   * The number of invisible segment info which will be preserved in tablestatus file,
    +   * if it exceeds this value, they will be removed and write to tablestatus.history file.
    +   */
    +  @CarbonProperty
    +  public static final String CARBON_INVISIBLE_SEGMENTS_PRESERVE_COUNT =
    +      "carbon.invisible.segments.preserve.count";
    +
    +  /**
    +   * default value is 20, it means that it will preserve 20 invisible segment info
    --- End diff --
   
    Done


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2091: [CARBONDATA-2258] Separate visible and invisi...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user zzcclp commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2091#discussion_r176907591
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java ---
    @@ -913,4 +950,91 @@ public static void deleteLoadsAndUpdateMetadata(
         CarbonLockUtil.deleteExpiredSegmentLockFiles(carbonTable);
       }
     
    +  /**
    +   * Get the number of invisible segment info from segment info list.
    +   */
    +  public static int countInvisibleSegments(LoadMetadataDetails[] segmentList) {
    +    int invisibleSegmentCnt = 0;
    +    if (segmentList.length != 0) {
    +      for (LoadMetadataDetails eachSeg : segmentList) {
    +        // can not remove segment 0, there are some info will be used later
    +        // for example: updateStatusFileName
    +        if (!eachSeg.getLoadName().equalsIgnoreCase("0")
    +            && eachSeg.getVisibility().equalsIgnoreCase("false")) {
    +          invisibleSegmentCnt += 1;
    +        }
    +      }
    +    }
    +    return invisibleSegmentCnt;
    +  }
    +
    +  private static class TableStatusReturnTuple {
    +    LoadMetadataDetails[] arrayOfLoadDetails;
    +    LoadMetadataDetails[] arrayOfLoadHistoryDetails;
    +    TableStatusReturnTuple(LoadMetadataDetails[] arrayOfLoadDetails,
    +        LoadMetadataDetails[] arrayOfLoadHistoryDetails) {
    +      this.arrayOfLoadDetails = arrayOfLoadDetails;
    +      this.arrayOfLoadHistoryDetails = arrayOfLoadHistoryDetails;
    +    }
    +  }
    +
    +  /**
    +   * Separate visible and invisible segments into two array.
    +   */
    +  public static TableStatusReturnTuple separateVisibleAndInvisibleSegments(
    +      LoadMetadataDetails[] oldList,
    +      LoadMetadataDetails[] newList,
    +      int invisibleSegmentCnt) {
    +    int newSegmentsLength = newList.length;
    +    int visibleSegmentCnt = newSegmentsLength - invisibleSegmentCnt;
    +    LoadMetadataDetails[] arrayOfVisibleSegments = new LoadMetadataDetails[visibleSegmentCnt];
    +    LoadMetadataDetails[] arrayOfInvisibleSegments = new LoadMetadataDetails[invisibleSegmentCnt];
    +    int oldSegmentsLength = oldList.length;
    +    int visibleIdx = 0;
    +    int invisibleIdx = 0;
    +    for (int i = 0; i < newSegmentsLength; i++) {
    +      LoadMetadataDetails newSegment = newList[i];
    +      if (i < oldSegmentsLength) {
    +        LoadMetadataDetails oldSegment = oldList[i];
    +        if (newSegment.getLoadName().equalsIgnoreCase("0")) {
    +          newSegment.setVisibility(oldSegment.getVisibility());
    +          arrayOfVisibleSegments[visibleIdx] = newSegment;
    +          visibleIdx++;
    +        } else if ("false".equalsIgnoreCase(oldSegment.getVisibility())) {
    +          newSegment.setVisibility("false");
    +          arrayOfInvisibleSegments[invisibleIdx] = newSegment;
    +          invisibleIdx++;
    +        } else {
    +          arrayOfVisibleSegments[visibleIdx] = newSegment;
    +          visibleIdx++;
    +        }
    +      } else {
    +        arrayOfVisibleSegments[visibleIdx] = newSegment;
    +        visibleIdx++;
    +      }
    +    }
    +    return new TableStatusReturnTuple(arrayOfVisibleSegments, arrayOfInvisibleSegments);
    +  }
    +
    +  /**
    +   * Append new invisible segment info to old list.
    --- End diff --
   
    Done


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2091: [CARBONDATA-2258] Separate visible and invisible seg...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2091
 
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/3339/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2091: [CARBONDATA-2258] Separate visible and invisible seg...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2091
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/4565/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2091: [CARBONDATA-2258] Separate visible and invisible seg...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2091
 
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4061/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2091: [CARBONDATA-2258] Separate visible and invisible seg...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on the issue:

    https://github.com/apache/carbondata/pull/2091
 
    LGTM


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2091: [CARBONDATA-2258] Separate visible and invisi...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user asfgit closed the pull request at:

    https://github.com/apache/carbondata/pull/2091


---
12