Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
Archivo: DB.cs Proyecto: mcandre/db
 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);
     }
 }
Ejemplo n.º 3
0
 /// <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;
 }
Ejemplo n.º 4
0
 internal CompactData(DB_COMPACT dbcompact, DatabaseEntry end)
 {
     cdata = dbcompact;
     _end = end;
 }
Ejemplo n.º 5
0
        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;
        }
Ejemplo n.º 6
0
 internal static HandleRef getCPtr(DB_COMPACT obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Ejemplo n.º 7
0
 internal static HandleRef getCPtr(DB_COMPACT obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Ejemplo n.º 8
0
 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);
 }