📄 setup.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Library License version 1 published by ozone-db.org.//// The original code and portions created by SMB are// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.//// $Id: Setup.java,v 1.9.2.1 2004/01/11 20:42:30 per_nyfelt Exp $package org.ozoneDB;import java.util.*;import org.ozoneDB.util.*;import org.ozoneDB.core.Env;/** * Setup holds all static configuration properties plus all dynamic runtime * properties of an ozone environment. Setup has methods to store/update the * value of a property to handle such dynamic properties. * * * @author <a href="http://www.softwarebuero.de/">SMB</a> * @author <a href="http://www.medium.net/">Medium.net</a> * @version $Revision: 1.9.2.1 $Date: 2004/01/11 20:42:30 $ */public class Setup extends EnhProperties { public final static String DB_ID = "ozoneDB.dbID"; public final static String PORT = "ozoneDB.port"; public final static String ADMIN_PORT = "ozoneDB.adminPort"; public final static String LOG_LEVEL = "ozoneDB.logLevel"; public final static String STORE = "ozoneDB.store"; public static final String MIN_FREE_MEMORY = "ozoneDB.vm.minFreeMemory"; public static final String TOTAL_MEMORY = "ozoneDB.vm.totalMemory"; public final static String XOID = "ozoneDB.xoid"; public final static String CS_CLUSTER_SIZE = "ozoneDB.classicStore.clusterSize"; public final static String CS_CLUSTER_SPACE_SIZE = "ozoneDB.classicStore.clusterSpaceSize"; public final static String CS_TABLE_BUFF_SIZE = "ozoneDB.classicStore.tableBufferSize"; public final static String CS_TABLE_CACHE_SIZE = "ozoneDB.classicStore.tableCacheSize"; public final static String WS_CLUSTER_SIZE = "ozoneDB.wizardStore.clusterSize"; public final static String WS_CLUSTER_SIZE_RATIO = "ozoneDB.wizardStore.clusterSizeRatio"; public final static String WS_TABLE_BUFF_SIZE = "ozoneDB.wizardStore.tableBufferSize"; public final static String WS_TABLE_CACHE_SIZE = "ozoneDB.wizardStore.tableCacheSize"; public final static String WS_TABLE_SUBTABLE_SIZE = "ozoneDB.wizardStore.tableSubtableSize"; public final static String WS_COMPRESS_CLUSTERS = "ozoneDB.wizardStore.compressClusters"; public final static String GARBAGE_COLLECTION_LEVEL = "ozoneDB.garbageCollection.level"; protected Env env; public Setup( Env env ) { super(); //TODO: is this what we should do with env? this.env = env; } public Setup( Env env, Properties defaults ) { super( defaults ); //TODO: is this what we should do with env? this.env = env; } public String stringProperty(String _key, String _default) { String property = super.stringProperty(_key, _default); // This is to make it possible to just use e.g. MagicStore as the value in the prps file // it also makes us backwards compatible with old WizardStore location if (_key.equals(STORE)) { if (property.matches(".*WizardStore")) { property = "org.ozoneDB.core.storage.wizardStore.WizardStore"; } else if (property.matches(".*MagicStore")) { property = "org.ozoneDB.core.storage.magicStore.MagicStore"; } else if (property.matches(".*GammaStore")) { property = "org.ozoneDB.core.storage.gammaStore.GammaStore"; } else if (property.matches(".*ClassicStore")) { property = "org.ozoneDB.core.storage.classicStore.ClassicStore"; } } return property; } public void fillWithOzoneDefaults() { setStringProperty( STORE, "org.ozoneDB.core.storage.wizardStore.WizardStore"); setIntProperty( DB_ID, 0 ); setIntProperty( PORT, 3333 ); setIntProperty( ADMIN_PORT, 3000 ); setIntProperty( CS_CLUSTER_SIZE, 64 * 1024 ); setIntProperty( CS_CLUSTER_SPACE_SIZE, 5000 * 1024 ); setIntProperty( CS_TABLE_BUFF_SIZE, 50 * 256 ); setIntProperty( CS_TABLE_CACHE_SIZE, 4 * 1024 ); setIntProperty( WS_CLUSTER_SIZE, 64 * 1024 ); setIntProperty( WS_CLUSTER_SIZE_RATIO, 256 ); setIntProperty( WS_TABLE_BUFF_SIZE, 15 ); setIntArrayProperty( WS_TABLE_SUBTABLE_SIZE, new int[] {11} ); setIntProperty( WS_TABLE_CACHE_SIZE, 12 ); setBooleanProperty( WS_COMPRESS_CLUSTERS, true ); setIntProperty(GARBAGE_COLLECTION_LEVEL,0); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -