Return-Path: Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: (qmail 54693 invoked from network); 28 Jul 2010 21:45:39 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Jul 2010 21:45:39 -0000 Received: (qmail 99812 invoked by uid 500); 28 Jul 2010 21:45:39 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 99794 invoked by uid 500); 28 Jul 2010 21:45:38 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 99786 invoked by uid 99); 28 Jul 2010 21:45:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jul 2010 21:45:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jul 2010 21:45:38 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o6SLjHml021926 for ; Wed, 28 Jul 2010 21:45:17 GMT Message-ID: <7768842.54651280353517666.JavaMail.jira@thor> Date: Wed, 28 Jul 2010 17:45:17 -0400 (EDT) From: "Jon Hermes (JIRA)" To: commits@cassandra.apache.org Subject: [jira] Updated: (CASSANDRA-1313) make cache sizes in CfDef Strings again so we can use %s of rows in the CF as in 0.6 In-Reply-To: <15671151.559701279923711216.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-1313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jon Hermes updated CASSANDRA-1313: ---------------------------------- Attachment: snakeyaml-percentToFloat.txt 1313.txt snakeyaml-r1131-dev1.jar Simply making \{rows,keys\}_cached strings instead of doubles is problematic. The current code looks for 'double \{rows,keys\}_cached', and changing every lookup is a non-trivial chunk of code. The lookup would also take extra cycles (or just two extra cycles if the first lookups cache the String->Double operation). Loading a String into a Double from the YAML using snakeyaml directly has proven difficult: * Getters and setters on the Config/RawKS/RawCF beans are never called, so there is no immediate hook. * Telling the constructor in DD that "50%" should be a double does not help the constructor parse the string into a double -- snakeyaml explodes. * Pushing the values into a String on the bean, then populating the double from the string leaves extra variables around. Also, these extra variables have to be named something different than \{rows,keys\}_cached, which means extra work in our 0.6->0.7 Converter. * Pushing the values into a String on a FooConfig, then generating Config from FooConfig works, but means two passes on the load and hard to maintain later. * *Finally,* change the snakeyaml code directly. Whenever it sees a number followed by a percent, it should correctly construct a FloatType (be it Float, Double, or BigDecimal according to destination). I decided the best fix is to effect a change in snakeyaml as outlined above (and tracked at: http://code.google.com/p/snakeyaml/issues/detail?id=75 ). Attached are 3 things: - The patch to snakeyaml trunk, named snakeyaml-percentToFloat.txt, - The lib built from trunk after patch applied, named snakeyaml-r1131-dev1.jar, - and a patch for C trunk (changes conf/cassandra.yaml and test/conf/cassandra.yaml), named 1313.txt. With this, the values legal for \{rows,keys\}_cached is a literal (1000, 0.5, 0) or a string ("1000", "50%", "0%"). As before, a value between [0,1] is a fraction of the total, and all larger values are absolute. Because this is a change to the parser, you can also give percents anywhere else a double is expected (read_repair_chance: '72.25%' if you want). Should this change not be accepted, one of the above methods can be employed in our code, or I can override-in all the functionality of the patch (though the code will look like a trainwreck). > make cache sizes in CfDef Strings again so we can use %s of rows in the CF as in 0.6 > ------------------------------------------------------------------------------------ > > Key: CASSANDRA-1313 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1313 > Project: Cassandra > Issue Type: Bug > Components: Core > Affects Versions: 0.7 beta 1 > Reporter: Jonathan Ellis > Assignee: Jon Hermes > Fix For: 0.7 beta 1 > > Attachments: 1313.txt, snakeyaml-percentToFloat.txt, snakeyaml-r1131-dev1.jar > > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.