Package org.apache.cassandra.cache

Examples of org.apache.cassandra.cache.CachingOptions


        cfm.bloomFilterFpChance(getDouble(KW_BF_FP_CHANCE, cfm.getBloomFilterFpChance()));

        if (!getCompressionOptions().isEmpty())
            cfm.compressionParameters(CompressionParameters.create(getCompressionOptions()));
        CachingOptions cachingOptions = getCachingOptions();
        if (cachingOptions != null)
            cfm.caching(cachingOptions);
    }
View Full Code Here


            if (!CachingOptions.isLegacy(row.getString("caching")))
                continue;
            try
            {
                CachingOptions caching = CachingOptions.fromString(row.getString("caching"));
                CFMetaData table = CFMetaData.fromSchema(row);
                logger.info("Migrating caching option {} to {} for {}.{}", row.getString("caching"), caching.toString(), table.ksName, table.cfName);
                String query = String.format("SELECT writetime(type) FROM system.%s WHERE keyspace_name = ? AND columnfamily_name = ?", SCHEMA_COLUMNFAMILIES_CF);
                long timestamp = executeOnceInternal(query, table.ksName, table.cfName).one().getLong("writetime(type)");
                table.toSchema(timestamp).apply();
            }
            catch (ConfigurationException e)
View Full Code Here

     */
    public static CFMetaData newIndexMetadata(CFMetaData parent, ColumnDefinition info, CellNameType indexComparator)
    {
        // Depends on parent's cache setting, turn on its index CF's cache.
        // Row caching is never enabled; see CASSANDRA-5732
        CachingOptions indexCaching = parent.getCaching().keyCache.isEnabled()
                             ? CachingOptions.KEYS_ONLY
                             : CachingOptions.NONE;

        return new CFMetaData(parent.ksName, parent.indexColumnFamilyName(info), ColumnFamilyType.Standard, indexComparator, parent.cfId)
                             .keyValidator(info.type)
View Full Code Here

                                           opts_rf1,
                                           standardCFMD(ks_rcs, "CFWithoutCache").caching(CachingOptions.NONE),
                                           standardCFMD(ks_rcs, "CachedCF").caching(CachingOptions.ALL),
                                           standardCFMD(ks_rcs, "CachedIntCF").
                                                   defaultValidator(IntegerType.instance).
                                                   caching(new CachingOptions(new CachingOptions.KeyCache(CachingOptions.KeyCache.Type.ALL),
                                                                                  new CachingOptions.RowCache(CachingOptions.RowCache.Type.HEAD, 100)))));

        // CounterCacheSpace
        schema.add(KSMetaData.testMetadata(ks_ccs,
                                           simple,
View Full Code Here

                SimpleStrategy.class,
                KSMetaData.optsWithRF(1),
                SchemaLoader.standardCFMD(KEYSPACE_CACHED, CF_CACHED).caching(CachingOptions.ALL),
                SchemaLoader.standardCFMD(KEYSPACE_CACHED, CF_CACHEDINT)
                            .defaultValidator(IntegerType.instance)
                            .caching(new CachingOptions(new CachingOptions.KeyCache(CachingOptions.KeyCache.Type.ALL),
                                     new CachingOptions.RowCache(CachingOptions.RowCache.Type.HEAD, 100))));
    }
View Full Code Here

                                           opts_rf1,
                                           standardCFMD(ks_rcs, "CFWithoutCache").caching(CachingOptions.NONE),
                                           standardCFMD(ks_rcs, "CachedCF").caching(CachingOptions.ALL),
                                           standardCFMD(ks_rcs, "CachedIntCF").
                                                   defaultValidator(IntegerType.instance).
                                                   caching(new CachingOptions(new CachingOptions.KeyCache(CachingOptions.KeyCache.Type.ALL),
                                                                                  new CachingOptions.RowCache(CachingOptions.RowCache.Type.HEAD, 100)))));

        // CounterCacheSpace
        schema.add(KSMetaData.testMetadata(ks_ccs,
                                           simple,
View Full Code Here

     */
    public static CFMetaData newIndexMetadata(CFMetaData parent, ColumnDefinition info, CellNameType indexComparator)
    {
        // Depends on parent's cache setting, turn on its index CF's cache.
        // Row caching is never enabled; see CASSANDRA-5732
        CachingOptions indexCaching = parent.getCaching().keyCache.isEnabled()
                             ? CachingOptions.KEYS_ONLY
                             : CachingOptions.NONE;

        return new CFMetaData(parent.ksName, parent.indexColumnFamilyName(info), ColumnFamilyType.Standard, indexComparator, parent.cfId)
                             .keyValidator(info.type)
View Full Code Here

            return Collections.emptyMap();
        return compressionOptions;
    }
    public CachingOptions getCachingOptions() throws SyntaxException, ConfigurationException
    {
        CachingOptions options = null;
        Object val = properties.get(KW_CACHING);
        if (val == null)
            return null;
        else if (val instanceof Map)
            options = CachingOptions.fromMap(getMap(KW_CACHING));
View Full Code Here

        cfm.bloomFilterFpChance(getDouble(KW_BF_FP_CHANCE, cfm.getBloomFilterFpChance()));

        if (!getCompressionOptions().isEmpty())
            cfm.compressionParameters(CompressionParameters.create(getCompressionOptions()));
        CachingOptions cachingOptions = getCachingOptions();
        if (cachingOptions != null)
            cfm.caching(cachingOptions);
    }
View Full Code Here

        keyCache.remove(cacheKey);
    }

    public void cacheKey(DecoratedKey key, RowIndexEntry info)
    {
        CachingOptions caching = metadata.getCaching();

        if (!caching.keyCache.isEnabled()
                || keyCache == null
                || keyCache.getCapacity() == 0)
        {
View Full Code Here

TOP

Related Classes of org.apache.cassandra.cache.CachingOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.