]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexPolicy.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.indexing / src / org / simantics / db / indexing / IndexPolicy.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.db.indexing;\r
13 \r
14 import org.eclipse.core.runtime.Platform;\r
15 \r
16 /**\r
17  * Contains indexing-related debugging and tracing flags.\r
18  * \r
19  * @author Tuukka Lehtonen\r
20  */\r
21 public final class IndexPolicy {\r
22 \r
23     // General debug flag for the plugin\r
24     public static boolean DEBUG = false;\r
25 \r
26     public static boolean DEBUG_INDEX_INIT       = false;\r
27     public static boolean TRACE_INDEX_MANAGEMENT = false;\r
28     public static boolean TRACE_INDEX_INIT       = false;\r
29     public static boolean TRACE_INDEX_LOAD       = false;\r
30     public static boolean TRACE_INDEX_LOCKING    = false;\r
31     public static boolean TRACE_INDEX_UPDATE     = false;\r
32     public static boolean PERF_INDEX_INIT        = false;\r
33     public static boolean PERF_INDEX_LOAD        = false;\r
34     public static boolean PERF_INDEX_UPDATE      = false;\r
35     public static boolean PERF_INDEX_QUERY       = false;\r
36 \r
37     static {\r
38         if (Activator.getDefault().isDebugging()) {\r
39             DEBUG = true;\r
40             String sTrue = Boolean.TRUE.toString();\r
41 \r
42             DEBUG_INDEX_INIT = sTrue.equalsIgnoreCase(Platform.getDebugOption(Activator.BUNDLE_ID + "/debug/indexInit")); //$NON-NLS-1$\r
43             TRACE_INDEX_MANAGEMENT = sTrue.equalsIgnoreCase(Platform.getDebugOption(Activator.BUNDLE_ID + "/trace/indexManagement")); //$NON-NLS-1$\r
44             TRACE_INDEX_INIT = sTrue.equalsIgnoreCase(Platform.getDebugOption(Activator.BUNDLE_ID + "/trace/indexInit")); //$NON-NLS-1$\r
45             TRACE_INDEX_LOAD = sTrue.equalsIgnoreCase(Platform.getDebugOption(Activator.BUNDLE_ID + "/trace/indexLoad")); //$NON-NLS-1$\r
46             TRACE_INDEX_LOCKING = sTrue.equalsIgnoreCase(Platform.getDebugOption(Activator.BUNDLE_ID + "/trace/indexLocking")); //$NON-NLS-1$\r
47             TRACE_INDEX_UPDATE = sTrue.equalsIgnoreCase(Platform.getDebugOption(Activator.BUNDLE_ID + "/trace/indexUpdate")); //$NON-NLS-1$\r
48             PERF_INDEX_INIT = sTrue.equalsIgnoreCase(Platform.getDebugOption(Activator.BUNDLE_ID + "/perf/indexInit")); //$NON-NLS-1$\r
49             PERF_INDEX_LOAD = sTrue.equalsIgnoreCase(Platform.getDebugOption(Activator.BUNDLE_ID + "/perf/indexLoad")); //$NON-NLS-1$\r
50             PERF_INDEX_UPDATE = sTrue.equalsIgnoreCase(Platform.getDebugOption(Activator.BUNDLE_ID + "/perf/indexUpdate")); //$NON-NLS-1$\r
51             PERF_INDEX_QUERY = sTrue.equalsIgnoreCase(Platform.getDebugOption(Activator.BUNDLE_ID + "/perf/indexQuery")); //$NON-NLS-1$\r
52         }\r
53     }\r
54 \r
55 }\r