Examples of MappedFileVol


Examples of org.mapdb.Volume.MappedFileVol

    public void canDeleteDBOnBrokenLog() throws IOException {
        // init empty, but valid DB
        DBMaker.newFileDB(index).make().close();

        // trash the log
        MappedFileVol physVol = new Volume.MappedFileVol(data, false, 0,CC.VOLUME_SLICE_SHIFT,0);
        physVol.ensureAvailable(32);
        physVol.putInt(0, StoreWAL.HEADER);
        physVol.putUnsignedShort(4, StoreWAL.STORE_VERSION);
        physVol.putLong(8, StoreWAL.LOG_SEAL);
        physVol.putLong(16, 123456789L);
        physVol.sync();
        physVol.close();

        try {
            DBMaker.newFileDB(index).make();
            Assert.fail("Expected exception not thrown");
        } catch (final Exception e) {
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.