Examples of ODirectMemoryPointer


Examples of com.orientechnologies.common.directmemory.ODirectMemoryPointer

  }

  public void testNativeDirectMemoryCompatibility() {
    byteSerializer.serializeNative(OBJECT, stream, 0);

    ODirectMemoryPointer pointer = new ODirectMemoryPointer(stream);
    try {
      Assert.assertEquals(byteSerializer.deserializeFromDirectMemoryObject(pointer, 0), OBJECT);
    } finally {
      pointer.free();
    }

  }
View Full Code Here

Examples of com.orientechnologies.common.directmemory.ODirectMemoryPointer

* @since 12.08.13
*/
@Test
public class SBTreeNonLeafBucketTest {
  public void testInitialization() throws Exception {
    ODirectMemoryPointer pointer = new ODirectMemoryPointer(OSBTreeBucket.MAX_PAGE_SIZE_BYTES + ODurablePage.PAGE_PADDING);
    OCachePointer cachePointer = new OCachePointer(pointer, new OLogSequenceNumber(0, 0));
    OCacheEntry cacheEntry = new OCacheEntry(0, 0, cachePointer, false);
    cachePointer.incrementReferrer();

    OSBTreeBucket<Long, OIdentifiable> treeBucket = new OSBTreeBucket<Long, OIdentifiable>(cacheEntry, false,
View Full Code Here

Examples of com.orientechnologies.common.directmemory.ODirectMemoryPointer

    while (keys.size() < 2 * OSBTreeBucket.MAX_PAGE_SIZE_BYTES / OLongSerializer.LONG_SIZE) {
      keys.add(random.nextLong());
    }

    ODirectMemoryPointer pointer = new ODirectMemoryPointer(OSBTreeBucket.MAX_PAGE_SIZE_BYTES  + ODurablePage.PAGE_PADDING);
    OCachePointer cachePointer = new OCachePointer(pointer, new OLogSequenceNumber(0, 0));
    OCacheEntry cacheEntry = new OCacheEntry(0, 0, cachePointer, false);
    cachePointer.incrementReferrer();

    OSBTreeBucket<Long, OIdentifiable> treeBucket = new OSBTreeBucket<Long, OIdentifiable>(cacheEntry, false,
View Full Code Here

Examples of com.orientechnologies.common.directmemory.ODirectMemoryPointer

    while (keys.size() < 2 * OSBTreeBucket.MAX_PAGE_SIZE_BYTES / OLongSerializer.LONG_SIZE) {
      keys.add(random.nextLong());
    }

    ODirectMemoryPointer pointer = new ODirectMemoryPointer(OSBTreeBucket.MAX_PAGE_SIZE_BYTES  + ODurablePage.PAGE_PADDING);
    OCachePointer cachePointer = new OCachePointer(pointer, new OLogSequenceNumber(0, 0));
    OCacheEntry cacheEntry = new OCacheEntry(0, 0, cachePointer, false);

    cachePointer.incrementReferrer();

View Full Code Here

Examples of com.orientechnologies.common.directmemory.ODirectMemoryPointer

  }

  public void testNativeDirectMemoryCompatibility() {
    longSerializer.serializeNative(OBJECT, stream, 0);

    ODirectMemoryPointer pointer = new ODirectMemoryPointer(stream);
    try {
      Assert.assertEquals(longSerializer.deserializeFromDirectMemoryObject(pointer, 0), OBJECT);
    } finally {
      pointer.free();
    }

  }
View Full Code Here

Examples of com.orientechnologies.common.directmemory.ODirectMemoryPointer

  }

  public void testNativeDirectMemoryCompatibility() {
    dateTimeSerializer.serializeNativeObject(OBJECT, stream, 0);

    ODirectMemoryPointer pointer = new ODirectMemoryPointer(stream);
    try {
      Assert.assertEquals(dateTimeSerializer.deserializeFromDirectMemoryObject(pointer, 0), OBJECT);
    } finally {
      pointer.free();
    }

  }
View Full Code Here

Examples of com.orientechnologies.common.directmemory.ODirectMemoryPointer

  }

  public void testNativeDirectMemoryCompatibility() {
    floatSerializer.serializeNative(OBJECT, stream, 0);

    ODirectMemoryPointer pointer = new ODirectMemoryPointer(stream);
    try {
      Assert.assertEquals(floatSerializer.deserializeFromDirectMemory(pointer, 0), OBJECT);
    } finally {
      pointer.free();
    }
  }
View Full Code Here

Examples of com.orientechnologies.common.directmemory.ODirectMemoryPointer

  }

  public void testNativeDirectMemoryCompatibility() {
    shortSerializer.serializeNative(OBJECT, stream, 0);

    ODirectMemoryPointer pointer = new ODirectMemoryPointer(stream);
    try {
      Assert.assertEquals(shortSerializer.deserializeFromDirectMemoryObject(pointer, 0), OBJECT);
    } finally {
      pointer.free();
    }
  }
View Full Code Here

Examples of com.orientechnologies.common.directmemory.ODirectMemoryPointer

public class PageChangesTest {
  public void testSingleValue() {
    OPageChanges pageChanges = new OPageChanges();
    pageChanges.addChanges(10, new byte[] { 0, 1, 2, 3 }, new byte[] { 3, 2, 1, 0 });

    ODirectMemoryPointer pointer = new ODirectMemoryPointer(20 + ODurablePage.PAGE_PADDING);
    pageChanges.applyChanges(pointer);

    Assert.assertEquals(pointer.get(10 + ODurablePage.PAGE_PADDING, 4), new byte[] { 0, 1, 2, 3 });

    pageChanges.revertChanges(pointer);
    Assert.assertEquals(pointer.get(10 + ODurablePage.PAGE_PADDING, 4), new byte[] { 3, 2, 1, 0 });

    pointer.free();
  }
View Full Code Here

Examples of com.orientechnologies.common.directmemory.ODirectMemoryPointer

    OPageChanges pageChanges = new OPageChanges();
    pageChanges.addChanges(10, new byte[] { 0, 1, 2, 3 }, new byte[] { 3, 2, 1, 0 });
    pageChanges.addChanges(20, new byte[] { 4, 5, 6, 7 }, new byte[] { 7, 6, 5, 4 });
    pageChanges.addChanges(30, new byte[] { 8, 9, 10, 11 }, new byte[] { 11, 10, 9, 8 });

    ODirectMemoryPointer pointer = new ODirectMemoryPointer(1024 + ODurablePage.PAGE_PADDING);
    pageChanges.applyChanges(pointer);

    Assert.assertEquals(pointer.get(10 + ODurablePage.PAGE_PADDING, 4), new byte[] { 0, 1, 2, 3 });
    Assert.assertEquals(pointer.get(20 + ODurablePage.PAGE_PADDING, 4), new byte[] { 4, 5, 6, 7 });
    Assert.assertEquals(pointer.get(30 + ODurablePage.PAGE_PADDING, 4), new byte[] { 8, 9, 10, 11 });

    pageChanges.revertChanges(pointer);
    Assert.assertEquals(pointer.get(10 + ODurablePage.PAGE_PADDING, 4), new byte[] { 3, 2, 1, 0 });
    Assert.assertEquals(pointer.get(20 + ODurablePage.PAGE_PADDING, 4), new byte[] { 7, 6, 5, 4 });
    Assert.assertEquals(pointer.get(30 + ODurablePage.PAGE_PADDING, 4), new byte[] { 11, 10, 9, 8 });

    pointer.free();
  }
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.