Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / derby-10.3.2.1 / java / engine / org / apache / derby / iapi / store / raw / D_ContainerKey.java
diff --git a/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/iapi/store/raw/D_ContainerKey.java b/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/iapi/store/raw/D_ContainerKey.java
new file mode 100644 (file)
index 0000000..3b6396b
--- /dev/null
@@ -0,0 +1,69 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.iapi.store.raw.D_ContainerKey\r
+\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to you under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.iapi.store.raw;\r
+\r
+import org.apache.derby.iapi.services.diag.DiagnosticableGeneric;\r
+\r
+import java.util.Properties;\r
+\r
+/**\r
+\r
+The D_BaseContainerHandle class provides diagnostic information about the\r
+BaseContainerHandle class.  Currently this info is a single string of the form\r
+    TABLE(conglomerate_id, container_id)\r
+**/\r
+\r
+public class D_ContainerKey extends DiagnosticableGeneric\r
+{\r
+\r
+    /**\r
+     * Return string identifying the underlying container.\r
+     * <p>\r
+     *\r
+        * @return A string of the form TABLE(conglomerate_id, container_id).\r
+        **/\r
+    public String diag()\r
+    {\r
+      return(diag_object.toString());\r
+    }\r
+\r
+    /**\r
+     * Return a set of properties describing the the key used to lock container.\r
+     * <p>\r
+     * Used by debugging code to print the lock table on demand.\r
+     *\r
+     **/\r
+    public void diag_detail(Properties prop)\r
+    {\r
+        ContainerKey        key         = (ContainerKey) diag_object;\r
+\r
+        prop.put(RowLock.DIAG_CONTAINERID, Long.toString(key.getContainerId()));\r
+\r
+        prop.put(RowLock.DIAG_SEGMENTID, Long.toString(key.getSegmentId()));\r
+\r
+        // The following 2 don't make sense for container locks, just set\r
+        // them to 0 to make it easier for now to tree container locks and\r
+        // row locks similarly.  \r
+        prop.put(RowLock.DIAG_PAGENUM, Integer.toString(0));\r
+        prop.put(RowLock.DIAG_RECID,   Integer.toString(0));\r
+    }\r
+}\r