01: /*
02:
03: Derby - Class org.apache.derby.iapi.store.raw.D_ContainerKey
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (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;
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: * Return string identifying the underlying container.
39: * <p>
40: *
41: * @return A string of the form TABLE(conglomerate_id, container_id).
42: **/
43: public String diag() {
44: return (diag_object.toString());
45: }
46:
47: /**
48: * Return a set of properties describing the the key used to lock container.
49: * <p>
50: * Used by debugging code to print the lock table on demand.
51: *
52: **/
53: public void diag_detail(Properties prop) {
54: ContainerKey key = (ContainerKey) diag_object;
55:
56: prop.put(RowLock.DIAG_CONTAINERID, Long.toString(key
57: .getContainerId()));
58:
59: prop.put(RowLock.DIAG_SEGMENTID, Long.toString(key
60: .getSegmentId()));
61:
62: // The following 2 don't make sense for container locks, just set
63: // them to 0 to make it easier for now to tree container locks and
64: // row locks similarly.
65: prop.put(RowLock.DIAG_PAGENUM, Integer.toString(0));
66: prop.put(RowLock.DIAG_RECID, Integer.toString(0));
67: }
68: }
|