/// <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); }
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 CompactData(DB_COMPACT dbcompact, DatabaseEntry end) { cdata = dbcompact; _end = end; }