Search in sources :

Example 6 with MemoryCMRImpl

use of io.questdb.cairo.vm.MemoryCMRImpl in project questdb by bluestreak01.

the class ExtendedOnePageMemoryTest method testFailOnGrow.

@Test
public void testFailOnGrow() throws IOException {
    createFile();
    try (MemoryMR mem = new MemoryCMRImpl()) {
        int sz = FILE_SIZE / 2;
        mem.of(ff, path, sz, sz, MemoryTag.MMAP_DEFAULT);
        FILE_MAP_FAIL.set(true);
        sz *= 2;
        try {
            mem.extend(sz);
            Assert.fail();
        } catch (CairoException ex) {
            TestUtils.assertContains(ex.getFlyweightMessage(), "could not remap");
        }
    }
}
Also used : MemoryMR(io.questdb.cairo.vm.api.MemoryMR) MemoryCMRImpl(io.questdb.cairo.vm.MemoryCMRImpl)

Example 7 with MemoryCMRImpl

use of io.questdb.cairo.vm.MemoryCMRImpl in project questdb by bluestreak01.

the class ExtendedOnePageMemoryTest method testFailOnInitialMap.

@Test
public void testFailOnInitialMap() throws IOException {
    createFile();
    try (MemoryMR mem = new MemoryCMRImpl()) {
        FILE_MAP_FAIL.set(true);
        try {
            mem.smallFile(ff, path, MemoryTag.MMAP_DEFAULT);
            Assert.fail();
        } catch (CairoException ex) {
            TestUtils.assertContains(ex.getFlyweightMessage(), "could not mmap");
        }
    }
}
Also used : MemoryMR(io.questdb.cairo.vm.api.MemoryMR) MemoryCMRImpl(io.questdb.cairo.vm.MemoryCMRImpl)

Aggregations

MemoryCMRImpl (io.questdb.cairo.vm.MemoryCMRImpl)7 MemoryMR (io.questdb.cairo.vm.api.MemoryMR)5 Path (io.questdb.std.str.Path)3 MemoryARW (io.questdb.cairo.vm.api.MemoryARW)1 MemoryCMARW (io.questdb.cairo.vm.api.MemoryCMARW)1 Test (org.junit.Test)1