carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject carbondata git commit: [CARBONDATA-1761]do not change status of segment during delete segment by ID to marked for delete if it is In progress
Date Wed, 06 Dec 2017 15:19:45 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 95b9208aa -> 38b53fefb


[CARBONDATA-1761]do not change status of segment during delete segment by ID to marked for
delete if it is In progress

Do not change status of segment to marked for delete if it is in progress

This closed #1608


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/38b53fef
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/38b53fef
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/38b53fef

Branch: refs/heads/master
Commit: 38b53fefbf0277595f758829b8010e542813783b
Parents: 95b9208
Author: akashrn5 <akashnilugal@gmail.com>
Authored: Mon Dec 4 18:01:18 2017 +0530
Committer: Jacky Li <jacky.likun@qq.com>
Committed: Wed Dec 6 23:19:29 2017 +0800

----------------------------------------------------------------------
 .../core/statusmanager/SegmentStatusManager.java       | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/38b53fef/core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java
b/core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java
old mode 100644
new mode 100755
index aea9110..6d96219
--- a/core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java
+++ b/core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java
@@ -493,6 +493,19 @@ public class SegmentStatusManager {
             invalidLoadIds.add(loadId);
             return invalidLoadIds;
           }
+          // if the segment status is in progress then no need to delete that.
+          if (SegmentStatus.INSERT_IN_PROGRESS == loadMetadata.getSegmentStatus()) {
+            LOG.error("Cannot delete the segment " + loadId + " which is load in progress");
+            invalidLoadIds.add(loadId);
+            return invalidLoadIds;
+          }
+          // if the segment status is overwrite in progress, then no need to delete that.
+          if (SegmentStatus.INSERT_OVERWRITE_IN_PROGRESS == loadMetadata.getSegmentStatus())
{
+            LOG.error("Cannot delete the segemnt " + loadId + " which is load overwrite "
+
+                    "in progress");
+            invalidLoadIds.add(loadId);
+            return invalidLoadIds;
+          }
           if (SegmentStatus.MARKED_FOR_DELETE != loadMetadata.getSegmentStatus()) {
             loadFound = true;
             loadMetadata.setSegmentStatus(SegmentStatus.MARKED_FOR_DELETE);


Mime
View raw message