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 5A6CD8B30 for ; Fri, 19 Aug 2011 01:03:08 +0000 (UTC) Received: (qmail 73971 invoked by uid 500); 19 Aug 2011 01:03:05 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 73777 invoked by uid 500); 19 Aug 2011 01:03:05 -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 73769 invoked by uid 99); 19 Aug 2011 01:03:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2011 01:03:04 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HK_RANDOM_ENVFROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of teddyyyy123@gmail.com designates 209.85.218.44 as permitted sender) Received: from [209.85.218.44] (HELO mail-yi0-f44.google.com) (209.85.218.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2011 01:02:59 +0000 Received: by yie12 with SMTP id 12so2129457yie.31 for ; Thu, 18 Aug 2011 18:02:39 -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:content-transfer-encoding; bh=nHnxlLgGlbFIEi1D2Cqm+NfLxbBdxIVUWS0WRjzx/Ak=; b=LWsqbDL2clKeWv4JjYh5jdij0fOtA5Y9z/C2s2ijw8cyZe+d7nC9NqmaGAqySZSuE/ cV+b4DUQysRyLYFGQuiSKJn60rvcKxFNPgmOUOhKV6/SGLuSpcP34UEkA+CxisEg67db SJvZtX0EcLov0dP4oGDAKFlXVKItFxus/QtQ4= MIME-Version: 1.0 Received: by 10.236.191.74 with SMTP id f50mr2430685yhn.66.1313715750778; Thu, 18 Aug 2011 18:02:30 -0700 (PDT) Received: by 10.236.27.99 with HTTP; Thu, 18 Aug 2011 18:02:30 -0700 (PDT) In-Reply-To: References: Date: Thu, 18 Aug 2011 18:02:30 -0700 Message-ID: Subject: Re: help with CommitLog code? From: Yang To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable thanks Jonathan, found it public BatchCommitLogExecutorService(int queueSize) { queue =3D new LinkedBlockingQueue(queueSize); ........... appendingThread =3D new Thread(runnable, "COMMIT-LOG-WRITER"); appendingThread.start(); } On Thu, Aug 18, 2011 at 5:58 PM, Jonathan Ellis wrote: > There is always a single CLES thread whether for Batch or Periodic. > (For Batch, look for the appendingThread field.) > > On Thu, Aug 18, 2011 at 7:41 PM, Yang wrote: >> I'm reading the commitLog code since I have some similar logic in my >> application code, >> so that I could benefit from the same techniques that CommitLog code use= s. >> >> I see that >> CommitLog.add(RowMutation rowMutation) { >> =A0 =A0 =A0 =A0executor.add(new LogRecordAdder(rowMutation)); >> } >> >> while executor could be the parallel =A0BatchCommitLogExecutorService(), >> which by default >> has 32 writer threads. >> >> I wonder how the CommitLog code is able to avoid writing garbled >> result on the file, >> since if multiple LogRecordAdder() are all executed at the same time, = =A0they run >> currentSegment().write() =3D=3D=3D=3D> SequentialWriter.write() , is it >> possible that their output will overlap?? >> >> >> Thanks =A0l lot >> Yang >> > > > > -- > Jonathan Ellis > Project Chair, Apache Cassandra > co-founder of DataStax, the source for professional Cassandra support > http://www.datastax.com >