KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > store > access > conglomerate > ConglomerateFactory


1 /*
2
3    Derby - Class org.apache.derby.iapi.store.access.conglomerate.ConglomerateFactory
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.access.conglomerate;
23
24 import java.util.Properties JavaDoc;
25
26 import org.apache.derby.catalog.UUID;
27
28 import org.apache.derby.iapi.error.StandardException;
29
30 import org.apache.derby.iapi.store.access.ColumnOrdering;
31
32 import org.apache.derby.iapi.store.raw.ContainerKey;
33 import org.apache.derby.iapi.store.raw.Transaction;
34
35 import org.apache.derby.iapi.types.DataValueDescriptor;
36
37 /**
38
39   The factory interface for all conglomerate access methods.
40
41 **/

42
43 public interface ConglomerateFactory extends MethodFactory
44 {
45
46     static final int HEAP_FACTORY_ID = 0x00;
47     static final int BTREE_FACTORY_ID = 0x01;
48
49
50     /**
51      * Return the conglomerate factory id.
52      * <p>
53      * Return a number in the range of 0-15 which identifies this factory.
54      * Code which names conglomerates depends on this range currently, but
55      * could be easily changed to handle larger ranges. One hex digit seemed
56      * reasonable for the number of conglomerate types currently implemented
57      * (heap, btree) and those that might be implmented in the future: gist,
58      * gist btree, gist rtree, hash, others? ).
59      * <p>
60      *
61      * @return an unique identifier used to the factory into the conglomid.
62      *
63      **/

64     int getConglomerateFactoryId();
65
66     /**
67     Create the conglomerate and return a conglomerate object
68     for it. It is expected that the caller of this method will place the
69     the resulting object in the conglomerate directory.
70
71     @param xact_mgr transaction to perform the create in.
72     @param segment segment to create the conglomerate in.
73     @param input_containerid containerid to assign the container, or
74                                 ContainerHandle.DEFAULT_ASSIGN_ID if you want
75                                 raw store to assign an id.
76     @param template Template of row in the conglomerate.
77     @param columnOrder columns sort order for Index creation
78     @param properties Properties associated with the conglomerate.
79
80     @exception StandardException if the conglomerate could not be
81     opened for some reason, or if an error occurred in one of
82     the lower level modules.
83     **/

84     Conglomerate createConglomerate(
85     TransactionManager xact_mgr,
86     int segment,
87     long input_containerid,
88     DataValueDescriptor[] template,
89     ColumnOrdering[] columnOrder,
90     Properties JavaDoc properties,
91     int temporaryFlag)
92             throws StandardException;
93     /**
94      * Return Conglomerate object for conglomerate with container_key.
95      * <p>
96      * Return the Conglomerate Object. This is implementation specific.
97      * Examples of what will be done is using the key to find the file where
98      * the conglomerate is located, and then executing implementation specific
99      * code to instantiate an object from reading a "special" row from a
100      * known location in the file. In the btree case the btree conglomerate
101      * is stored as a column in the control row on the root page.
102      * <p>
103      * This operation is costly so it is likely an implementation using this
104      * will cache the conglomerate row in memory so that subsequent accesses
105      * need not perform this operation.
106      *
107      * @param xact_mgr transaction to perform the create in.
108      * @param container_key The unique id of the existing conglomerate.
109      *
110      * @return An instance of the conglomerate.
111      *
112      * @exception StandardException Standard exception policy.
113      **/

114     Conglomerate readConglomerate(
115     TransactionManager xact_mgr,
116     ContainerKey container_key)
117         throws StandardException;
118 }
119
Popular Tags