[hornetq-commits] JBoss hornetq SVN: r8436 - in trunk/src/main/org/hornetq/core: journal/impl/dataformat and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Nov 27 21:43:43 EST 2009


Author: clebert.suconic at jboss.com
Date: 2009-11-27 21:43:42 -0500 (Fri, 27 Nov 2009)
New Revision: 8436

Added:
   trunk/src/main/org/hornetq/core/journal/impl/dataformat/ByteArrayEncoding.java
   trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalInternalRecord.java
Removed:
   trunk/src/main/org/hornetq/core/journal/impl/InternalEncoder.java
Modified:
   trunk/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java
   trunk/src/main/org/hornetq/core/journal/impl/JournalCleaner.java
   trunk/src/main/org/hornetq/core/journal/impl/JournalCompactor.java
   trunk/src/main/org/hornetq/core/journal/impl/JournalImpl.java
   trunk/src/main/org/hornetq/core/journal/impl/JournalTransaction.java
   trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java
   trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalAddRecord.java
   trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalAddRecordTX.java
   trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalCompleteRecordTX.java
   trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalDeleteRecord.java
   trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalDeleteRecordTX.java
   trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalRollbackRecordTX.java
   trunk/src/main/org/hornetq/core/replication/impl/ReplicatedJournal.java
Log:
tweaks

Modified: trunk/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -22,7 +22,9 @@
 import org.hornetq.core.buffers.HornetQBuffers;
 import org.hornetq.core.journal.SequentialFile;
 import org.hornetq.core.journal.SequentialFileFactory;
+import org.hornetq.core.journal.impl.dataformat.ByteArrayEncoding;
 import org.hornetq.core.journal.impl.dataformat.JournalAddRecord;
+import org.hornetq.core.journal.impl.dataformat.JournalInternalRecord;
 import org.hornetq.core.logging.Logger;
 import org.hornetq.utils.ConcurrentHashSet;
 import org.hornetq.utils.Pair;
@@ -153,11 +155,11 @@
          }
 
          
-         InternalEncoder controlRecord = new JournalAddRecord(true,
-                                                              1,
-                                                              (byte)0,
-                                                              new JournalImpl.ByteArrayEncoding(filesToRename.toByteBuffer()
-                                                                                                             .array()));
+         JournalInternalRecord controlRecord = new JournalAddRecord(true,
+                                                                    1,
+                                                                    (byte)0,
+                                                                    new ByteArrayEncoding(filesToRename.toByteBuffer()
+                                                                                                       .array()));
          
          controlRecord.setFileID(-1);
          
@@ -235,13 +237,13 @@
       return writingChannel;
    }
    
-   protected void writeEncoder(InternalEncoder record) throws Exception
+   protected void writeEncoder(JournalInternalRecord record) throws Exception
    {
       record.setFileID(fileID);
       record.encode(getWritingChannel());
    }
 
-   protected void writeEncoder(InternalEncoder record, int txcounter) throws Exception
+   protected void writeEncoder(JournalInternalRecord record, int txcounter) throws Exception
    {
       record.setNumberOfRecords(txcounter);
       writeEncoder(record);

Deleted: trunk/src/main/org/hornetq/core/journal/impl/InternalEncoder.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/InternalEncoder.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/InternalEncoder.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -1,56 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.journal.impl;
-
-import org.hornetq.core.buffers.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-
-/**
- * A InternalEncoder
- *
- * @author <mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
- *
- *
- */
-public abstract class InternalEncoder implements EncodingSupport
-{
-
-   protected int fileID;
-   
-   public int getFileID()
-   {
-      return fileID;
-   }
-
-   public void setFileID(int fileID)
-   {
-      this.fileID = fileID;
-   }
-
-   public void decode(HornetQBuffer buffer)
-   {
-   }
-   
-   public void setNumberOfRecords(int records)
-   {
-   }
-   
-   public int getNumberOfRecords()
-   {
-      return 0;
-   }
-
-   public abstract int getEncodeSize();
-}
-

Modified: trunk/src/main/org/hornetq/core/journal/impl/JournalCleaner.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/JournalCleaner.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/JournalCleaner.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -20,6 +20,7 @@
 
 import org.hornetq.core.journal.RecordInfo;
 import org.hornetq.core.journal.SequentialFileFactory;
+import org.hornetq.core.journal.impl.dataformat.ByteArrayEncoding;
 import org.hornetq.core.journal.impl.dataformat.JournalAddRecord;
 import org.hornetq.core.journal.impl.dataformat.JournalAddRecordTX;
 import org.hornetq.core.journal.impl.dataformat.JournalCompleteRecordTX;
@@ -80,7 +81,7 @@
          writeEncoder(new JournalAddRecord(true,
                                            info.id,
                                            info.getUserRecordType(),
-                                           new JournalImpl.ByteArrayEncoding(info.data)));
+                                           new ByteArrayEncoding(info.data)));
       }
    }
 
