1/*- 2 * Automatically built by dist/s_java_stat. 3 * Only the javadoc comments can be edited. 4 * 5 * See the file LICENSE for redistribution information. 6 * 7 * Copyright (c) 2002,2008 Oracle. All rights reserved. 8 */ 9 10package com.sleepycat.db; 11 12/** 13The BtreeStats object is used to return Btree 14or Recno database statistics. 15*/ 16public class BtreeStats extends DatabaseStats { 17 // no public constructor 18 /* package */ BtreeStats() {} 19 20 private int bt_magic; 21 /** 22 The magic number that identifies the file as a Btree database. 23 */ 24 public int getMagic() { 25 return bt_magic; 26 } 27 28 private int bt_version; 29 /** 30 The version of the Btree database. 31 */ 32 public int getVersion() { 33 return bt_version; 34 } 35 36 private int bt_metaflags; 37 /** 38 The metadata flags. 39 */ 40 public int getMetaFlags() { 41 return bt_metaflags; 42 } 43 44 private int bt_nkeys; 45 /** 46 The number of keys or records in the database. 47 <p> 48 For the Btree Access Method, the number of keys in the database. If 49 the {@link com.sleepycat.db.Database#getStats Database.getStats} call was not configured by the 50 {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method or the database was configured 51 to support retrieval by record number, the count will be exact. 52 Otherwise, the count will be the last saved value unless it has 53 never been calculated, in which case it will be 0. 54 <p> 55 For the Recno Access Method, the number of records in the database. 56 If the database was configured with mutable record numbers the count 57 will be exact. Otherwise, if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 58 was configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method, the 59 count will be exact but will include deleted records; if the 60 {@link com.sleepycat.db.Database#getStats Database.getStats} call was not configured by the 61 {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method, the count will be exact and 62 will not include deleted records. 63 */ 64 public int getNumKeys() { 65 return bt_nkeys; 66 } 67 68 private int bt_ndata; 69 /** 70 The number of key/data pairs or records in the database. 71 <p> 72 For the Btree Access Method, the number of key/data pairs in the 73 database. If the {@link com.sleepycat.db.Database#getStats Database.getStats} call was not 74 configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method, the count 75 will be exact. Otherwise, the count will be the last saved value 76 unless it has never been calculated, in which case it will be 0. 77 <p> 78 For the Recno Access Method, the number of records in the database. 79 If the database was configured with mutable record numbers, the 80 count will be exact. Otherwise, if the {@link com.sleepycat.db.Database#getStats Database.getStats} 81 call was configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method, the 82 count will be exact but will include deleted records; if the 83 {@link com.sleepycat.db.Database#getStats Database.getStats} call was not configured by the 84 {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method, the count will be exact and 85 will not include deleted records. 86 */ 87 public int getNumData() { 88 return bt_ndata; 89 } 90 91 private int bt_pagecnt; 92 /** 93 The number of pages in the database. 94 <p> 95 Returned if {@link StatsConfig#setFast} was configured. 96 */ 97 public int getPageCount() { 98 return bt_pagecnt; 99 } 100 101 private int bt_pagesize; 102 /** 103 The underlying database page size, in bytes. 104 */ 105 public int getPageSize() { 106 return bt_pagesize; 107 } 108 109 private int bt_minkey; 110 /** 111 The minimum keys per page. 112 */ 113 public int getMinKey() { 114 return bt_minkey; 115 } 116 117 private int bt_re_len; 118 /** 119 The length of fixed-length records. 120 */ 121 public int getReLen() { 122 return bt_re_len; 123 } 124 125 private int bt_re_pad; 126 /** 127 The padding byte value for fixed-length records. 128 */ 129 public int getRePad() { 130 return bt_re_pad; 131 } 132 133 private int bt_levels; 134 /** 135 The number of levels in the database. 136<p> 137The information is only included if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 138was not configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method. 139 */ 140 public int getLevels() { 141 return bt_levels; 142 } 143 144 private int bt_int_pg; 145 /** 146 The number of database internal pages. 147<p> 148The information is only included if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 149was not configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method. 150 */ 151 public int getIntPages() { 152 return bt_int_pg; 153 } 154 155 private int bt_leaf_pg; 156 /** 157 The number of database leaf pages. 158<p> 159The information is only included if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 160was not configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method. 161 */ 162 public int getLeafPages() { 163 return bt_leaf_pg; 164 } 165 166 private int bt_dup_pg; 167 /** 168 The number of database duplicate pages. 169<p> 170The information is only included if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 171was not configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method. 172 */ 173 public int getDupPages() { 174 return bt_dup_pg; 175 } 176 177 private int bt_over_pg; 178 /** 179 The number of database overflow pages. 180<p> 181The information is only included if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 182was not configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method. 183 */ 184 public int getOverPages() { 185 return bt_over_pg; 186 } 187 188 private int bt_empty_pg; 189 /** 190 The number of empty database pages. 191<p> 192The information is only included if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 193was not configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method. 194 */ 195 public int getEmptyPages() { 196 return bt_empty_pg; 197 } 198 199 private int bt_free; 200 /** 201 The number of pages on the free list. 202<p> 203The information is only included if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 204was not configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method. 205 */ 206 public int getFree() { 207 return bt_free; 208 } 209 210 private int bt_int_pgfree; 211 /** 212 The number of bytes free in database internal pages. 213<p> 214The information is only included if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 215was not configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method. 216 */ 217 public int getIntPagesFree() { 218 return bt_int_pgfree; 219 } 220 221 private int bt_leaf_pgfree; 222 /** 223 The number of bytes free in database leaf pages. 224<p> 225The information is only included if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 226was not configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method. 227 */ 228 public int getLeafPagesFree() { 229 return bt_leaf_pgfree; 230 } 231 232 private int bt_dup_pgfree; 233 /** 234 The number of bytes free in database duplicate pages. 235<p> 236The information is only included if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 237was not configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method. 238 */ 239 public int getDupPagesFree() { 240 return bt_dup_pgfree; 241 } 242 243 private int bt_over_pgfree; 244 /** 245 The number of bytes free in database overflow pages. 246<p> 247The information is only included if the {@link com.sleepycat.db.Database#getStats Database.getStats} call 248was not configured by the {@link com.sleepycat.db.StatsConfig#setFast StatsConfig.setFast} method. 249 */ 250 public int getOverPagesFree() { 251 return bt_over_pgfree; 252 } 253 254 /** 255 For convenience, the BtreeStats class has a toString method 256 that lists all the data fields. 257 */ 258 public String toString() { 259 return "BtreeStats:" 260 + "\n bt_magic=" + bt_magic 261 + "\n bt_version=" + bt_version 262 + "\n bt_metaflags=" + bt_metaflags 263 + "\n bt_nkeys=" + bt_nkeys 264 + "\n bt_ndata=" + bt_ndata 265 + "\n bt_pagecnt=" + bt_pagecnt 266 + "\n bt_pagesize=" + bt_pagesize 267 + "\n bt_minkey=" + bt_minkey 268 + "\n bt_re_len=" + bt_re_len 269 + "\n bt_re_pad=" + bt_re_pad 270 + "\n bt_levels=" + bt_levels 271 + "\n bt_int_pg=" + bt_int_pg 272 + "\n bt_leaf_pg=" + bt_leaf_pg 273 + "\n bt_dup_pg=" + bt_dup_pg 274 + "\n bt_over_pg=" + bt_over_pg 275 + "\n bt_empty_pg=" + bt_empty_pg 276 + "\n bt_free=" + bt_free 277 + "\n bt_int_pgfree=" + bt_int_pgfree 278 + "\n bt_leaf_pgfree=" + bt_leaf_pgfree 279 + "\n bt_dup_pgfree=" + bt_dup_pgfree 280 + "\n bt_over_pgfree=" + bt_over_pgfree 281 ; 282 } 283} 284