hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonOutputCommitter.java
/**
   * Update the tablestatus as success after job is success
   *
   * @param context
   * @throws IOException
   */
Update the tablestatus as success after job is success
@param context
@throws IOException
Update the tablestatus as success after job is success @param context @throws IOException
@Override public void commitJob(JobContext context) throws IOException {
    try {
      super.commitJob(context);
    } catch (IOException e) {
      LOGGER.warn(e.getMessage());
    }
    boolean overwriteSet = CarbonTableOutputFormat.isOverwriteSet(context.getConfiguration());
    CarbonLoadModel loadModel = CarbonTableOutputFormat.getLoadModel(context.getConfiguration());
    LoadMetadataDetails newMetaEntry = loadModel.getCurrentLoadMetadataDetail();
    String segmentPath =
        CarbonTablePath.getSegmentPath(loadModel.getTablePath(), loadModel.getSegmentId());
    new PartitionMapFileStore().mergePartitionMapFiles(segmentPath,
        loadModel.getFactTimeStamp() + "");
    CarbonLoaderUtil.populateNewLoadMetaEntry(newMetaEntry, SegmentStatus.SUCCESS,
        loadModel.getFactTimeStamp(), true);
    CarbonTable carbonTable = loadModel.getCarbonDataLoadSchema().getCarbonTable();
    long segmentSize = CarbonLoaderUtil
        .addDataIndexSizeIntoMetaEntry(newMetaEntry, loadModel.getSegmentId(), carbonTable);
    if (segmentSize > 0 || overwriteSet) {
      Object operationContext = getOperationContext();
      if (operationContext != null) {
        LoadEvents.LoadTablePreStatusUpdateEvent event =
            new LoadEvents.LoadTablePreStatusUpdateEvent(carbonTable.getCarbonTableIdentifier(),
                loadModel);
        LoadEvents.LoadTablePostStatusUpdateEvent postStatusUpdateEvent =
            new LoadEvents.LoadTablePostStatusUpdateEvent(loadModel);
        try {
          OperationListenerBus.getInstance().fireEvent(event, (OperationContext) operationContext);
          OperationListenerBus.getInstance().fireEvent(postStatusUpdateEvent,
              (OperationContext) operationContext);
        } catch (Exception e) {
          throw new IOException(e);
        }
      }
      CarbonLoaderUtil.recordNewLoadMetadata(newMetaEntry, loadModel, false, overwriteSet);
      if (operationContext != null) {
        LoadEvents.LoadTableMergePartitionEvent loadTableMergePartitionEvent =
            new LoadEvents.LoadTableMergePartitionEvent(segmentPath);
        try {
          OperationListenerBus.getInstance()
              .fireEvent(loadTableMergePartitionEvent, (OperationContext) operationContext);
        } catch (Exception e) {
          throw new IOException(e);
        }
      }
      String updateTime =
          context.getConfiguration().get(CarbonTableOutputFormat.UPADTE_TIMESTAMP, null);
      String segmentsToBeDeleted =
          context.getConfiguration().get(CarbonTableOutputFormat.SEGMENTS_TO_BE_DELETED, "");
      List<String> segmentDeleteList = Arrays.asList(segmentsToBeDeleted.split(","));
      if (updateTime != null) {
        Set<String> segmentSet = new HashSet<>(
            new SegmentStatusManager(carbonTable.getAbsoluteTableIdentifier())
                .getValidAndInvalidSegments().getValidSegments());
        CarbonUpdateUtil.updateTableMetadataStatus(
            segmentSet,
            carbonTable,
            updateTime,
            true,
            segmentDeleteList);
      }
    } else {
      CarbonLoaderUtil.updateTableStatusForFailure(loadModel);
    }
  }
@ Override public void commitJob ( JobContext context ) throws IOException { try { super . commitJob ( context ) ; } catch ( IOException e ) { LOGGER . warn ( e . getMessage ( ) ) ; } boolean overwriteSet = CarbonTableOutputFormat . isOverwriteSet ( context . getConfiguration ( ) ) ; CarbonLoadModel loadModel = CarbonTableOutputFormat . getLoadModel ( context . getConfiguration ( ) ) ; LoadMetadataDetails newMetaEntry = loadModel . getCurrentLoadMetadataDetail ( ) ; String segmentPath = CarbonTablePath . getSegmentPath ( loadModel . getTablePath ( ) , loadModel . getSegmentId ( ) ) ; new PartitionMapFileStore ( ) . mergePartitionMapFiles ( segmentPath , loadModel . getFactTimeStamp ( ) + "" ) ; CarbonLoaderUtil . populateNewLoadMetaEntry ( newMetaEntry , SegmentStatus . SUCCESS , loadModel . getFactTimeStamp ( ) , true ) ; CarbonTable carbonTable = loadModel . getCarbonDataLoadSchema ( ) . getCarbonTable ( ) ; long segmentSize = CarbonLoaderUtil . addDataIndexSizeIntoMetaEntry ( newMetaEntry , loadModel . getSegmentId ( ) , carbonTable ) ; if ( segmentSize > 0 || overwriteSet ) { Object operationContext = getOperationContext ( ) ; if ( operationContext != null ) { LoadEvents . LoadTablePreStatusUpdateEvent event = new LoadEvents . LoadTablePreStatusUpdateEvent ( carbonTable . getCarbonTableIdentifier ( ) , loadModel ) ; LoadEvents . LoadTablePostStatusUpdateEvent postStatusUpdateEvent = new LoadEvents . LoadTablePostStatusUpdateEvent ( loadModel ) ; try { OperationListenerBus . getInstance ( ) . fireEvent ( event , ( OperationContext ) operationContext ) ; OperationListenerBus . getInstance ( ) . fireEvent ( postStatusUpdateEvent , ( OperationContext ) operationContext ) ; } catch ( Exception e ) { throw new IOException ( e ) ; } } CarbonLoaderUtil . recordNewLoadMetadata ( newMetaEntry , loadModel , false , overwriteSet ) ; if ( operationContext != null ) { LoadEvents . LoadTableMergePartitionEvent loadTableMergePartitionEvent = new LoadEvents . LoadTableMergePartitionEvent ( segmentPath ) ; try { OperationListenerBus . getInstance ( ) . fireEvent ( loadTableMergePartitionEvent , ( OperationContext ) operationContext ) ; } catch ( Exception e ) { throw new IOException ( e ) ; } } String updateTime = context . getConfiguration ( ) . get ( CarbonTableOutputFormat . UPADTE_TIMESTAMP , null ) ; String segmentsToBeDeleted = context . getConfiguration ( ) . get ( CarbonTableOutputFormat . SEGMENTS_TO_BE_DELETED , "" ) ; List < String > segmentDeleteList = Arrays . asList ( segmentsToBeDeleted . split ( "," ) ) ; if ( updateTime != null ) { Set < String > segmentSet = new HashSet < > ( new SegmentStatusManager ( carbonTable . getAbsoluteTableIdentifier ( ) ) . getValidAndInvalidSegments ( ) . getValidSegments ( ) ) ; CarbonUpdateUtil . updateTableMetadataStatus ( segmentSet , carbonTable , updateTime , true , segmentDeleteList ) ; } } else { CarbonLoaderUtil . updateTableStatusForFailure ( loadModel ) ; } }
Update the tablestatus as success after job is success
 @param context
 @throws IOException
Update the tablestatus as success after job is success @param context @throws IOException
// ignore, in case of concurrent load it try to remove temporary folders by other load may // cause file not found exception. This will not impact carbon load, // Merge all partition files into a single file.