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 C26737A9E for ; Sat, 8 Oct 2011 08:06:18 +0000 (UTC) Received: (qmail 35165 invoked by uid 500); 8 Oct 2011 08:06:16 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 34610 invoked by uid 500); 8 Oct 2011 08:06:10 -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 34596 invoked by uid 99); 8 Oct 2011 08:06:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Oct 2011 08:06:09 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zhuxq02@126.com designates 220.181.15.3 as permitted sender) Received: from [220.181.15.3] (HELO m15-3.126.com) (220.181.15.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Oct 2011 08:06:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Received:Date:From:To:Message-ID:Subject: MIME-Version:Content-Type; bh=DaipY0kB0fcbSf48aXRn/SsNcf0CgTKkoh Hb3ki5e+8=; b=Vo1nchNmcl0NtzsWLRN24xINUtMSCiz3cxM7nUqW0EXxKYBoHK PQSswC+dpYeIBncGLojqLpq5bJn/9O/eKwDJ3XetU1icK6/2Tv/BDozePsyv0Mcd sM88GI76cuW6TbbT2VD/8gnigs5w24CyliuIRk+Wyzdjyy9/vw3FIxG9g= Received: from zhuxq02 ( [121.0.29.194] ) by ajax-webmail-wmsvr3 (Coremail) ; Sat, 8 Oct 2011 16:05:38 +0800 (CST) Date: Sat, 8 Oct 2011 16:05:38 +0800 (CST) From: hicks To: user@cassandra.apache.org Message-ID: <6c817eee.12c31.132e290e191.Coremail.zhuxq02@126.com> Subject: i have a question about "commitlog_sync" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_209348_265681173.1318061138321" X-Originating-IP: [121.0.29.194] X-Priority: 3 X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build 110829(14649.4006.3992) Copyright (c) 2002-2011 www.mailtech.cn 126com X-CM-CTRLDATA: W2MmVGZvb3Rlcl9odG09MjU2MTo4MQ== X-CM-TRANSID: A8qowGBZAEJTBJBOCeIOAA--.2938W X-CM-SenderInfo: x2kx51iqs6ij2wof0z/1tbiZhPSvEm+K4iceAAAsr X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== ------=_Part_209348_265681173.1318061138321 Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: 7bit hi,all: i have a question about the option "commitlog_sync" in cassandra.yaml file.when its value is set to "batch",the ICommitLogExecutorService instance of CommitLog will be BatchCommitLogExecutorService in which there is a method named processWithSyncBatch.and in this method,there is a code segment: while (!queue.isEmpty() && queue.peek().getRawCallable() instanceof CommitLog.LogRecordAdder && System.nanoTime() < end) { CheaterFutureTask task = queue.remove(); incompleteTasks.add(task); taskValues.add(task.getRawCallable().call()); } task.getRawCallable().call() will call CommitLog.LogRecordAdder.run() which does the same thing as appendingThread in PeriodicCommitLogExecutorService. we can see the task in the queue is excecuted one by one,use logWriter to do the write operaton, finally do sync when the commitlog_sync_batch_window_in_ms is up or the queue has no task,just as PeriodicCommitLogExecutorService. i don't understand where reflect the conception of "batch"? or the question can be what is the difference between PeriodicCommitLogExecutorService and BatchCommitLogExecutorService? Be expectingyourresponse! Thks very much. ------=_Part_209348_265681173.1318061138321 Content-Type: text/html; charset=GBK Content-Transfer-Encoding: 7bit
hi,all:
  i have a question about the option "commitlog_sync" in cassandra.yaml file.when its value is set to "batch",the ICommitLogExecutorService instance of CommitLog will be BatchCommitLogExecutorService in which there is a method named processWithSyncBatch.and in this method,there is a code segment:
        while (!queue.isEmpty()
               && queue.peek().getRawCallable() instanceof CommitLog.LogRecordAdder
               && System.nanoTime() < end)
        {
            CheaterFutureTask task = queue.remove();
            incompleteTasks.add(task);
            taskValues.add(task.getRawCallable().call());
        }
task.getRawCallable().call() will call CommitLog.LogRecordAdder.run()  which does the same thing as appendingThread in PeriodicCommitLogExecutorService. we can see the task in the queue is excecuted one by one,use logWriter to do the write operaton, finally do sync when the commitlog_sync_batch_window_in_ms is up or the queue has no task,just as PeriodicCommitLogExecutorService. i don't understand where reflect the conception of "batch"? or the question can be what is the difference between PeriodicCommitLogExecutorService and BatchCommitLogExecutorService?
    Be expecting your response! Thks very much.


------=_Part_209348_265681173.1318061138321--