core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java
/**
   * updates deletion status details for load and returns invalidLoadTimestamps
   *
   * @param loadDate
   * @param listOfLoadFolderDetailsArray
   * @param invalidLoadTimestamps
   * @return invalidLoadTimestamps
   */
updates deletion status details for load and returns invalidLoadTimestamps
@param loadDate
@param listOfLoadFolderDetailsArray
@param invalidLoadTimestamps
@return invalidLoadTimestamps
updates deletion status details for load and returns invalidLoadTimestamps @param loadDate @param listOfLoadFolderDetailsArray @param invalidLoadTimestamps @return invalidLoadTimestamps
public static List<String> updateDeletionStatus(AbsoluteTableIdentifier absoluteTableIdentifier,
      String loadDate, LoadMetadataDetails[] listOfLoadFolderDetailsArray,
      List<String> invalidLoadTimestamps, Long loadStartTime) {
    boolean loadFound = false;
    String loadStartTimeString = "Load Start Time: ";
    SegmentStatus segmentStatus = null;
    for (LoadMetadataDetails loadMetadata : listOfLoadFolderDetailsArray) {
      Integer result = compareDateValues(loadMetadata.getLoadStartTimeAsLong(), loadStartTime);
      if (result < 0) {
        segmentStatus = loadMetadata.getSegmentStatus();
        if (SegmentStatus.COMPACTED == segmentStatus) {
          LOG.info("Ignoring the segment : " + loadMetadata.getLoadName()
              + "as the segment has been compacted.");
        } else if (SegmentStatus.STREAMING == segmentStatus) {
          LOG.info("Ignoring the segment : " + loadMetadata.getLoadName()
              + "as the segment is streaming in progress.");
        } else if (SegmentStatus.INSERT_IN_PROGRESS == segmentStatus && isLoadInProgress(
            absoluteTableIdentifier, loadMetadata.getLoadName())) {
          LOG.info("Ignoring the segment : " + loadMetadata.getLoadName()
              + "as the segment is insert in progress.");
        } else if (SegmentStatus.INSERT_OVERWRITE_IN_PROGRESS == segmentStatus
            && isLoadInProgress(absoluteTableIdentifier, loadMetadata.getLoadName())) {
          LOG.info("Ignoring the segment : " + loadMetadata.getLoadName()
              + "as the segment is insert overwrite in progress.");
        } else if (SegmentStatus.MARKED_FOR_DELETE != segmentStatus) {
          loadFound = true;
          updateSegmentMetadataDetails(loadMetadata);
          LOG.info("Info: " + loadStartTimeString + loadMetadata.getLoadStartTime()
              + " Marked for Delete");
        }
      }
    }
    if (!loadFound) {
      invalidLoadTimestamps.add(loadDate);
      LOG.audit("Delete segment by date is failed. No matching segment found.");
      return invalidLoadTimestamps;
    }
    return invalidLoadTimestamps;
  }
public static List < String > updateDeletionStatus ( AbsoluteTableIdentifier absoluteTableIdentifier , String loadDate , LoadMetadataDetails [ ] listOfLoadFolderDetailsArray , List < String > invalidLoadTimestamps , Long loadStartTime ) { boolean loadFound = false ; String loadStartTimeString = "Load Start Time: " ; SegmentStatus segmentStatus = null ; for ( LoadMetadataDetails loadMetadata : listOfLoadFolderDetailsArray ) { Integer result = compareDateValues ( loadMetadata . getLoadStartTimeAsLong ( ) , loadStartTime ) ; if ( result < 0 ) { segmentStatus = loadMetadata . getSegmentStatus ( ) ; if ( SegmentStatus . COMPACTED == segmentStatus ) { LOG . info ( "Ignoring the segment : " + loadMetadata . getLoadName ( ) + "as the segment has been compacted." ) ; } else if ( SegmentStatus . STREAMING == segmentStatus ) { LOG . info ( "Ignoring the segment : " + loadMetadata . getLoadName ( ) + "as the segment is streaming in progress." ) ; } else if ( SegmentStatus . INSERT_IN_PROGRESS == segmentStatus && isLoadInProgress ( absoluteTableIdentifier , loadMetadata . getLoadName ( ) ) ) { LOG . info ( "Ignoring the segment : " + loadMetadata . getLoadName ( ) + "as the segment is insert in progress." ) ; } else if ( SegmentStatus . INSERT_OVERWRITE_IN_PROGRESS == segmentStatus && isLoadInProgress ( absoluteTableIdentifier , loadMetadata . getLoadName ( ) ) ) { LOG . info ( "Ignoring the segment : " + loadMetadata . getLoadName ( ) + "as the segment is insert overwrite in progress." ) ; } else if ( SegmentStatus . MARKED_FOR_DELETE != segmentStatus ) { loadFound = true ; updateSegmentMetadataDetails ( loadMetadata ) ; LOG . info ( "Info: " + loadStartTimeString + loadMetadata . getLoadStartTime ( ) + " Marked for Delete" ) ; } } } if ( ! loadFound ) { invalidLoadTimestamps . add ( loadDate ) ; LOG . audit ( "Delete segment by date is failed. No matching segment found." ) ; return invalidLoadTimestamps ; } return invalidLoadTimestamps ; }
updates deletion status details for load and returns invalidLoadTimestamps
 @param loadDate
 @param listOfLoadFolderDetailsArray
 @param invalidLoadTimestamps
 @return invalidLoadTimestamps
updates deletion status details for load and returns invalidLoadTimestamps @param loadDate @param listOfLoadFolderDetailsArray @param invalidLoadTimestamps @return invalidLoadTimestamps
// For each load timestamp loop through data and if the // required load timestamp is found then mark // the metadata as deleted.