internal int compact(DB_TXN txn, DatabaseEntry start, DatabaseEntry stop, DB_COMPACT cdata, uint flags, DatabaseEntry end) { try { int ret; ret = libdb_csharpPINVOKE.DB_compact(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(start)), DBT.getCPtr(DatabaseEntry.getDBT(stop)), DB_COMPACT.getCPtr(cdata), flags, DBT.getCPtr(DatabaseEntry.getDBT(end))); DatabaseException.ThrowException(ret); return(ret); } finally { GC.KeepAlive(start); GC.KeepAlive(stop); GC.KeepAlive(end); } }
internal int compact(DB_TXN txn, DatabaseEntry start, DatabaseEntry stop, DB_COMPACT cdata, uint flags, DatabaseEntry end) { try { int ret; ret = libdb_csharpPINVOKE.DB_compact(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(start)), DBT.getCPtr(DatabaseEntry.getDBT(stop)), DB_COMPACT.getCPtr(cdata), flags, DBT.getCPtr(DatabaseEntry.getDBT(end))); DatabaseException.ThrowException(ret); return ret; } finally { GC.KeepAlive(start); GC.KeepAlive(stop); GC.KeepAlive(end); } }
/// <summary> /// Return pages to the filesystem that are already free and at the end /// of the file. /// </summary> /// <param name="txn"> /// If the operation is part of an application-specified transaction, /// <paramref name="txn"/> is a Transaction object returned from /// <see cref="DatabaseEnvironment.BeginTransaction"/>; if /// the operation is part of a Berkeley DB Concurrent Data Store group, /// <paramref name="txn"/> is a handle returned from /// <see cref="DatabaseEnvironment.BeginCDSGroup"/>; otherwise null. /// </param> /// <returns> /// The number of database pages returned to the filesystem /// </returns> public uint TruncateUnusedPages(Transaction txn) { DB_COMPACT cdata = new DB_COMPACT(); db.compact(Transaction.getDB_TXN(txn), null, null, cdata, DbConstants.DB_FREELIST_ONLY, null); return cdata.compact_pages_truncated; }
internal CompactData(DB_COMPACT dbcompact, DatabaseEntry end) { cdata = dbcompact; _end = end; }
private void doCompaction() { cdata = new DB_COMPACT(); if (fillPctSet) cdata.compact_fillpercent = fillpct; if (pgsSet) cdata.compact_pages = pgs; if (tmoutSet) cdata.compact_timeout = tmout; }
internal static HandleRef getCPtr(DB_COMPACT obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
internal static HandleRef getCPtr(DB_COMPACT obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DB_COMPACT obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }