001: /*
002:
003: Derby - Class org.apache.derby.iapi.store.raw.StreamContainerHandle
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to you under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derby.iapi.store.raw;
023:
024: import org.apache.derby.iapi.error.StandardException;
025:
026: import org.apache.derby.iapi.types.DataValueDescriptor;
027:
028: import java.util.Properties;
029:
030: /**
031: A Stream Container handle
032: */
033:
034: public interface StreamContainerHandle {
035:
036: public static final int TEMPORARY_SEGMENT = -1;
037:
038: /**
039: Return my identifier.
040: */
041: public ContainerKey getId();
042:
043: /**
044: * Request the system properties associated with a container.
045: * <p>
046: * Request the value of properties that are associated with a stream table.
047: * The following properties can be requested:
048: * derby.storage.streamFileBufferSize
049: * <p>
050: * To get the value of a particular property add it to the property list,
051: * and on return the value of the property will be set to it's current
052: * value. For example:
053: *
054: * get_prop(ConglomerateController cc)
055: * {
056: * Properties prop = new Properties();
057: * prop.put("derby.storage.streamFileBufferSize", "");
058: * cc.getTableProperties(prop);
059: *
060: * System.out.println(
061: * "table's buffer size = " +
062: * prop.getProperty("derby.storage.streamFileBufferSize");
063: * }
064: *
065: * @param prop Property list to fill in.
066: *
067: * @exception StandardException Standard exception policy.
068: **/
069: void getContainerProperties(Properties prop)
070: throws StandardException;
071:
072: /**
073: Fetch the next record.
074: Fills in the Storable columns within the passed in row if
075: row is not null, otherwise the record is not fetched.
076: If the row.length is less than the number of fields in the row,
077: then, will fill the row, and ignore the rest of the row.
078: <BR>
079: When no more row is found, then false is returned.
080:
081: <P>
082: <B>Locking Policy</B>
083: <BR>
084: No locks.
085:
086: @param row Row to be filled in with information from the record.
087:
088: @exception StandardException Standard Cloudscape error policy
089: */
090: boolean fetchNext(DataValueDescriptor[] row)
091: throws StandardException;
092:
093: /**
094: Close me. After using this method the caller must throw away the
095: reference to the Container object, e.g.
096: <PRE>
097: ref.close();
098: ref = null;
099: </PRE>
100: <BR>
101: The container will be closed automatically at the commit or abort
102: of the transaction if this method is not called explictly.
103: */
104: public void close();
105:
106: /**
107: remove the stream container
108:
109: @exception StandardException Standard Cloudscape error policy
110: */
111: public void removeContainer() throws StandardException;
112: }
|