当前位置: 首页>>代码示例>>Java>>正文


Java CompressionParameters.DEFAULT_CHUNK_LENGTH属性代码示例

本文整理汇总了Java中org.apache.cassandra.io.compress.CompressionParameters.DEFAULT_CHUNK_LENGTH属性的典型用法代码示例。如果您正苦于以下问题:Java CompressionParameters.DEFAULT_CHUNK_LENGTH属性的具体用法?Java CompressionParameters.DEFAULT_CHUNK_LENGTH怎么用?Java CompressionParameters.DEFAULT_CHUNK_LENGTH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.cassandra.io.compress.CompressionParameters的用法示例。


在下文中一共展示了CompressionParameters.DEFAULT_CHUNK_LENGTH属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate

public void validate() throws ConfigurationException, SyntaxException
{
    validate(keywords, obsoleteKeywords);

    Map<String, String> compactionOptions = getCompactionOptions();
    if (!compactionOptions.isEmpty())
    {
        String strategy = compactionOptions.get(COMPACTION_STRATEGY_CLASS_KEY);
        if (strategy == null)
            throw new ConfigurationException("Missing sub-option '" + COMPACTION_STRATEGY_CLASS_KEY + "' for the '" + KW_COMPACTION + "' option.");

        compactionStrategyClass = CFMetaData.createCompactionStrategy(strategy);
        compactionOptions.remove(COMPACTION_STRATEGY_CLASS_KEY);

        CFMetaData.validateCompactionOptions(compactionStrategyClass, compactionOptions);
    }

    Map<String, String> compressionOptions = getCompressionOptions();
    if (!compressionOptions.isEmpty())
    {
        String sstableCompressionClass = compressionOptions.get(CompressionParameters.SSTABLE_COMPRESSION);
        if (sstableCompressionClass == null)
            throw new ConfigurationException("Missing sub-option '" + CompressionParameters.SSTABLE_COMPRESSION + "' for the '" + KW_COMPRESSION + "' option.");

        Integer chunkLength = CompressionParameters.DEFAULT_CHUNK_LENGTH;
        if (compressionOptions.containsKey(CompressionParameters.CHUNK_LENGTH_KB))
            chunkLength = CompressionParameters.parseChunkLength(compressionOptions.get(CompressionParameters.CHUNK_LENGTH_KB));

        Map<String, String> remainingOptions = new HashMap<>(compressionOptions);
        remainingOptions.remove(CompressionParameters.SSTABLE_COMPRESSION);
        remainingOptions.remove(CompressionParameters.CHUNK_LENGTH_KB);
        CompressionParameters cp = new CompressionParameters(sstableCompressionClass, chunkLength, remainingOptions);
        cp.validate();
    }

    validateMinimumInt(KW_DEFAULT_TIME_TO_LIVE, 0, CFMetaData.DEFAULT_DEFAULT_TIME_TO_LIVE);
    validateMinimumInt(KW_INDEX_INTERVAL, 1, CFMetaData.DEFAULT_INDEX_INTERVAL);

    SpeculativeRetry.fromString(getString(KW_SPECULATIVE_RETRY, SpeculativeRetry.RetryType.NONE.name()));
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:40,代码来源:CFPropDefs.java

示例2: validate

public void validate() throws ConfigurationException, SyntaxException
{
    // Skip validation if the comapction strategy class is already set as it means we've alreayd
    // prepared (and redoing it would set strategyClass back to null, which we don't want)
    if (compactionStrategyClass != null)
        return;

    validate(keywords, obsoleteKeywords);

    Map<String, String> compactionOptions = getCompactionOptions();
    if (!compactionOptions.isEmpty())
    {
        String strategy = compactionOptions.get(COMPACTION_STRATEGY_CLASS_KEY);
        if (strategy == null)
            throw new ConfigurationException("Missing sub-option '" + COMPACTION_STRATEGY_CLASS_KEY + "' for the '" + KW_COMPACTION + "' option.");

        compactionStrategyClass = CFMetaData.createCompactionStrategy(strategy);
        compactionOptions.remove(COMPACTION_STRATEGY_CLASS_KEY);

        CFMetaData.validateCompactionOptions(compactionStrategyClass, compactionOptions);
    }

    Map<String, String> compressionOptions = getCompressionOptions();
    if (!compressionOptions.isEmpty())
    {
        String sstableCompressionClass = compressionOptions.get(CompressionParameters.SSTABLE_COMPRESSION);
        if (sstableCompressionClass == null)
            throw new ConfigurationException("Missing sub-option '" + CompressionParameters.SSTABLE_COMPRESSION + "' for the '" + KW_COMPRESSION + "' option.");

        Integer chunkLength = CompressionParameters.DEFAULT_CHUNK_LENGTH;
        if (compressionOptions.containsKey(CompressionParameters.CHUNK_LENGTH_KB))
            chunkLength = CompressionParameters.parseChunkLength(compressionOptions.get(CompressionParameters.CHUNK_LENGTH_KB));

        Map<String, String> remainingOptions = new HashMap<>(compressionOptions);
        remainingOptions.remove(CompressionParameters.SSTABLE_COMPRESSION);
        remainingOptions.remove(CompressionParameters.CHUNK_LENGTH_KB);
        CompressionParameters cp = new CompressionParameters(sstableCompressionClass, chunkLength, remainingOptions);
        cp.validate();
    }

    validateMinimumInt(KW_DEFAULT_TIME_TO_LIVE, 0, CFMetaData.DEFAULT_DEFAULT_TIME_TO_LIVE);

    Integer minIndexInterval = getInt(KW_MIN_INDEX_INTERVAL, null);
    Integer maxIndexInterval = getInt(KW_MAX_INDEX_INTERVAL, null);
    if (minIndexInterval != null && minIndexInterval < 1)
        throw new ConfigurationException(KW_MIN_INDEX_INTERVAL + " must be greater than 0");
    if (maxIndexInterval != null && minIndexInterval != null && maxIndexInterval < minIndexInterval)
        throw new ConfigurationException(KW_MAX_INDEX_INTERVAL + " must be greater than " + KW_MIN_INDEX_INTERVAL);

    SpeculativeRetry.fromString(getString(KW_SPECULATIVE_RETRY, SpeculativeRetry.RetryType.NONE.name()));
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:51,代码来源:CFPropDefs.java

示例3: validate

public void validate() throws ConfigurationException, SyntaxException
{
    // Skip validation if the comapction strategy class is already set as it means we've alreayd
    // prepared (and redoing it would set strategyClass back to null, which we don't want)
    if (compactionStrategyClass != null)
        return;

    validate(keywords, obsoleteKeywords);

    Map<String, String> compactionOptions = getCompactionOptions();
    if (!compactionOptions.isEmpty())
    {
        String strategy = compactionOptions.get(COMPACTION_STRATEGY_CLASS_KEY);
        if (strategy == null)
            throw new ConfigurationException("Missing sub-option '" + COMPACTION_STRATEGY_CLASS_KEY + "' for the '" + KW_COMPACTION + "' option.");

        compactionStrategyClass = CFMetaData.createCompactionStrategy(strategy);
        compactionOptions.remove(COMPACTION_STRATEGY_CLASS_KEY);

        CFMetaData.validateCompactionOptions(compactionStrategyClass, compactionOptions);
    }

    Map<String, String> compressionOptions = getCompressionOptions();
    if (!compressionOptions.isEmpty())
    {
        String sstableCompressionClass = compressionOptions.get(CompressionParameters.SSTABLE_COMPRESSION);
        if (sstableCompressionClass == null)
            throw new ConfigurationException("Missing sub-option '" + CompressionParameters.SSTABLE_COMPRESSION + "' for the '" + KW_COMPRESSION + "' option.");

        Integer chunkLength = CompressionParameters.DEFAULT_CHUNK_LENGTH;
        if (compressionOptions.containsKey(CompressionParameters.CHUNK_LENGTH_KB))
            chunkLength = CompressionParameters.parseChunkLength(compressionOptions.get(CompressionParameters.CHUNK_LENGTH_KB));

        Map<String, String> remainingOptions = new HashMap<>(compressionOptions);
        remainingOptions.remove(CompressionParameters.SSTABLE_COMPRESSION);
        remainingOptions.remove(CompressionParameters.CHUNK_LENGTH_KB);
        CompressionParameters cp = new CompressionParameters(sstableCompressionClass, chunkLength, remainingOptions);
        cp.validate();
    }

    validateMinimumInt(KW_DEFAULT_TIME_TO_LIVE, 0, CFMetaData.DEFAULT_DEFAULT_TIME_TO_LIVE);
    validateMinimumInt(KW_INDEX_INTERVAL, 1, CFMetaData.DEFAULT_INDEX_INTERVAL);

    SpeculativeRetry.fromString(getString(KW_SPECULATIVE_RETRY, SpeculativeRetry.RetryType.NONE.name()));
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:45,代码来源:CFPropDefs.java


注:本文中的org.apache.cassandra.io.compress.CompressionParameters.DEFAULT_CHUNK_LENGTH属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。