1/*- 2 * See the file LICENSE for redistribution information. 3 * 4 * Copyright (c) 2009 Oracle. All rights reserved. 5 * 6 */ 7using System; 8using System.Collections.Generic; 9using System.Text; 10using BerkeleyDB.Internal; 11 12namespace BerkeleyDB { 13 /// <summary> 14 /// A class for representing compact operation statistics 15 /// </summary> 16 public class CompactData { 17 private DB_COMPACT cdata; 18 private DatabaseEntry _end; 19 20 internal CompactData(DB_COMPACT dbcompact, DatabaseEntry end) { 21 cdata = dbcompact; 22 _end = end; 23 } 24 25 /// <summary> 26 /// If no <see cref="Transaction"/> parameter was specified, the 27 /// number of deadlocks which occurred. 28 /// </summary> 29 public uint Deadlocks { 30 get { return cdata.compact_deadlock; } 31 } 32 /// <summary> 33 /// The number of levels removed from the Btree or Recno database during 34 /// the compaction phase. 35 /// </summary> 36 public uint Levels { 37 get { return cdata.compact_levels; } 38 } 39 /// <summary> 40 /// The number of database pages reviewed during the compaction phase. 41 /// </summary> 42 public uint PagesExamined { 43 get { return cdata.compact_pages_examine; } 44 } 45 /// <summary> 46 /// The number of database pages freed during the compaction phase. 47 /// </summary> 48 public uint PagesFreed { 49 get { return cdata.compact_pages_free; } 50 } 51 /// <summary> 52 /// The number of database pages returned to the filesystem. 53 /// </summary> 54 public uint PagesTruncated { 55 get { return cdata.compact_pages_truncated; } 56 } 57 /// <summary> 58 /// The database key marking the end of the compaction operation. This 59 /// is generally the first key of the page where the operation stopped 60 /// and is only non-null if <see cref="CompactConfig.returnEnd"/> was 61 /// true. 62 /// </summary> 63 public DatabaseEntry End { 64 get { return _end; } 65 } 66 67 } 68}