/** * Return statistics about this database. * * @param txn transaction handle (not null; not committed) * @return an immutable statistics object. */ public Stat stat(final Txn<T> txn) { if (SHOULD_CHECK) { requireNonNull(txn); txn.checkReady(); } final MDB_stat stat = new MDB_stat(RUNTIME); checkRc(LIB.mdb_stat(txn.pointer(), ptr, stat)); return new Stat( stat.f0_ms_psize.intValue(), stat.f1_ms_depth.intValue(), stat.f2_ms_branch_pages.longValue(), stat.f3_ms_leaf_pages.longValue(), stat.f4_ms_overflow_pages.longValue(), stat.f5_ms_entries.longValue()); }
FuseBufvec.init(tmp, size); long mem = 0; if (buf.count.get() == 1 && buf.buf.flags.get() == FuseBufFlags.FUSE_BUF_IS_FD) { flatbuf = buf.buf; } else { return res; tmp.buf.size.set(res); flatbuf = tmp.buf; res = write(path, flatbuf.mem.get(), flatbuf.size.get(), off, fi); if (mem != 0) { MemoryIO.getInstance().freeMemory(adr);
FuseBufvec.init(tmp, size); long mem = 0; if (buf.count.get() == 1 && buf.buf.flags.get() == FuseBufFlags.FUSE_BUF_IS_FD) { flatbuf = buf.buf; } else { return res; tmp.buf.size.set(res); flatbuf = tmp.buf; res = write(path, flatbuf.mem.get(), flatbuf.size.get(), off, fi); if (mem != 0) { MemoryIO.getInstance().freeMemory(adr);
/** * Return information about this environment. * * @return an immutable information object. */ public EnvInfo info() { if (closed) { throw new AlreadyClosedException(); } final MDB_envinfo info = new MDB_envinfo(RUNTIME); checkRc(LIB.mdb_env_info(ptr, info)); final long mapAddress; if (info.f0_me_mapaddr.get() == null) { mapAddress = 0; } else { mapAddress = info.f0_me_mapaddr.get().address(); } return new EnvInfo( mapAddress, info.f1_me_mapsize.longValue(), info.f2_me_last_pgno.longValue(), info.f3_me_last_txnid.longValue(), info.f4_me_maxreaders.intValue(), info.f5_me_numreaders.intValue()); }
@Override @NotImplemented public int read_buf(String path, Pointer bufp, @size_t long size, @off_t long off, FuseFileInfo fi) { // should be implemented or null long vecmem = MemoryIO.getInstance().allocateMemory(Struct.size(new FuseBufvec(Runtime.getSystemRuntime())), false); if (vecmem == 0) { return -ErrorCodes.ENOMEM(); } Pointer src = Pointer.wrap(Runtime.getSystemRuntime(), vecmem); long memAdr = MemoryIO.getInstance().allocateMemory(size, false); if (memAdr == 0) { MemoryIO.getInstance().freeMemory(vecmem); return -ErrorCodes.ENOMEM(); } Pointer mem = Pointer.wrap(Runtime.getSystemRuntime(), memAdr); FuseBufvec buf = FuseBufvec.of(src); FuseBufvec.init(buf, size); buf.buf.mem.set(mem); bufp.putAddress(0, src.address()); int res = read(path, mem, size, off, fi); if (res >= 0) buf.buf.size.set(res); return res; }
/** * Return information about this environment. * * @return an immutable information object. */ public EnvInfo info() { if (closed) { throw new AlreadyClosedException(); } final MDB_envinfo info = new MDB_envinfo(RUNTIME); checkRc(LIB.mdb_env_info(ptr, info)); final long mapAddress; if (info.f0_me_mapaddr.get() == null) { mapAddress = 0; } else { mapAddress = info.f0_me_mapaddr.get().address(); } return new EnvInfo( mapAddress, info.f1_me_mapsize.longValue(), info.f2_me_last_pgno.longValue(), info.f3_me_last_txnid.longValue(), info.f4_me_maxreaders.intValue(), info.f5_me_numreaders.intValue()); }
@Override @NotImplemented public int read_buf(String path, Pointer bufp, @size_t long size, @off_t long off, FuseFileInfo fi) { // should be implemented or null long vecmem = MemoryIO.getInstance().allocateMemory(Struct.size(new FuseBufvec(Runtime.getSystemRuntime())), false); if (vecmem == 0) { return -ErrorCodes.ENOMEM(); } Pointer src = Pointer.wrap(Runtime.getSystemRuntime(), vecmem); long memAdr = MemoryIO.getInstance().allocateMemory(size, false); if (memAdr == 0) { MemoryIO.getInstance().freeMemory(vecmem); return -ErrorCodes.ENOMEM(); } Pointer mem = Pointer.wrap(Runtime.getSystemRuntime(), memAdr); FuseBufvec buf = FuseBufvec.of(src); FuseBufvec.init(buf, size); buf.buf.mem.set(mem); bufp.putAddress(0, src.address()); int res = read(path, mem, size, off, fi); if (res >= 0) buf.buf.size.set(res); return res; }
/** * Return statistics about this database. * * @param txn transaction handle (not null; not committed) * @return an immutable statistics object. */ public Stat stat(final Txn<T> txn) { if (SHOULD_CHECK) { requireNonNull(txn); txn.checkReady(); } final MDB_stat stat = new MDB_stat(RUNTIME); checkRc(LIB.mdb_stat(txn.pointer(), ptr, stat)); return new Stat( stat.f0_ms_psize.intValue(), stat.f1_ms_depth.intValue(), stat.f2_ms_branch_pages.longValue(), stat.f3_ms_leaf_pages.longValue(), stat.f4_ms_overflow_pages.longValue(), stat.f5_ms_entries.longValue()); }
/** * Return statistics about this environment. * * @return an immutable statistics object. */ public Stat stat() { if (closed) { throw new AlreadyClosedException(); } final MDB_stat stat = new MDB_stat(RUNTIME); checkRc(LIB.mdb_env_stat(ptr, stat)); return new Stat( stat.f0_ms_psize.intValue(), stat.f1_ms_depth.intValue(), stat.f2_ms_branch_pages.longValue(), stat.f3_ms_leaf_pages.longValue(), stat.f4_ms_overflow_pages.longValue(), stat.f5_ms_entries.longValue()); }
/** * Return statistics about this environment. * * @return an immutable statistics object. */ public Stat stat() { if (closed) { throw new AlreadyClosedException(); } final MDB_stat stat = new MDB_stat(RUNTIME); checkRc(LIB.mdb_env_stat(ptr, stat)); return new Stat( stat.f0_ms_psize.intValue(), stat.f1_ms_depth.intValue(), stat.f2_ms_branch_pages.longValue(), stat.f3_ms_leaf_pages.longValue(), stat.f4_ms_overflow_pages.longValue(), stat.f5_ms_entries.longValue()); }