Examples of SimpleEncoding


Examples of org.hornetq.tests.unit.core.journal.impl.fakes.SimpleEncoding

      setupAndLoadJournal(JOURNAL_SIZE, 1);

      Assert.assertEquals(0, records.size());
      Assert.assertEquals(0, transactions.size());

      SimpleEncoding xid = new SimpleEncoding(10, (byte)1);

      journalImpl.appendAddRecord(10l, (byte)0, new SimpleEncoding(10, (byte)0), false);

      journalImpl.appendDeleteRecordTransactional(1l, 10l, new SimpleEncoding(100, (byte)'j'));

      journalImpl.appendPrepareRecord(1, xid, false);

      journalImpl.debugWait();
View Full Code Here

Examples of org.hornetq.tests.unit.core.journal.impl.fakes.SimpleEncoding

      Assert.assertEquals(0, records.size());
      Assert.assertEquals(0, transactions.size());

      for (int i = 0; i < 10; i++)
      {
         journalImpl.appendAddRecordTransactional(1, i, (byte)1, new SimpleEncoding(50, (byte)1));
         journalImpl.forceMoveNextFile();
      }

      journalImpl.debugWait();

      SimpleEncoding xid1 = new SimpleEncoding(10, (byte)1);

      journalImpl.appendPrepareRecord(1l, xid1, false);

      Assert.assertEquals(12, factory.listFiles("tt").size());

      setupAndLoadJournal(JOURNAL_SIZE, 1024);

      Assert.assertEquals(0, records.size());
      Assert.assertEquals(1, transactions.size());

      Assert.assertEquals(10, transactions.get(0).extraData.length);
      for (int i = 0; i < 10; i++)
      {
         Assert.assertEquals((byte)1, transactions.get(0).extraData[i]);
      }

      journalImpl.checkReclaimStatus();

      Assert.assertEquals(10, journalImpl.getDataFilesCount());

      Assert.assertEquals(12, factory.listFiles("tt").size());

      journalImpl.appendCommitRecord(1l, false);

      setupAndLoadJournal(JOURNAL_SIZE, 1024);

      Assert.assertEquals(10, records.size());

      journalImpl.checkReclaimStatus();

      for (int i = 0; i < 10; i++)
      {
         journalImpl.appendDeleteRecordTransactional(2l, i);
      }

      SimpleEncoding xid2 = new SimpleEncoding(15, (byte)2);

      journalImpl.appendPrepareRecord(2l, xid2, false);

      setupAndLoadJournal(JOURNAL_SIZE, 1);
View Full Code Here

Examples of org.hornetq.tests.unit.core.journal.impl.fakes.SimpleEncoding

      Assert.assertEquals(0, records.size());
      Assert.assertEquals(0, transactions.size());

      for (int i = 0; i < 10; i++)
      {
         journalImpl.appendAddRecordTransactional(1, i, (byte)1, new SimpleEncoding(50, (byte)1));
      }

      journalImpl.appendPrepareRecord(1l, new SimpleEncoding(13, (byte)0), false);

      setupAndLoadJournal(JOURNAL_SIZE, 100);
      Assert.assertEquals(0, records.size());
      Assert.assertEquals(1, transactions.size());
View Full Code Here

Examples of org.hornetq.tests.unit.core.journal.impl.fakes.SimpleEncoding

      setupAndLoadJournal(JOURNAL_SIZE, 1);

      for (int i = 0; i < 10; i++)
      {
         journalImpl.appendAddRecordTransactional(1l, i, (byte)0, new SimpleEncoding(1, (byte)0));
         journalImpl.forceMoveNextFile();
      }

      journalImpl.appendRollbackRecord(1l, false);
View Full Code Here

Examples of org.hornetq.tests.unit.core.journal.impl.fakes.SimpleEncoding

      setupAndLoadJournal(JOURNAL_SIZE, 512);

      for (int i = 0; i < 10; i++)
      {
         journalImpl.appendAddRecordTransactional(1l, i, (byte)0, new SimpleEncoding(1, (byte)0));
      }

      journalImpl.appendCommitRecord(1l, false);

      setupAndLoadJournal(JOURNAL_SIZE, 100);
View Full Code Here

Examples of org.hornetq.tests.unit.core.journal.impl.fakes.SimpleEncoding

      setupAndLoadJournal(JOURNAL_SIZE, 1);

      for (int i = 0; i < 10; i++)
      {
         journalImpl.appendAddRecordTransactional(1l, i, (byte)0, new SimpleEncoding(1, (byte)0));
      }

      journalImpl.appendCommitRecord(1l, false);

      setupAndLoadJournal(JOURNAL_SIZE, 100);
View Full Code Here

Examples of org.hornetq.tests.unit.core.journal.impl.fakes.SimpleEncoding

   {
      final int JOURNAL_SIZE = 512 * 4;

      setupAndLoadJournal(JOURNAL_SIZE, 1);

      journalImpl.appendPrepareRecord(2l, new SimpleEncoding(10, (byte)'j'), false);

      journalImpl.forceMoveNextFile();

      journalImpl.appendAddRecord(1l, (byte)0, new SimpleEncoding(10, (byte)'k'), false);

      setupAndLoadJournal(JOURNAL_SIZE, 1);

      Assert.assertEquals(1, journalImpl.getDataFilesCount());

View Full Code Here

Examples of org.hornetq.tests.unit.core.journal.impl.fakes.SimpleEncoding

            {
               latchReady.countDown();
               latchStart.await();
               for (int i = 0; i < NUMBER_OF_ELEMENTS; i++)
               {
                  journalImpl.appendAddRecordTransactional(i, i, (byte)1, new SimpleEncoding(50, (byte)1));
                  journalImpl.appendCommitRecord(i, false);
                  queueDelete.offer(i);
               }
               finishedOK.incrementAndGet();
            }
View Full Code Here

Examples of org.hornetq.tests.unit.core.journal.impl.fakes.SimpleEncoding

      impl.start();

      impl.load(AlignedJournalImplTest.dummyLoader);

      impl.appendAddRecord(1l, (byte)0, new SimpleEncoding(100, (byte)'a'), false);
      impl.appendAddRecord(2l, (byte)0, new SimpleEncoding(100, (byte)'b'), false);
      impl.appendAddRecord(3l, (byte)0, new SimpleEncoding(100, (byte)'b'), false);
      impl.appendAddRecord(4l, (byte)0, new SimpleEncoding(100, (byte)'b'), false);

      impl.stop();

      impl = new JournalImpl(512 + 1024 + 512, 20, 0, 0, factory, "hq", "hq", 1000);
      impl.start();
View Full Code Here

Examples of org.hornetq.tests.unit.core.journal.impl.fakes.SimpleEncoding

      }
      // Appending records after restart should be valid (not throwing any
      // exceptions)
      for (int i = 0; i < 100; i++)
      {
         journal.appendAddRecord(1, (byte)1, new SimpleEncoding(2, (byte)'a'), false);
      }
      stopJournal();
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.