Package org.hornetq.core.journal.impl.dataformat

Examples of org.hornetq.core.journal.impl.dataformat.ByteArrayEncoding


      if (lookupRecord(info.id))
      {
         JournalInternalRecord addRecord = new JournalAddRecord(true,
                                                                info.id,
                                                                info.getUserRecordType(),
                                                                new ByteArrayEncoding(info.data));
         addRecord.setCompactCount((short)(info.compactCount + 1));

         checkSize(addRecord.getEncodeSize(), info.compactCount);

         writeEncoder(addRecord);
View Full Code Here


         JournalInternalRecord record = new JournalAddRecordTX(true,
                                                               transactionID,
                                                               info.id,
                                                               info.getUserRecordType(),
                                                               new ByteArrayEncoding(info.data));

         record.setCompactCount((short)(info.compactCount + 1));

         checkSize(record.getEncodeSize(), info.compactCount);
View Full Code Here

      {
         JournalTransaction newTransaction = getNewJournalTransaction(transactionID);

         JournalInternalRecord record = new JournalDeleteRecordTX(transactionID,
                                                                  info.id,
                                                                  new ByteArrayEncoding(info.data));

         checkSize(record.getEncodeSize());

         writeEncoder(record);
View Full Code Here

      {

         JournalTransaction newTransaction = getNewJournalTransaction(transactionID);

         JournalInternalRecord prepareRecord =
                  new JournalCompleteRecordTX(TX_RECORD_TYPE.PREPARE, transactionID, new ByteArrayEncoding(extraData));

         checkSize(prepareRecord.getEncodeSize());

         writeEncoder(prepareRecord, newTransaction.getCounter(currentFile));
View Full Code Here

      if (lookupRecord(info.id))
      {
         JournalInternalRecord updateRecord = new JournalAddRecord(false,
                                                                   info.id,
                                                                   info.userRecordType,
                                                                   new ByteArrayEncoding(info.data));

         updateRecord.setCompactCount((short)(info.compactCount + 1));

         checkSize(updateRecord.getEncodeSize(), info.compactCount);
View Full Code Here

         JournalInternalRecord updateRecordTX = new JournalAddRecordTX(false,
                                                                       transactionID,
                                                                       info.id,
                                                                       info.userRecordType,
                                                                       new ByteArrayEncoding(info.data));

         updateRecordTX.setCompactCount((short)(info.compactCount + 1));

         checkSize(updateRecordTX.getEncodeSize(), info.compactCount);
View Full Code Here

         }

         JournalInternalRecord controlRecord = new JournalAddRecord(true,
                                                                    1,
                                                                    (byte)0,
                                                                    new ByteArrayEncoding(filesToRename.toByteBuffer()
                                                                                                       .array()));

         HornetQBuffer renameBuffer = HornetQBuffers.dynamicBuffer(filesToRename.writerIndex());

         controlRecord.setFileID(0);
View Full Code Here

      {
         lockAppend.lock();
         try
         {

            final ByteArrayEncoding byteEncoder = new ByteArrayEncoding(new byte[128 * 1024]);

            JournalInternalRecord blastRecord = new JournalInternalRecord()
            {

               @Override
               public int getEncodeSize()
               {
                  return byteEncoder.getEncodeSize();
               }

               public void encode(final HornetQBuffer buffer)
               {
                  byteEncoder.encode(buffer);
               }
            };

            for (int i = 0; i < pages; i++)
            {
View Full Code Here

   // Journal implementation
   // ----------------------------------------------------------------

   public void appendAddRecord(final long id, final byte recordType, final byte[] record, final boolean sync) throws Exception
   {
      appendAddRecord(id, recordType, new ByteArrayEncoding(record), sync);
   }
View Full Code Here

                               final byte recordType,
                               final byte[] record,
                               final boolean sync,
                               final IOCompletion callback) throws Exception
   {
      appendAddRecord(id, recordType, new ByteArrayEncoding(record), sync, callback);
   }
View Full Code Here

TOP

Related Classes of org.hornetq.core.journal.impl.dataformat.ByteArrayEncoding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.