@@ -97,7 +98,7 @@
                                              transactionID,
                                              recordInfo.id,
                                              recordInfo.getUserRecordType(),
-                                             new JournalImpl.ByteArrayEncoding(recordInfo.data)));
+                                             new ByteArrayEncoding(recordInfo.data)));
       }
    }
 
@@ -128,7 +129,7 @@
 
       writeEncoder(new JournalDeleteRecordTX(transactionID,
                                              recordInfo.id,
-                                             new JournalImpl.ByteArrayEncoding(recordInfo.data)));
+                                             new ByteArrayEncoding(recordInfo.data)));
    }
 
    /* (non-Javadoc)
@@ -138,7 +139,7 @@
    {
       int txcounter = getTransactionCounter(transactionID);
 
-      writeEncoder(new JournalCompleteRecordTX(false, transactionID, new JournalImpl.ByteArrayEncoding(extraData)),
+      writeEncoder(new JournalCompleteRecordTX(false, transactionID, new ByteArrayEncoding(extraData)),
                    txcounter);
    }
 
@@ -160,7 +161,7 @@
          writeEncoder(new JournalAddRecord(false,
                                            recordInfo.id,
                                            recordInfo.userRecordType,
-                                           new JournalImpl.ByteArrayEncoding(recordInfo.data)));
+                                           new ByteArrayEncoding(recordInfo.data)));
       }
    }
 
@@ -177,7 +178,7 @@
                                              transactionID,
                                              recordInfo.id,
                                              recordInfo.userRecordType,
-                                             new JournalImpl.ByteArrayEncoding(recordInfo.data)));
+                                             new ByteArrayEncoding(recordInfo.data)));
       }
    }
 

Modified: trunk/src/main/org/hornetq/core/journal/impl/JournalCompactor.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/JournalCompactor.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/JournalCompactor.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -27,10 +27,12 @@
 import org.hornetq.core.journal.SequentialFile;
 import org.hornetq.core.journal.SequentialFileFactory;
 import org.hornetq.core.journal.impl.JournalImpl.JournalRecord;
+import org.hornetq.core.journal.impl.dataformat.ByteArrayEncoding;
 import org.hornetq.core.journal.impl.dataformat.JournalAddRecord;
 import org.hornetq.core.journal.impl.dataformat.JournalAddRecordTX;
 import org.hornetq.core.journal.impl.dataformat.JournalCompleteRecordTX;
 import org.hornetq.core.journal.impl.dataformat.JournalDeleteRecordTX;
+import org.hornetq.core.journal.impl.dataformat.JournalInternalRecord;
 import org.hornetq.core.logging.Logger;
 import org.hornetq.utils.DataConstants;
 import org.hornetq.utils.Pair;
@@ -250,10 +252,10 @@
    {
       if (lookupRecord(info.id))
       {
-         InternalEncoder addRecord = new JournalAddRecord(true,
+         JournalInternalRecord addRecord = new JournalAddRecord(true,
                                                           info.id,
                                                           info.getUserRecordType(),
-                                                          new JournalImpl.ByteArrayEncoding(info.data));
+                                                          new ByteArrayEncoding(info.data));
          
          checkSize(addRecord.getEncodeSize());
 
@@ -269,11 +271,11 @@
       {
          JournalTransaction newTransaction = getNewJournalTransaction(transactionID);
 
-         InternalEncoder record = new JournalAddRecordTX(true,
+         JournalInternalRecord record = new JournalAddRecordTX(true,
                                                          transactionID,
                                                          info.id,
                                                          info.getUserRecordType(),
-                                                         new JournalImpl.ByteArrayEncoding(info.data));
+                                                         new ByteArrayEncoding(info.data));
          
          checkSize(record.getEncodeSize());
 
@@ -315,9 +317,9 @@
       {
          JournalTransaction newTransaction = getNewJournalTransaction(transactionID);
 
-         InternalEncoder record = new JournalDeleteRecordTX(transactionID,
+         JournalInternalRecord record = new JournalDeleteRecordTX(transactionID,
                                                             info.id,
-                                                            new JournalImpl.ByteArrayEncoding(info.data));
+                                                            new ByteArrayEncoding(info.data));
 
          checkSize(record.getEncodeSize());
          
@@ -340,9 +342,9 @@
 
          JournalTransaction newTransaction = getNewJournalTransaction(transactionID);
 
-         InternalEncoder prepareRecord = new JournalCompleteRecordTX(false,
+         JournalInternalRecord prepareRecord = new JournalCompleteRecordTX(false,
                                                                      transactionID,
-                                                                     new JournalImpl.ByteArrayEncoding(extraData));
+                                                                     new ByteArrayEncoding(extraData));
 
          checkSize(prepareRecord.getEncodeSize());
 
@@ -367,10 +369,10 @@
    {
       if (lookupRecord(info.id))
       {
-         InternalEncoder updateRecord = new JournalAddRecord(false,
+         JournalInternalRecord updateRecord = new JournalAddRecord(false,
                                                              info.id,
                                                              info.userRecordType,
-                                                             new JournalImpl.ByteArrayEncoding(info.data));
+                                                             new ByteArrayEncoding(info.data));
 
          checkSize(updateRecord.getEncodeSize());
 
@@ -395,11 +397,11 @@
       {
          JournalTransaction newTransaction = getNewJournalTransaction(transactionID);
 
-         InternalEncoder updateRecordTX = new JournalAddRecordTX(false,
+         JournalInternalRecord updateRecordTX = new JournalAddRecordTX(false,
                                                                  transactionID,
                                                                  info.id,
                                                                  info.userRecordType,
-                                                                 new JournalImpl.ByteArrayEncoding(info.data));
+                                                                 new ByteArrayEncoding(info.data));
 
             
          checkSize(updateRecordTX.getEncodeSize());

Modified: trunk/src/main/org/hornetq/core/journal/impl/JournalImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/JournalImpl.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/JournalImpl.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -54,11 +54,13 @@
 import org.hornetq.core.journal.SequentialFileFactory;
 import org.hornetq.core.journal.TestableJournal;
 import org.hornetq.core.journal.TransactionFailureCallback;
+import org.hornetq.core.journal.impl.dataformat.ByteArrayEncoding;
 import org.hornetq.core.journal.impl.dataformat.JournalAddRecord;
 import org.hornetq.core.journal.impl.dataformat.JournalAddRecordTX;
 import org.hornetq.core.journal.impl.dataformat.JournalCompleteRecordTX;
 import org.hornetq.core.journal.impl.dataformat.JournalDeleteRecord;
 import org.hornetq.core.journal.impl.dataformat.JournalDeleteRecordTX;
+import org.hornetq.core.journal.impl.dataformat.JournalInternalRecord;
 import org.hornetq.core.journal.impl.dataformat.JournalRollbackRecordTX;
 import org.hornetq.core.logging.Logger;
 import org.hornetq.utils.DataConstants;
@@ -672,7 +674,7 @@
 
       try
       {  
-         InternalEncoder addRecord = new JournalAddRecord(true, id, recordType, record);
+         JournalInternalRecord addRecord = new JournalAddRecord(true, id, recordType, record);
 
          if (callback != null)
          {
@@ -744,7 +746,7 @@
             }
          }
 
-         InternalEncoder updateRecord = new JournalAddRecord(false, id, recordType, record);
+         JournalInternalRecord updateRecord = new JournalAddRecord(false, id, recordType, record);
 
          if (callback != null)
          {
@@ -817,7 +819,7 @@
             }
          }
          
-         InternalEncoder deleteRecord = new JournalDeleteRecord(id);
+         JournalInternalRecord deleteRecord = new JournalDeleteRecord(id);
 
          if (callback != null)
          {
@@ -877,7 +879,7 @@
       try
       {
 
-         InternalEncoder addRecord = new JournalAddRecordTX(true, txID, id, recordType, record);
+         JournalInternalRecord addRecord = new JournalAddRecordTX(true, txID, id, recordType, record);
 
          JournalTransaction tx = getTransactionInfo(txID);
 
@@ -926,7 +928,7 @@
       try
       {
 
-         InternalEncoder updateRecordTX = new JournalAddRecordTX(false, txID, id, recordType, record);
+         JournalInternalRecord updateRecordTX = new JournalAddRecordTX(false, txID, id, recordType, record);
 
          JournalTransaction tx = getTransactionInfo(txID);
 
@@ -969,7 +971,7 @@
 
       try
       {
-         InternalEncoder deleteRecordTX = new JournalDeleteRecordTX(txID, id, record);
+         JournalInternalRecord deleteRecordTX = new JournalDeleteRecordTX(txID, id, record);
 
          JournalTransaction tx = getTransactionInfo(txID);
 
@@ -1054,7 +1056,7 @@
       try
       {
 
-         InternalEncoder prepareRecord = new JournalCompleteRecordTX(false, txID, transactionData);
+         JournalInternalRecord prepareRecord = new JournalCompleteRecordTX(false, txID, transactionData);
 
          if (callback != null)
          {
@@ -1134,7 +1136,7 @@
             throw new IllegalStateException("Cannot find tx with id " + txID);
          }
 
-         InternalEncoder commitRecord = new JournalCompleteRecordTX(true, txID, null);
+         JournalInternalRecord commitRecord = new JournalCompleteRecordTX(true, txID, null);
 
          if (callback != null)
          {
@@ -1194,7 +1196,7 @@
             throw new IllegalStateException("Cannot find tx with id " + txID);
          }
          
-         InternalEncoder rollbackRecord = new JournalRollbackRecordTX(txID);
+         JournalInternalRecord rollbackRecord = new JournalRollbackRecordTX(txID);
 
          if (callback != null)
          {
@@ -2697,7 +2699,7 @@
     * 
     * @param completeTransaction If the appendRecord is for a prepare or commit, where we should update the number of pendingTransactions on the current file
     * */
