[jira] [Commented] (CARBONDATA-328) Improve Code and Fix Warnings

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (CARBONDATA-328) Improve Code and Fix Warnings

Akash R Nilugal (Jira)

    [ https://issues.apache.org/jira/browse/CARBONDATA-328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15593553#comment-15593553 ]

ASF GitHub Bot commented on CARBONDATA-328:
-------------------------------------------

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

    https://github.com/apache/incubator-carbondata/pull/248#discussion_r84404075
 
    --- Diff: integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala ---
    @@ -505,129 +512,129 @@ object CarbonDataRDDFactory extends Logging {
               )
         }
     
    -      val compactionThread = new Thread {
    -        override def run(): Unit = {
    +    val compactionThread = new Thread {
    +      override def run(): Unit = {
     
    +        try {
    +          // compaction status of the table which is triggered by the user.
    +          var triggeredCompactionStatus = false
    +          var exception: Exception = null
               try {
    -            // compaction status of the table which is triggered by the user.
    -            var triggeredCompactionStatus = false
    -            var exception : Exception = null
    -            try {
    -              executeCompaction(carbonLoadModel: CarbonLoadModel,
    -                hdfsStoreLocation: String,
    -                compactionModel: CompactionModel,
    -                partitioner: Partitioner,
    -                executor, sqlContext, kettleHomePath, storeLocation
    +            executeCompaction(carbonLoadModel: CarbonLoadModel,
    +              hdfsStoreLocation: String,
    +              compactionModel: CompactionModel,
    +              partitioner: Partitioner,
    +              executor, sqlContext, kettleHomePath, storeLocation
    +            )
    +            triggeredCompactionStatus = true
    +          }
    +          catch {
    +            case e: Exception =>
    +              logger.error("Exception in compaction thread " + e.getMessage)
    +              exception = e
    +          }
    +          // continue in case of exception also, check for all the tables.
    +          val isConcurrentCompactionAllowed = CarbonProperties.getInstance()
    +            .getProperty(CarbonCommonConstants.ENABLE_CONCURRENT_COMPACTION,
    +              CarbonCommonConstants.DEFAULT_ENABLE_CONCURRENT_COMPACTION
    +            ).equalsIgnoreCase("true")
    +
    +          if (!isConcurrentCompactionAllowed) {
    +            logger.info("System level compaction lock is enabled.")
    +            val skipCompactionTables = ListBuffer[CarbonTableIdentifier]()
    +            var tableForCompaction = CarbonCompactionUtil
    +              .getNextTableToCompact(CarbonEnv.getInstance(sqlContext).carbonCatalog.metadata
    +                .tablesMeta.toArray, skipCompactionTables.toList.asJava
                   )
    -              triggeredCompactionStatus = true
    -            }
    -            catch {
    -              case e: Exception =>
    -                logger.error("Exception in compaction thread " + e.getMessage)
    -                exception = e
    -            }
    -            // continue in case of exception also, check for all the tables.
    -            val isConcurrentCompactionAllowed = CarbonProperties.getInstance()
    -              .getProperty(CarbonCommonConstants.ENABLE_CONCURRENT_COMPACTION,
    -                CarbonCommonConstants.DEFAULT_ENABLE_CONCURRENT_COMPACTION
    -              ).equalsIgnoreCase("true")
    -
    -            if (!isConcurrentCompactionAllowed) {
    -              logger.info("System level compaction lock is enabled.")
    -              val skipCompactionTables = ListBuffer[CarbonTableIdentifier]()
    -              var tableForCompaction = CarbonCompactionUtil
    -                .getNextTableToCompact(CarbonEnv.getInstance(sqlContext).carbonCatalog.metadata
    -                  .tablesMeta.toArray, skipCompactionTables.toList.asJava
    +            while (null != tableForCompaction) {
    +              logger
    +                .info("Compaction request has been identified for table " + tableForCompaction
    --- End diff --
   
    please give proper format of log message. please modify all places


> Improve Code and Fix Warnings
> -----------------------------
>
>                 Key: CARBONDATA-328
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-328
>             Project: CarbonData
>          Issue Type: Improvement
>            Reporter: Prabhat Kashyap
>            Priority: Trivial
>
> Remove compiler warning and improve the existing code according to the standards.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)