carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jackylk <...@git.apache.org>
Subject [GitHub] carbondata pull request #1642: [CARBONDATA-1855][PARTITION] Added outputform...
Date Fri, 15 Dec 2017 07:52:30 GMT
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1642#discussion_r157139961
  
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/util/CarbonLoaderUtil.java
---
    @@ -329,6 +329,47 @@ public static String readCurrentTime() {
         return date;
       }
     
    +  public static void readAndUpdateLoadProgressInTableMeta(CarbonLoadModel model,
    +      boolean insertOverwrite) throws IOException, InterruptedException {
    +    LoadMetadataDetails newLoadMetaEntry = new LoadMetadataDetails();
    +    SegmentStatus status = SegmentStatus.INSERT_IN_PROGRESS;
    +    if (insertOverwrite) {
    +      status = SegmentStatus.INSERT_OVERWRITE_IN_PROGRESS;
    +    }
    +
    +    // reading the start time of data load.
    +    long loadStartTime = CarbonUpdateUtil.readCurrentTime();
    +    model.setFactTimeStamp(loadStartTime);
    +    CarbonLoaderUtil
    +        .populateNewLoadMetaEntry(newLoadMetaEntry, status, model.getFactTimeStamp(),
false);
    +    boolean entryAdded =
    +        CarbonLoaderUtil.recordNewLoadMetadata(newLoadMetaEntry, model, true, insertOverwrite);
    +    if (!entryAdded) {
    +      throw new IOException("Failed to add entry in table status for " + model.getTableName());
    +    }
    +  }
    +
    +  /**
    +   * This method will update the load failure entry in the table status file
    +   */
    +  public static void updateTableStatusForFailure(CarbonLoadModel model)
    +      throws IOException, InterruptedException {
    +    // in case if failure the load status should be "Marked for delete" so that it will
be taken
    +    // care during clean up
    +    SegmentStatus loadStatus = SegmentStatus.MARKED_FOR_DELETE;
    +    // always the last entry in the load metadata details will be the current load entry
    +    LoadMetadataDetails loadMetaEntry =
    +        model.getLoadMetadataDetails().get(model.getLoadMetadataDetails().size() - 1);
    +    CarbonLoaderUtil
    +        .populateNewLoadMetaEntry(loadMetaEntry, loadStatus, model.getFactTimeStamp(),
true);
    +    boolean updationStatus =
    --- End diff --
    
    change to entryAdded


---

Mime
View raw message