summaryrefslogtreecommitdiff
path: root/lang/java/src/com/sleepycat/db/HeapStats.java
blob: 08f450f532bfa8d474dc45fa6417a6b9874de485 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*-
 * Automatically built by dist/s_java_stat.
 * Only the javadoc comments can be edited.
 *
 * See the file LICENSE for redistribution information.
 *
 * Copyright (c) 2002, 2015 Oracle and/or its affiliates.  All rights reserved.
 */

package com.sleepycat.db;

/**
The HeapStats object is used to return Heap database statistics.
*/
public class HeapStats extends DatabaseStats {
    // no public constructor
    /* package */ HeapStats() {}

    private int heap_magic;
    /** 
	Magic number that identifies the file as a Heap file.
    */
    public int getHeapMagic() {
        return heap_magic;
    }

    private int heap_version;
    /** 
	The version of the Heap database.
    */
    public int getHeapVersion() {
        return heap_version;
    }

    private int heap_metaflags;
    /**
       Reports internal flags. For internal use only. 
    */
    public int getHeapMetaFlags() {
        return heap_metaflags;
    }

    private int heap_nblobs;
    /**
        The number of blob records.
    */
    public int getHeapNumBlobs() {
        return heap_nblobs;
    }

    private int heap_nrecs;
    /**
       Reports the number of records in the Heap database.
    */
    public int getHeapNumRecs() {
        return heap_nrecs;
    }

    private int heap_pagecnt;
    /**
       The number of pages in the database.
    */
    public int getHeapPageCount() {
        return heap_pagecnt;
    }

    private int heap_pagesize;
    /**
       The underlying database page (and bucket) size, in bytes.
    */
    public int getHeapPageSize() {
        return heap_pagesize;
    }

    private int heap_nregions;
    /**
       The number of regions in the Heap database.
    */
    public int getHeapNumRegions() {
        return heap_nregions;
    }

    private int heap_regionsize;
    /** 
    The number of pages in a region in the Heap database. Returned if
    DB_FAST_STAT is set. 
    */
    public int getHeapRegionSize() {
        return heap_regionsize;
    }

    /**
    For convenience, the HeapStats class has a toString method
    that lists all the data fields.
    */
    public String toString() {
        return "HeapStats:"
            + "\n  heap_magic=" + heap_magic
            + "\n  heap_version=" + heap_version
            + "\n  heap_metaflags=" + heap_metaflags
            + "\n  heap_nblobs=" + heap_nblobs
            + "\n  heap_nrecs=" + heap_nrecs
            + "\n  heap_pagecnt=" + heap_pagecnt
            + "\n  heap_pagesize=" + heap_pagesize
            + "\n  heap_nregions=" + heap_nregions
            + "\n  heap_regionsize=" + heap_regionsize
            ;
    }
}