-   private JournalFile appendRecord(final InternalEncoder encoder,
+   private JournalFile appendRecord(final JournalInternalRecord encoder,
                                     final boolean completeTransaction,
                                     final boolean sync,
                                     final JournalTransaction tx,
@@ -3318,34 +3320,6 @@
 
    }
 
-   public static class ByteArrayEncoding implements EncodingSupport
-   {
-
-      final byte[] data;
-
-      public ByteArrayEncoding(final byte[] data)
-      {
-         this.data = data;
-      }
-
-      // Public --------------------------------------------------------
-
-      public void decode(final HornetQBuffer buffer)
-      {
-         throw new IllegalStateException("operation not supported");
-      }
-
-      public void encode(final HornetQBuffer buffer)
-      {
-         buffer.writeBytes(data);
-      }
-
-      public int getEncodeSize()
-      {
-         return data.length;
-      }
-   }
-
    // Used on Load
    private static class TransactionHolder
    {

Modified: trunk/src/main/org/hornetq/core/journal/impl/JournalTransaction.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/JournalTransaction.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/JournalTransaction.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -23,6 +23,7 @@
 
 import org.hornetq.core.buffers.HornetQBuffer;
 import org.hornetq.core.exception.HornetQException;
+import org.hornetq.core.journal.impl.dataformat.JournalInternalRecord;
 import org.hornetq.utils.DataConstants;
 
 /**
@@ -184,7 +185,7 @@
     * @param currentFile
     * @param bb
     */
-   public void fillNumberOfRecords(final JournalFile currentFile, final InternalEncoder data)
+   public void fillNumberOfRecords(final JournalFile currentFile, final JournalInternalRecord data)
    {
       data.setNumberOfRecords(getCounter(currentFile));
    }

Modified: trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -27,6 +27,7 @@
 import org.hornetq.core.journal.EncodingSupport;
 import org.hornetq.core.journal.IOAsyncTask;
 import org.hornetq.core.journal.IOCompletion;
+import org.hornetq.core.journal.impl.dataformat.ByteArrayEncoding;
 import org.hornetq.core.logging.Logger;
 import org.hornetq.utils.VariableLatch;
 
@@ -233,7 +234,7 @@
 
    public synchronized void addBytes(final HornetQBuffer bytes, final boolean sync, final IOAsyncTask callback)
    {
-      addBytes(new JournalImpl.ByteArrayEncoding(bytes.toByteBuffer().array()), sync, callback);
+      addBytes(new ByteArrayEncoding(bytes.toByteBuffer().array()), sync, callback);
    }
 
    public synchronized void addBytes(final EncodingSupport bytes, final boolean sync, final IOAsyncTask callback)

Added: trunk/src/main/org/hornetq/core/journal/impl/dataformat/ByteArrayEncoding.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/dataformat/ByteArrayEncoding.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/core/journal/impl/dataformat/ByteArrayEncoding.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.journal.impl.dataformat;
+
+import org.hornetq.core.buffers.HornetQBuffer;
+import org.hornetq.core.journal.EncodingSupport;
+
+/**
+ * A ByteArrayEncoding
+ *
+ * @author <mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ByteArrayEncoding implements EncodingSupport
+{
+
+   final byte[] data;
+
+   public ByteArrayEncoding(final byte[] data)
+   {
+      this.data = data;
+   }
+
+   // Public --------------------------------------------------------
+
+   public void decode(final HornetQBuffer buffer)
+   {
+      throw new IllegalStateException("operation not supported");
+   }
+
+   public void encode(final HornetQBuffer buffer)
+   {
+      buffer.writeBytes(data);
+   }
+
+   public int getEncodeSize()
+   {
+      return data.length;
+   }
+}
+

Modified: trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalAddRecord.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalAddRecord.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalAddRecord.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -15,7 +15,6 @@
 
 import org.hornetq.core.buffers.HornetQBuffer;
 import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.journal.impl.InternalEncoder;
 import org.hornetq.core.journal.impl.JournalImpl;
 
 /**
@@ -25,7 +24,7 @@
  *
  *
  */
-public class JournalAddRecord extends InternalEncoder
+public class JournalAddRecord extends JournalInternalRecord
 {
 
    private final long id;

Modified: trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalAddRecordTX.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalAddRecordTX.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalAddRecordTX.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -15,7 +15,6 @@
 
 import org.hornetq.core.buffers.HornetQBuffer;
 import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.journal.impl.InternalEncoder;
 import org.hornetq.core.journal.impl.JournalImpl;
 
 /**
@@ -25,7 +24,7 @@
  *
  *
  */
-public class JournalAddRecordTX extends InternalEncoder
+public class JournalAddRecordTX extends JournalInternalRecord
 {
 
    private final long txID;

Modified: trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalCompleteRecordTX.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalCompleteRecordTX.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalCompleteRecordTX.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -15,7 +15,6 @@
 
 import org.hornetq.core.buffers.HornetQBuffer;
 import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.journal.impl.InternalEncoder;
 import org.hornetq.core.journal.impl.JournalImpl;
 
 /**
@@ -37,7 +36,7 @@
  *
  *
  */
-public class JournalCompleteRecordTX extends InternalEncoder
+public class JournalCompleteRecordTX extends JournalInternalRecord
 {
    private final boolean isCommit;
 

Modified: trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalDeleteRecord.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalDeleteRecord.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalDeleteRecord.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -14,7 +14,6 @@
 package org.hornetq.core.journal.impl.dataformat;
 
 import org.hornetq.core.buffers.HornetQBuffer;
-import org.hornetq.core.journal.impl.InternalEncoder;
 import org.hornetq.core.journal.impl.JournalImpl;
 
 /**
@@ -24,7 +23,7 @@
  *
  *
  */
-public class JournalDeleteRecord extends InternalEncoder
+public class JournalDeleteRecord extends JournalInternalRecord
 {
 
    private final long id;

Modified: trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalDeleteRecordTX.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalDeleteRecordTX.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalDeleteRecordTX.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -15,7 +15,6 @@
 
 import org.hornetq.core.buffers.HornetQBuffer;
 import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.journal.impl.InternalEncoder;
 import org.hornetq.core.journal.impl.JournalImpl;
 
 /**
@@ -25,7 +24,7 @@
  *
  *
  */
-public class JournalDeleteRecordTX extends InternalEncoder
+public class JournalDeleteRecordTX extends JournalInternalRecord
 {
 
    private final long txID;

Copied: trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalInternalRecord.java (from rev 8435, trunk/src/main/org/hornetq/core/journal/impl/InternalEncoder.java)
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalInternalRecord.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalInternalRecord.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.journal.impl.dataformat;
+
+import org.hornetq.core.buffers.HornetQBuffer;
+import org.hornetq.core.journal.EncodingSupport;
+
+/**
+ * A InternalEncoder
+ *
+ * @author <mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public abstract class JournalInternalRecord implements EncodingSupport
+{
+
+   protected int fileID;
+   
+   public int getFileID()
+   {
+      return fileID;
+   }
+
+   public void setFileID(int fileID)
+   {
+      this.fileID = fileID;
+   }
+
+   public void decode(HornetQBuffer buffer)
+   {
+   }
+   
+   public void setNumberOfRecords(int records)
+   {
+   }
+   
+   public int getNumberOfRecords()
+   {
+      return 0;
+   }
+
+   public abstract int getEncodeSize();
+}
+

Modified: trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalRollbackRecordTX.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalRollbackRecordTX.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/journal/impl/dataformat/JournalRollbackRecordTX.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -14,7 +14,6 @@
 package org.hornetq.core.journal.impl.dataformat;
 
 import org.hornetq.core.buffers.HornetQBuffer;
-import org.hornetq.core.journal.impl.InternalEncoder;
 import org.hornetq.core.journal.impl.JournalImpl;
 
 /**
@@ -24,7 +23,7 @@
  *
  *
  */
-public class JournalRollbackRecordTX extends InternalEncoder
+public class JournalRollbackRecordTX extends JournalInternalRecord
 {
    private final long txID;
 

Modified: trunk/src/main/org/hornetq/core/replication/impl/ReplicatedJournal.java
===================================================================
--- trunk/src/main/org/hornetq/core/replication/impl/ReplicatedJournal.java	2009-11-28 02:30:52 UTC (rev 8435)
+++ trunk/src/main/org/hornetq/core/replication/impl/ReplicatedJournal.java	2009-11-28 02:43:42 UTC (rev 8436)
@@ -23,7 +23,7 @@
 import org.hornetq.core.journal.PreparedTransactionInfo;
 import org.hornetq.core.journal.RecordInfo;
 import org.hornetq.core.journal.TransactionFailureCallback;
-import org.hornetq.core.journal.impl.JournalImpl.ByteArrayEncoding;
+import org.hornetq.core.journal.impl.dataformat.ByteArrayEncoding;
 import org.hornetq.core.logging.Logger;
 import org.hornetq.core.persistence.impl.journal.JournalStorageManager;
 import org.hornetq.core.replication.ReplicationManager;



More information about the hornetq-commits mailing list