cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <>
Subject Re: Performance of get
Date Tue, 27 Oct 2009 20:14:08 GMT
On Tue, Oct 27, 2009 at 2:00 PM, Christopher McKenzie
<> wrote:
> Exceptions are a special feature of languages often with their own keywords, primitives,
and usually chapters in books.  I don't profess to be an expert in the various exception
models for all the versions of various implementations of C++, Java, Python, PHP, Ruby, Erlang,
Perl, Haskell, C#, Cocoa, Smalltalk, and OCaml that thrift supports.  But I would claim that,
with such a large heterogeneous and dynamic support base, one should use something as varied
and unpredictable as the exception handling models with great care and I don't "personally
feel" that the understandably expected error case of Get should be escalated to be handled
by this mechanism.

There are basically two sane options for looking up a key that doesn't
exist.  One is to return null or the equivalent; the other is to raise
an exception.  There are pros and cons for each, and examples of
languages whose stdlib behaves either way.  So a blanket Exceptions
Are Not Idiomatic For Key Lookup statement is misguided.

And as it happens, Thrift does not support returning null values at
all, so from there the natural choice was obvious.


View raw message