cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "techpyaasa ." <techpya...@gmail.com>
Subject Huge Batches
Date Thu, 08 Jun 2017 08:49:12 GMT
Hi ,

Recently we are seeing huge batches and log prints as below in c* logs


*Batch of prepared statements for [ks1.cf1] is of size 413350, exceeding
specified threshold of 5120 by 362150*
Along with the Column Family name (as found in above log print) , we would
like to know the partion key , cluster column values(along with their
names) too , so that it would be easy to trace out the user who is
inserting such huge batches.

I tried to see code base of c* as below, but could not figure out how to
get values of partition keys , values of cluster columns. :(
Can some one please help me out...

   * public static void verifyBatchSize(Iterable<ColumnFamily> cfs)*
*    {*
*        long size = 0;*
*        long warnThreshold =
DatabaseDescriptor.getBatchSizeWarnThreshold();*

*        for (ColumnFamily cf : cfs)*
*            size += cf.dataSize();*

*        if (size > warnThreshold)*
*        {*
*            Set<String> ksCfPairs = new HashSet<>();*
*            for (ColumnFamily cf : cfs)*
*            {*
*                ksCfPairs.add(String.format("%s.%s size=%s",
cf.metadata().ksName, cf.metadata().cfName , cf.dataSize()));*
*                Iterator<CellName> cns = cf.getColumnNames().iterator();*
*                CellName cn = cns.next();*
*                cn.dataSize();*
*            }*

*            String format = "Batch of prepared statements for {} is of
size {}, exceeding specified threshold of {} by {}.";*
*            logger.warn(format, ksCfPairs, size, warnThreshold, size -
warnThreshold);*
*        }*
*    }*


Thanks
TechPyaasa

Mime
View raw message