Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3DBCC615C for ; Fri, 8 Jul 2011 16:37:11 +0000 (UTC) Received: (qmail 36898 invoked by uid 500); 8 Jul 2011 16:37:09 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 36853 invoked by uid 500); 8 Jul 2011 16:37:08 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 36845 invoked by uid 99); 8 Jul 2011 16:37:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jul 2011 16:37:08 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jeffpk@gmail.com designates 209.85.210.44 as permitted sender) Received: from [209.85.210.44] (HELO mail-pz0-f44.google.com) (209.85.210.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jul 2011 16:37:02 +0000 Received: by pzk5 with SMTP id 5so2174678pzk.31 for ; Fri, 08 Jul 2011 09:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=g7VG1WVnsThkA0q8lqEWN/UH3PHkN7/dilysuttZD+w=; b=x6qw+ljijN56ydszQZJ5ky+E5ERq4F2Yir3E+/9fXILWPjoHFStzAeGTy7PHRTQdsU HFA9nd3d70EmNATBQNq6AFguzDFJtE5YTXmpPZIWeQDgmFm5vYUzCf/+Q1qwe07QbRb9 aiwPRaZgA1lj/HK2ntzsxUfcUHTDjsqTBJj6o= MIME-Version: 1.0 Received: by 10.68.56.135 with SMTP id a7mr2873371pbq.164.1310143000564; Fri, 08 Jul 2011 09:36:40 -0700 (PDT) Received: by 10.68.44.8 with HTTP; Fri, 8 Jul 2011 09:36:40 -0700 (PDT) In-Reply-To: References: Date: Fri, 8 Jul 2011 12:36:40 -0400 Message-ID: Subject: Re: What does a write lock ? From: Jeffrey Kesselman To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=bcaec53aeec82751d504a79170fa X-Virus-Checked: Checked by ClamAV on apache.org --bcaec53aeec82751d504a79170fa Content-Type: text/plain; charset=ISO-8859-1 I should add, Nate, that the intention is to do a read before write validation and have that occur as close to the data as possible. if there is a better hook to implement it on I'd love a pointer to it. JK On Fri, Jul 8, 2011 at 12:21 PM, Nate McCall wrote: > Validation occurs at the API level, returning an > InvalidRequestException to the caller of the API (a thrift client in > this case). Specifically, a mutation will not be scheduled for the > storage until it has been validated at the API level. > > If the intention is to do a read-before-write validation as an > AbstractType extension, then yes, the underlying value could indeed > change between validation and storage. If this were the goal, you need > to implement locking externally (via zookeper or similar as previously > mentioned). > > On Fri, Jul 8, 2011 at 10:21 AM, William Oberman > wrote: > > I haven't ever written my own > org.apache.cassandra.db.marshal.AbstractType > > (which is I think what your talking about), so I have no idea. > > > > Looking up the JavaDoc for that class, validate says "validate that the > byte > > array is a valid sequence for the type we are supposed to be comparing", > > which sounds like a local operation to me (e.g. it shouldn't fetch remote > > data, it's just saying "yep, this is a valid member of type T"). > > > > will > > > > On Fri, Jul 8, 2011 at 11:17 AM, Jeffrey Kesselman > wrote: > >> > >> Alright, > >> So are you saying the column validator, as specified > >> by conf/storage-conf.xml is checked in the client interface library and > not > >> on the server side? That seems odd to me on a number of levels, not the > >> least being I cant see how thrift could autogenerate that > >> for different languages or how those other languages would use a Java > class. > >> > >> On Fri, Jul 8, 2011 at 11:13 AM, William Oberman > >> wrote: > >>> > >>> I use a language specific wrapper around thrift as my "client", but > yes, > >>> I guess I fundamentally mean thrift == client, and the cassandra server > == > >>> server. > >>> > >>> will > >>> > >>> On Fri, Jul 8, 2011 at 11:08 AM, Jeffrey Kesselman > >>> wrote: > >>>> > >>>> I am confused by what you mean by "Cassandra client code." Is this > part > >>>> of the Cassnadra server? > >>>> My architecture is my "user" talks thrift to Cassandra. > >>>> > >>> > >> > >> > >> > >> -- > >> It's always darkest just before you are eaten by a grue. > > > > > > > -- It's always darkest just before you are eaten by a grue. --bcaec53aeec82751d504a79170fa Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I=A0should=A0add, Nate, that the intention is to do a read before write val= idation and have that occur as close to the data as possible.

if there is a better hook to implement it on I'd love a pointer t= o it.

JK

On Fri, Jul 8, 201= 1 at 12:21 PM, Nate McCall <nate@datastax.com> wrote:
Validation occurs at the API level, returning an
InvalidRequestException to the caller of the API (a thrift client in
this case). Specifically, a mutation will not be scheduled for the
storage until it has been validated at the API level.

If the intention is to do a read-before-write validation as an
AbstractType extension, then yes, the underlying value could indeed
change between validation and storage. If this were the goal, you need
to implement locking externally (via zookeper or similar as previously
mentioned).

On Fri, Jul 8, 2011 at 10:21 AM, William Oberman
<oberman@civicscience.com> wrote:
> I haven't ever written my own org.apache.cassandra.db.marshal.Abst= ractType
> (which is I think what your talking about), so I have no idea.
>
> Looking up the JavaDoc for that class, validate says "validate th= at the byte
> array is a valid sequence for the type we are supposed to be comparing= ",
> which sounds like a local operation to me (e.g. it shouldn't fetch= remote
> data, it's just saying "yep, this is a valid member of type T= ").
>
> will
>
> On Fri, Jul 8, 2011 at 11:17 AM, Jeffrey Kesselman <jeffpk@gmail.com> wrote:
>>
>> Alright,
>> So are you saying the column validator, as specified
>> by=A0conf/storage-conf.xml is checked in the client interface libr= ary and not
>> on the server side? =A0That seems odd to me on a=A0number=A0of lev= els, not the
>> least=A0being=A0I cant see how thrift=A0could=A0autogenerate that<= br> >> for=A0different=A0languages or how those other languages would use= a Java class.
>>
>> On Fri, Jul 8, 2011 at 11:13 AM, William Oberman
>> <oberman@civicscien= ce.com> wrote:
>>>
>>> I use a language specific wrapper around thrift as my "cl= ient", but yes,
>>> I guess I fundamentally mean thrift =3D=3D client, and the cas= sandra server =3D=3D
>>> server.
>>>
>>> will
>>>
>>> On Fri, Jul 8, 2011 at 11:08 AM, Jeffrey Kesselman <jeffpk@gmail.com>
>>> wrote:
>>>>
>>>> I am confused by what you mean by "Cassandra=A0client= =A0code." =A0Is this part
>>>> of the Cassnadra server?
>>>> My architecture is my "user"=A0talks=A0thrift to= Cassandra.
>>>>
>>>
>>
>>
>>
>> --
>> It's always darkest just before you are eaten by a grue.
>
>
>



--
It's al= ways darkest just before you are eaten by a grue.
--bcaec53aeec82751d504a79170fa--