01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Library License version 1 published by ozone-db.org.
03: //
04: // The original code and portions created by SMB are
05: // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06: //
07: // $Id: Setup.java,v 1.5 2002/06/08 00:49:38 mediumnet Exp $
08:
09: package org.ozoneDB;
10:
11: import java.util.*;
12: import org.ozoneDB.util.*;
13: import org.ozoneDB.core.Env;
14:
15: /**
16: * Setup holds all static configuration properties plus all dynamic runtime
17: * properties of an ozone environment. Setup has methods to store/update the
18: * value of a property to handle such dynamic properties.
19: *
20: *
21: * @author <a href="http://www.softwarebuero.de/">SMB</a>
22: * @author <a href="http://www.medium.net/">Medium.net</a>
23: * @version $Revision: 1.5 $Date: 2002/06/08 00:49:38 $
24: */
25: public class Setup extends EnhProperties {
26:
27: public final static String DB_ID = "ozoneDB.dbID";
28: public final static String PORT = "ozoneDB.port";
29: public final static String ADMIN_PORT = "ozoneDB.adminPort";
30: public final static String LOG_LEVEL = "ozoneDB.logLevel";
31: public final static String STORE = "ozoneDB.store";
32:
33: public final static String XOID = "ozoneDB.xoid";
34:
35: public final static String CS_CLUSTER_SIZE = "ozoneDB.classicStore.clusterSize";
36: public final static String CS_CLUSTER_SPACE_SIZE = "ozoneDB.classicStore.clusterSpaceSize";
37: public final static String CS_TABLE_BUFF_SIZE = "ozoneDB.classicStore.tableBufferSize";
38: public final static String CS_TABLE_CACHE_SIZE = "ozoneDB.classicStore.tableCacheSize";
39:
40: public final static String WS_CLUSTER_SIZE = "ozoneDB.wizardStore.clusterSize";
41: public final static String WS_CLUSTER_SIZE_RATIO = "ozoneDB.wizardStore.clusterSizeRatio";
42: public final static String WS_TABLE_BUFF_SIZE = "ozoneDB.wizardStore.tableBufferSize";
43: public final static String WS_TABLE_CACHE_SIZE = "ozoneDB.wizardStore.tableCacheSize";
44: public final static String WS_TABLE_SUBTABLE_SIZE = "ozoneDB.wizardStore.tableSubtableSize";
45: public final static String WS_COMPRESS_CLUSTERS = "ozoneDB.wizardStore.compressClusters";
46:
47: public final static String GARBAGE_COLLECTION_LEVEL = "ozoneDB.garbageCollection.level";
48:
49: protected Env env;
50:
51: public Setup(Env _env) {
52: super ();
53: }
54:
55: public Setup(Env _env, Properties _defaults) {
56: super (_defaults);
57: }
58:
59: public void fillWithOzoneDefaults() {
60: setStringProperty(STORE,
61: "org.ozoneDB.core.wizardStore.WizardStore");
62: setStringProperty(LOG_LEVEL, "INFO");
63:
64: setIntProperty(DB_ID, 0);
65: setIntProperty(PORT, 3333);
66: setIntProperty(ADMIN_PORT, 3000);
67:
68: setIntProperty(CS_CLUSTER_SIZE, 64 * 1024);
69: setIntProperty(CS_CLUSTER_SPACE_SIZE, 5000 * 1024);
70: setIntProperty(CS_TABLE_BUFF_SIZE, 50 * 256);
71: setIntProperty(CS_TABLE_CACHE_SIZE, 4 * 1024);
72:
73: setIntProperty(WS_CLUSTER_SIZE, 64 * 1024);
74: setIntProperty(WS_CLUSTER_SIZE_RATIO, 256);
75: setIntProperty(WS_TABLE_BUFF_SIZE, 15);
76: setIntProperty(WS_TABLE_SUBTABLE_SIZE, 11);
77: setIntProperty(WS_TABLE_CACHE_SIZE, 12);
78: setBooleanProperty(WS_COMPRESS_CLUSTERS, true);
79: setIntProperty(GARBAGE_COLLECTION_LEVEL, 0);
80: }
81:
82: }
|