You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by sujith71955 <gi...@git.apache.org> on 2016/09/16 14:58:53 UTC

[GitHub] incubator-carbondata pull request #156: [CARBONDATA-244] Load and delete seg...

Github user sujith71955 commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/156#discussion_r79187047
  
    --- Diff: integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala ---
    @@ -1077,19 +1077,38 @@ object CarbonDataRDDFactory extends Logging {
           val segmentStatusManager = new SegmentStatusManager(table.getAbsoluteTableIdentifier)
           val details = segmentStatusManager
             .readLoadMetadata(loadMetadataFilePath)
    +      val carbonTableStatusLock = CarbonLockFactory
    +        .getCarbonLockObj(table.getAbsoluteTableIdentifier.getCarbonTableIdentifier,
    +          LockUsage.TABLE_STATUS_LOCK)
     
           // Delete marked loads
           val isUpdationRequired = DeleteLoadFolders
             .deleteLoadFoldersFromFileSystem(carbonLoadModel, hdfsStoreLocation,
               partitioner.partitionCount, isForceDeletion, details)
     
           if (isUpdationRequired) {
    +        try {
             // Update load metadate file after cleaning deleted nodes
    -        CarbonLoaderUtil.writeLoadMetadata(
    -          carbonLoadModel.getCarbonDataLoadSchema,
    -          carbonLoadModel.getDatabaseName,
    -          carbonLoadModel.getTableName, details.toList.asJava
    -        )
    +        if (carbonTableStatusLock.lockWithRetries()) {
    +          logger.info("Table status lock has been successfully acquired.")
    +          CarbonLoaderUtil.writeLoadMetadata(
    +            carbonLoadModel.getCarbonDataLoadSchema,
    +            carbonLoadModel.getDatabaseName,
    +            carbonLoadModel.getTableName, details.toList.asJava
    +          )
    +        }
    +        else {
    +          val errorMsg = "Clean files request is failed for " + carbonLoadModel.getDatabaseName +
    +                         "." + carbonLoadModel.getTableName +
    +                         ". Not able to acquire the table status lock."
    --- End diff --
    
    also mention that "due to  other operation running in the  background ", this message will give more clear picture to user about the task failure


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---