cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hicks <>
Subject i have a question about "commitlog_sync"
Date Sat, 08 Oct 2011 08:05:38 GMT
  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();
task.getRawCallable().call() will call  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.
View raw message