KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > store > raw > D_ContainerKey


1 /*
2
3    Derby - Class org.apache.derby.iapi.store.raw.D_ContainerKey
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.store.raw;
23
24 import org.apache.derby.iapi.services.diag.DiagnosticableGeneric;
25
26 import java.util.Properties JavaDoc;
27
28 /**
29
30 The D_BaseContainerHandle class provides diagnostic information about the
31 BaseContainerHandle class. Currently this info is a single string of the form
32     TABLE(conglomerate_id, container_id)
33 **/

34
35 public class D_ContainerKey extends DiagnosticableGeneric
36 {
37
38     /**
39      * Return string identifying the underlying container.
40      * <p>
41      *
42      * @return A string of the form TABLE(conglomerate_id, container_id).
43      **/

44     public String JavaDoc diag()
45     {
46       return(diag_object.toString());
47     }
48
49     /**
50      * Return a set of properties describing the the key used to lock container.
51      * <p>
52      * Used by debugging code to print the lock table on demand.
53      *
54      **/

55     public void diag_detail(Properties JavaDoc prop)
56     {
57         ContainerKey key = (ContainerKey) diag_object;
58
59         prop.put(RowLock.DIAG_CONTAINERID, Long.toString(key.getContainerId()));
60
61         prop.put(RowLock.DIAG_SEGMENTID, Long.toString(key.getSegmentId()));
62
63         // The following 2 don't make sense for container locks, just set
64
// them to 0 to make it easier for now to tree container locks and
65
// row locks similarly.
66
prop.put(RowLock.DIAG_PAGENUM, Integer.toString(0));
67         prop.put(RowLock.DIAG_RECID, Integer.toString(0));
68     }
69 }
70
Popular Tags