Return-Path: Delivered-To: apmail-incubator-cassandra-commits-archive@minotaur.apache.org Received: (qmail 31369 invoked from network); 21 Jul 2009 13:40:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jul 2009 13:40:31 -0000 Received: (qmail 6146 invoked by uid 500); 21 Jul 2009 13:41:37 -0000 Delivered-To: apmail-incubator-cassandra-commits-archive@incubator.apache.org Received: (qmail 6112 invoked by uid 500); 21 Jul 2009 13:41:37 -0000 Mailing-List: contact cassandra-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-dev@incubator.apache.org Delivered-To: mailing list cassandra-commits@incubator.apache.org Received: (qmail 6102 invoked by uid 99); 21 Jul 2009 13:41:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2009 13:41:37 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2009 13:41:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0152F234C046 for ; Tue, 21 Jul 2009 06:41:15 -0700 (PDT) Message-ID: <54264994.1248183675004.JavaMail.jira@brutus> Date: Tue, 21 Jul 2009 06:41:15 -0700 (PDT) From: "Michael Greene (JIRA)" To: cassandra-commits@incubator.apache.org Subject: [jira] Issue Comment Edited: (CASSANDRA-300) Enumerate useful consistency options for read/write calls In-Reply-To: <1400858458.1247772974844.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CASSANDRA-300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12733617#action_12733617 ] Michael Greene edited comment on CASSANDRA-300 at 7/21/09 6:41 AM: ------------------------------------------------------------------- You can specify defaults to struct values, but I'm not sure about default method parameters -- few languages support this functionality, so I doubt it. It may be premature generalization, but the second option would allow you to have a default: struct ConsistencyRequest { 1: required ConsistencyLevel level = ONE, 2: optional int nodes, } read(1: string thing, 2: ConsistencyRequest request) was (Author: euphoria): You can specify defaults to struct values, but I'm not sure about default method parameters -- few languages support this functionality, so I doubt it. It may be premature generalization, but the second option would allow you to have a default: struct ConsistencyRequest { 1: required ConsistencyLevel level = ONE, 2: optional int nodes, } read(1: string thing, 2: ConsistencyRequest) > Enumerate useful consistency options for read/write calls > --------------------------------------------------------- > > Key: CASSANDRA-300 > URL: https://issues.apache.org/jira/browse/CASSANDRA-300 > Project: Cassandra > Issue Type: Improvement > Components: Core > Reporter: Michael Greene > > Currently, a user has to specify an int for the number of nodes to block_for. As discussed on IRC, there are only a few options that a user would want, so this would be better encapsulated by an enum. > enum ConsistencyLevel { > ZERO = 0, > ONE = 1, > QUORUM = 2, > ALL = 3, > } > This could be extended with a fifth option, CUSTOM = 4, if custom specifications are desired > struct ConsistencyRequest { > 1: required ConsistencyLevel level, > 2: optional int nodes > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.