1 /* 2 3 Derby - Class org.apache.derby.iapi.store.raw.StreamContainerHandle 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.error.StandardException; 25 26 import org.apache.derby.iapi.types.DataValueDescriptor; 27 28 import java.util.Properties; 29 30 /** 31 A Stream Container handle 32 */ 33 34 public interface StreamContainerHandle { 35 36 public static final int TEMPORARY_SEGMENT = -1; 37 38 /** 39 Return my identifier. 40 */ 41 public ContainerKey getId(); 42 43 /** 44 * Request the system properties associated with a container. 45 * <p> 46 * Request the value of properties that are associated with a stream table. 47 * The following properties can be requested: 48 * derby.storage.streamFileBufferSize 49 * <p> 50 * To get the value of a particular property add it to the property list, 51 * and on return the value of the property will be set to it's current 52 * value. For example: 53 * 54 * get_prop(ConglomerateController cc) 55 * { 56 * Properties prop = new Properties(); 57 * prop.put("derby.storage.streamFileBufferSize", ""); 58 * cc.getTableProperties(prop); 59 * 60 * System.out.println( 61 * "table's buffer size = " + 62 * prop.getProperty("derby.storage.streamFileBufferSize"); 63 * } 64 * 65 * @param prop Property list to fill in. 66 * 67 * @exception StandardException Standard exception policy. 68 **/ 69 void getContainerProperties(Properties prop) 70 throws StandardException; 71 72 /** 73 Fetch the next record. 74 Fills in the Storable columns within the passed in row if 75 row is not null, otherwise the record is not fetched. 76 If the row.length is less than the number of fields in the row, 77 then, will fill the row, and ignore the rest of the row. 78 <BR> 79 When no more row is found, then false is returned. 80 81 <P> 82 <B>Locking Policy</B> 83 <BR> 84 No locks. 85 86 @param row Row to be filled in with information from the record. 87 88 @exception StandardException Standard Cloudscape error policy 89 */ 90 boolean fetchNext(DataValueDescriptor[] row) throws StandardException; 91 92 /** 93 Close me. After using this method the caller must throw away the 94 reference to the Container object, e.g. 95 <PRE> 96 ref.close(); 97 ref = null; 98 </PRE> 99 <BR> 100 The container will be closed automatically at the commit or abort 101 of the transaction if this method is not called explictly. 102 */ 103 public void close(); 104 105 /** 106 remove the stream container 107 108 @exception StandardException Standard Cloudscape error policy 109 */ 110 public void removeContainer() throws StandardException; 111 } 112