KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > je > BtreeStats


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002,2006 Oracle. All rights reserved.
5  *
6  * $Id: BtreeStats.java,v 1.10 2006/10/30 21:14:11 bostic Exp $
7  */

8
9 package com.sleepycat.je;
10
11 /**
12  * Javadoc for this public class is generated
13  * via the doc templates in the doc_src directory.
14  */

15 public class BtreeStats extends DatabaseStats {
16
17     /* Number of Bottom Internal Nodes in the database's btree. */
18     private long binCount;
19
20     /* Number of Duplicate Bottom Internal Nodes in the database's btree. */
21     private long dbinCount;
22
23     /* Number of deleted Leaf Nodes in the database's btree. */
24     private long deletedLNCount;
25
26     /* Number of duplicate Leaf Nodes in the database's btree. */
27     private long dupCountLNCount;
28
29     /*
30      * Number of Internal Nodes in database's btree. BIN's are not included.
31      */

32     private long inCount;
33
34     /*
35      * Number of Duplicate Internal Nodes in database's btree. BIN's are not
36      * included.
37      */

38     private long dinCount;
39
40     /* Number of Leaf Nodes in the database's btree. */
41     private long lnCount;
42
43     /* Maximum depth of the in memory tree. */
44     private int mainTreeMaxDepth;
45
46     /* Maximum depth of the duplicate memory trees. */
47     private int duplicateTreeMaxDepth;
48
49     /* Histogram of INs by level. */
50     private long[] insByLevel;
51
52     /* Histogram of BINs by level. */
53     private long[] binsByLevel;
54
55     /* Histogram of DINs by level. */
56     private long[] dinsByLevel;
57
58     /* Histogram of DBINs by level. */
59     private long[] dbinsByLevel;
60
61     /**
62      * Javadoc for this public method is generated via
63      * the doc templates in the doc_src directory.
64      */

65     public long getBottomInternalNodeCount() {
66         return binCount;
67     }
68
69     /**
70      * Internal use only.
71      */

72     public void setBottomInternalNodeCount(long val) {
73         binCount = val;
74     }
75
76     /**
77      * Javadoc for this public method is generated via
78      * the doc templates in the doc_src directory.
79      */

80     public long getDuplicateBottomInternalNodeCount() {
81         return dbinCount;
82     }
83
84     /**
85      * Internal use only.
86      */

87     public void setDuplicateBottomInternalNodeCount(long val) {
88         dbinCount = val;
89     }
90
91     /**
92      * Javadoc for this public method is generated via
93      * the doc templates in the doc_src directory.
94      */

95     public long getDeletedLeafNodeCount() {
96         return deletedLNCount;
97     }
98
99     /**
100      * Internal use only.
101      */

102     public void setDeletedLeafNodeCount(long val) {
103         deletedLNCount = val;
104     }
105
106     /**
107      * Javadoc for this public method is generated via
108      * the doc templates in the doc_src directory.
109      */

110     public long getDupCountLeafNodeCount() {
111         return dupCountLNCount;
112     }
113
114     /**
115      * Internal use only.
116      */

117     public void setDupCountLeafNodeCount(long val) {
118         dupCountLNCount = val;
119     }
120
121     /**
122      * Javadoc for this public method is generated via
123      * the doc templates in the doc_src directory.
124      */

125     public long getInternalNodeCount() {
126         return inCount;
127     }
128
129     /**
130      * Internal use only.
131      */

132     public void setInternalNodeCount(long val) {
133         inCount = val;
134     }
135
136     /**
137      * Javadoc for this public method is generated via
138      * the doc templates in the doc_src directory.
139      */

140     public long getDuplicateInternalNodeCount() {
141         return dinCount;
142     }
143
144     /**
145      * Internal use only.
146      */

147     public void setDuplicateInternalNodeCount(long val) {
148         dinCount = val;
149     }
150
151     /**
152      * Javadoc for this public method is generated via
153      * the doc templates in the doc_src directory.
154      */

155     public long getLeafNodeCount() {
156         return lnCount;
157     }
158
159     /**
160      * Internal use only.
161      */

162     public void setLeafNodeCount(long val) {
163         lnCount = val;
164     }
165
166     /**
167      * Javadoc for this public method is generated via
168      * the doc templates in the doc_src directory.
169      */

170     public int getMainTreeMaxDepth() {
171         return mainTreeMaxDepth;
172     }
173
174     /**
175      * Internal use only.
176      */

177     public void setMainTreeMaxDepth(int val) {
178         mainTreeMaxDepth = val;
179     }
180
181     /**
182      * Javadoc for this public method is generated via
183      * the doc templates in the doc_src directory.
184      */

185     public int getDuplicateTreeMaxDepth() {
186         return duplicateTreeMaxDepth;
187     }
188
189     /**
190      * Internal use only.
191      */

192     public void setDuplicateTreeMaxDepth(int val) {
193         duplicateTreeMaxDepth = val;
194     }
195
196     /**
197      * Javadoc for this public method is generated via
198      * the doc templates in the doc_src directory.
199      */

200     public long[] getINsByLevel() {
201         return insByLevel;
202     }
203
204     /**
205      * Internal use only.
206      */

207     public void setINsByLevel(long[] insByLevel) {
208     this.insByLevel = insByLevel;
209     }
210
211     /**
212      * Javadoc for this public method is generated via
213      * the doc templates in the doc_src directory.
214      */

215     public long[] getBINsByLevel() {
216         return binsByLevel;
217     }
218
219     /**
220      * Internal use only.
221      */

222     public void setBINsByLevel(long[] binsByLevel) {
223     this.binsByLevel = binsByLevel;
224     }
225
226     /**
227      * Javadoc for this public method is generated via
228      * the doc templates in the doc_src directory.
229      */

230     public long[] getDINsByLevel() {
231         return dinsByLevel;
232     }
233
234     /**
235      * Internal use only.
236      */

237     public void setDINsByLevel(long[] dinsByLevel) {
238     this.dinsByLevel = dinsByLevel;
239     }
240
241     /**
242      * Javadoc for this public method is generated via
243      * the doc templates in the doc_src directory.
244      */

245     public long[] getDBINsByLevel() {
246         return dbinsByLevel;
247     }
248
249     /**
250      * Internal use only.
251      */

252     public void setDBINsByLevel(long[] dbinsByLevel) {
253     this.dbinsByLevel = dbinsByLevel;
254     }
255
256     private void arrayToString(long[] arr, StringBuffer JavaDoc sb) {
257     for (int i = 0; i < arr.length; i++) {
258         long count = arr[i];
259         if (count > 0) {
260         sb.append(" level ").append(i);
261         sb.append(": count=").append(count).append("\n");
262         }
263     }
264     }
265
266     /**
267      * Javadoc for this public method is generated via
268      * the doc templates in the doc_src directory.
269      */

270     public String JavaDoc toString() {
271     StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
272     if (binCount > 0) {
273         sb.append("numBottomInternalNodes=");
274         sb.append(binCount).append("\n");
275         arrayToString(binsByLevel, sb);
276     }
277     if (inCount > 0) {
278         sb.append("numInternalNodes=");
279         sb.append(inCount).append("\n");
280         arrayToString(insByLevel, sb);
281     }
282     if (dinCount > 0) {
283         sb.append("numDuplicateInternalNodes=");
284         sb.append(dinCount).append("\n");
285         arrayToString(dinsByLevel, sb);
286     }
287     if (dbinCount > 0) {
288         sb.append("numDuplicateBottomInternalNodes=");
289         sb.append(dbinCount).append("\n");
290         arrayToString(dbinsByLevel, sb);
291     }
292     sb.append("numLeafNodes=").append(lnCount).append("\n");
293     sb.append("numDeletedLeafNodes=").
294         append(deletedLNCount).append("\n");
295     sb.append("numDuplicateCountLeafNodes=").
296         append(dupCountLNCount).append("\n");
297     sb.append("mainTreeMaxDepth=").
298         append(mainTreeMaxDepth).append("\n");
299     sb.append("duplicateTreeMaxDepth=").
300         append(duplicateTreeMaxDepth).append("\n");
301
302     return sb.toString();
303     }
304 }
305
Popular Tags