Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / MyDerby-10.3 / java / engine / org / apache / derby / iapi / store / access / conglomerate / ConglomerateFactory.java
diff --git a/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/iapi/store/access/conglomerate/ConglomerateFactory.java b/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/iapi/store/access/conglomerate/ConglomerateFactory.java
new file mode 100644 (file)
index 0000000..2b55946
--- /dev/null
@@ -0,0 +1,120 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.iapi.store.access.conglomerate.ConglomerateFactory\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.access.conglomerate;\r
+\r
+import java.util.Properties;\r
+\r
+import org.apache.derby.catalog.UUID;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+\r
+import org.apache.derby.iapi.store.access.ColumnOrdering;\r
+\r
+import org.apache.derby.iapi.store.raw.ContainerKey;\r
+import org.apache.derby.iapi.store.raw.Transaction;\r
+\r
+import org.apache.derby.iapi.types.DataValueDescriptor;\r
+\r
+/**\r
+\r
+  The factory interface for all conglomerate access methods.\r
+\r
+**/\r
+\r
+public interface ConglomerateFactory extends MethodFactory\r
+{\r
+\r
+    static final int    HEAP_FACTORY_ID     = 0x00;\r
+    static final int    BTREE_FACTORY_ID    = 0x01;\r
+\r
+\r
+    /**\r
+     * Return the conglomerate factory id.\r
+     * <p>\r
+     * Return a number in the range of 0-15 which identifies this factory.\r
+     * Code which names conglomerates depends on this range currently, but\r
+     * could be easily changed to handle larger ranges.   One hex digit seemed\r
+     * reasonable for the number of conglomerate types currently implemented\r
+     * (heap, btree) and those that might be implmented in the future: gist, \r
+     * gist btree, gist rtree, hash, others? ).\r
+     * <p>\r
+     *\r
+        * @return an unique identifier used to the factory into the conglomid.\r
+     *\r
+     **/\r
+    int getConglomerateFactoryId();\r
+\r
+       /**\r
+       Create the conglomerate and return a conglomerate object\r
+       for it.  It is expected that the caller of this method will place the\r
+    the resulting object in the conglomerate directory.\r
+\r
+    @param xact_mgr             transaction to perform the create in.\r
+    @param segment              segment to create the conglomerate in.\r
+    @param input_containerid    containerid to assign the container, or \r
+                                ContainerHandle.DEFAULT_ASSIGN_ID if you want\r
+                                raw store to assign an id.\r
+    @param template             Template of row in the conglomerate.\r
+       @param columnOrder          columns sort order for Index creation\r
+    @param collationIds         collation ids of columns in the conglomerate.\r
+    @param properties           Properties associated with the conglomerate.\r
+\r
+       @exception StandardException if the conglomerate could not be\r
+       opened for some reason, or if an error occurred in one of\r
+       the lower level modules.\r
+       **/\r
+       Conglomerate createConglomerate(\r
+    TransactionManager      xact_mgr,\r
+    int                     segment,\r
+    long                    input_containerid,\r
+    DataValueDescriptor[]   template,\r
+       ColumnOrdering[]                columnOrder,\r
+    int[]                   collationIds,\r
+    Properties              properties,\r
+       int                                             temporaryFlag)\r
+            throws StandardException;\r
+    /**\r
+     * Return Conglomerate object for conglomerate with container_key.\r
+     * <p>\r
+     * Return the Conglomerate Object.  This is implementation specific.\r
+     * Examples of what will be done is using the key to find the file where\r
+     * the conglomerate is located, and then executing implementation specific\r
+     * code to instantiate an object from reading a "special" row from a\r
+     * known location in the file.  In the btree case the btree conglomerate\r
+     * is stored as a column in the control row on the root page.\r
+     * <p>\r
+     * This operation is costly so it is likely an implementation using this\r
+     * will cache the conglomerate row in memory so that subsequent accesses\r
+     * need not perform this operation.\r
+     *\r
+     * @param xact_mgr      transaction to perform the create in.\r
+     * @param container_key The unique id of the existing conglomerate.\r
+     *\r
+        * @return An instance of the conglomerate.\r
+     *\r
+        * @exception  StandardException  Standard exception policy.\r
+     **/\r
+    Conglomerate readConglomerate(\r
+    TransactionManager      xact_mgr,\r
+    ContainerKey            container_key)\r
+               throws StandardException;\r
+}\r