File: TestStat.java

package info (click to toggle)
evolution-data-server 1.6.3-5etch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 59,384 kB
  • ctags: 43,218
  • sloc: ansic: 319,315; tcl: 30,499; xml: 19,166; sh: 18,776; perl: 11,529; cpp: 8,259; java: 7,653; makefile: 6,448; awk: 1,338; yacc: 1,103; sed: 772; cs: 505; lex: 134; asm: 14
file content (57 lines) | stat: -rw-r--r-- 1,778 bytes parent folder | download | duplicates (3)
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
/*-
 * See the file LICENSE for redistribution information.
 *
 * Copyright (c) 1997-2002
 *	Sleepycat Software.  All rights reserved.
 *
 * $Id: TestStat.java,v 1.1.1.1 2003/11/20 22:14:06 toshok Exp $
 */

/*
 * Simple test for get/put of specific values.
 */

package com.sleepycat.test;

import com.sleepycat.db.*;
import java.io.FileNotFoundException;

public class TestStat
{
    public static void main(String[] args)
    {
        int envflags =
            Db.DB_INIT_MPOOL | Db.DB_INIT_LOCK |
            Db.DB_INIT_LOG | Db.DB_INIT_TXN | Db.DB_CREATE;
        try {
            DbEnv dbenv = new DbEnv(0);
            dbenv.open(".", envflags, 0);
            Db db = new Db(dbenv, 0);
            db.open(null, "my.db", null, Db.DB_BTREE, Db.DB_CREATE, 0);

            TestUtil.populate(db);
            System.out.println("BtreeStat:");
            DbBtreeStat stat = (DbBtreeStat)db.stat(0);
            System.out.println("  bt_magic: " + stat.bt_magic);

            System.out.println("LogStat:");
            DbLogStat logstat = dbenv.log_stat(0);
            System.out.println("  st_magic: " + logstat.st_magic);
            System.out.println("  st_cur_file: " + logstat.st_cur_file);

            System.out.println("RepStat:");
            DbRepStat repstat = dbenv.rep_stat(0);
            System.out.println("  st_status: " + repstat.st_status);
            System.out.println("  st_log_duplication: " +
                               repstat.st_log_duplicated);

            System.out.println("finished test");
        }
        catch (DbException dbe) {
            System.err.println("Db Exception: " + dbe);
        }
        catch (FileNotFoundException fnfe) {
            System.err.println("FileNotFoundException: " + fnfe);
        }
    }
}