carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvramana <...@git.apache.org>
Subject [GitHub] carbondata pull request #1155: [CARBONDATA-1283] Carbon should continue with...
Date Wed, 12 Jul 2017 05:33:00 GMT
Github user gvramana commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1155#discussion_r126867170
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java ---
    @@ -98,6 +100,119 @@ private void validateAndLoadDefaultProperties() {
         validateBlockletGroupSizeInMB();
         validateNumberOfColumnPerIORead();
         validateNumberOfRowsPerBlockletColumnPage();
    +    validateEnableUnsafeSort();
    +    validateCustomBlockDistribution();
    +    validateEnableVectorReader();
    +    validateLockType();
    +    validateCarbonCSVReadBufferSizeByte();
    +  }
    +
    +  private void validateCarbonCSVReadBufferSizeByte() {
    +    String csvReadBufferSizeStr =
    +        carbonProperties.getProperty(CarbonCommonConstants.CSV_READ_BUFFER_SIZE);
    +    if (null != csvReadBufferSizeStr) {
    +      try {
    +        int bufferSize = Integer.parseInt(csvReadBufferSizeStr);
    +        if (bufferSize < CarbonCommonConstants.CSV_READ_BUFFER_SIZE_MIN
    +            || bufferSize > CarbonCommonConstants.CSV_READ_BUFFER_SIZE_MAX) {
    +          LOGGER.warn("The value \"" + csvReadBufferSizeStr + "\" configured for key
"
    +              + CarbonCommonConstants.CSV_READ_BUFFER_SIZE
    +              + "\" is not in range. Valid range us (byte) \""
    +              + CarbonCommonConstants.CSV_READ_BUFFER_SIZE_MIN + " to \""
    +              + CarbonCommonConstants.CSV_READ_BUFFER_SIZE_MAX + ". Using the default
value \""
    +              + CarbonCommonConstants.CSV_READ_BUFFER_SIZE_DEFAULT);
    +          carbonProperties.setProperty(CarbonCommonConstants.CSV_READ_BUFFER_SIZE,
    +              CarbonCommonConstants.CSV_READ_BUFFER_SIZE_DEFAULT);
    +        }
    +      } catch (NumberFormatException nfe) {
    +        LOGGER.warn("The value \"" + csvReadBufferSizeStr + "\" configured for key "
    +            + CarbonCommonConstants.CSV_READ_BUFFER_SIZE
    +            + "\" is invalid. Using the default value \""
    +            + CarbonCommonConstants.CSV_READ_BUFFER_SIZE_DEFAULT);
    +        carbonProperties.setProperty(CarbonCommonConstants.CSV_READ_BUFFER_SIZE,
    +            CarbonCommonConstants.CSV_READ_BUFFER_SIZE_DEFAULT);
    +      }
    +    }
    +  }
    +
    +  private void validateLockType() {
    +    String lockTypeConfigured = carbonProperties.getProperty(CarbonCommonConstants.LOCK_TYPE);
    +    if (null != lockTypeConfigured) {
    +      switch (lockTypeConfigured.toUpperCase()) {
    +        case CarbonCommonConstants.CARBON_LOCK_TYPE_LOCAL:
    +        case CarbonCommonConstants.CARBON_LOCK_TYPE_ZOOKEEPER:
    +        case CarbonCommonConstants.CARBON_LOCK_TYPE_HDFS:
    +          break;
    +        default:
    +          configureDefaultLockType(lockTypeConfigured);
    +      }
    +    } else {
    +      configureDefaultLockType(lockTypeConfigured);
    +    }
    +  }
    +
    +  /**
    +   * the method decide and set the lock type based on the configured system type
    +   *
    +   * @param lockTypeConfigured
    +   */
    +  private void configureDefaultLockType(String lockTypeConfigured) {
    +    Configuration configuration = new Configuration(true);
    +    String defaultFs = configuration.get("fs.defaultFS");
    --- End diff --
    
    How about the case when default.fs is hdfs but carbon store path is configured as local
file path.
    Alluxio fs what is behaviour of locking?


---
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.
---

Mime
View raw message