incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Richter <...@tricnet.de>
Subject MemtableThroughput test in ColumnFamily.apply
Date Sat, 25 Feb 2012 17:23:12 GMT
Hi,

while hunting down some memory consumption issues in 0.7.10 I realized
that MemtableThroughput condition is tested before writing the new data.
As this causes memtables to grow larger than expected I changed

Memtable apply(DecoratedKey key, ColumnFamily columnFamily)
    {
        long start = System.nanoTime();

        boolean flushRequested = memtable.isThresholdViolated();
        memtable.put(key, columnFamily);
        ColumnFamily cachedRow = getRawCachedRow(key);
        if (cachedRow != null)
            cachedRow.addAll(columnFamily);
        writeStats.addNano(System.nanoTime() - start);

        return flushRequested ? memtable : null;
    }

to

Memtable apply(DecoratedKey key, ColumnFamily columnFamily)
    {
        long start = System.nanoTime();


        memtable.put(key, columnFamily);
        ColumnFamily cachedRow = getRawCachedRow(key);
        if (cachedRow != null)
            cachedRow.addAll(columnFamily);
        writeStats.addNano(System.nanoTime() - start);
        boolean flushRequested = memtable.isThresholdViolated();
        return flushRequested ? memtable : null;
    }

Are there any objections to this change? So far it works for me.

Best,

Thomas

Mime
View raw message