From commits-return-33828-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Thu Mar 15 16:01:23 2012 Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E620F9690 for ; Thu, 15 Mar 2012 16:01:22 +0000 (UTC) Received: (qmail 20996 invoked by uid 500); 15 Mar 2012 16:01:22 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 20958 invoked by uid 500); 15 Mar 2012 16:01:22 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 20951 invoked by uid 99); 15 Mar 2012 16:01:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2012 16:01:22 +0000 X-ASF-Spam-Status: No, hits=-1994.3 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2012 16:01:21 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id q2FG11kl001144 for ; Thu, 15 Mar 2012 16:01:01 GMT Date: Thu, 15 Mar 2012 12:01:01 -0400 (EDT) From: confluence@apache.org To: commits@directory.apache.org Message-ID: <1534681.50742.1331827261603.JavaMail.confluence@thor> Subject: [CONF] Apache Directory SandBox > TxnLogManager architecture MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Auto-Submitted: auto-generated X-Virus-Checked: Checked by ClamAV on apache.org

TxnLogManager architecture

Page edited by Emmanuel L=C3=A9charny


Changes (2)

=20 =20
=20 =20
This class is used to log th= e transactions in a file. We store LogEdit instances. Here is the hierarchy= for LogEdit :
This class is used to log the transactions in a file, the *WAL* (Writ= e Ahead Log). We store LogEdit instances, serialized into UserLogRecord. He= re is the hierarchy for LogEdit :


...

Full Content

This class is used to log the transactions in a file, the WAL= (Write Ahead Log). We store LogEdit instances, serialized into UserLog= Record. Here is the hierarchy for LogEdit :

When an operation is executed (a modification, we don't log anything for= searches), we will store two or three records :

    =09
  • a TXN_BEGIN record, to mark the beginning of a transaction
  • =09
  • an optional DataChangeContainer, which will contain all the modified= index and entries
  • =09
  • a TXN_COMMIT or TXN_ABORT, depending on the success or failure of th= e operation.

Those elements will be serialized into a UserLogRecord, following these = structures (the UserLogRecord will contains either a TxnStateChange or a Da= taChangeContainer) :

All those structure will be serialized using the minimal size, so we use= Externizable classes and we use readExternal() and writeExternal() directl= y, to save some bytes and time (this serialization is done in a locked sect= ion).