Class StreamFileContainerHandle
java.lang.Object
org.apache.derby.impl.store.raw.data.StreamFileContainerHandle
- All Implemented Interfaces:
DerbyObserver, StreamContainerHandle
final class StreamFileContainerHandle
extends Object
implements StreamContainerHandle, DerbyObserver
A handle to an open stream container, implememts StreamContainerHandle.
This class is an Observer to observe RawTransactions
MT - Mutable - Immutable identity - Thread Aware
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIs this StreamContainerHandle active.protected StreamFileContainerThe actual container we are accessing.private booleanWhether this container should be held open across commit.protected final ContainerKeyContainer identifier
MT - Immutableprivate final UUIDRaw Store identifier
MT - Immutableprotected RawTransactionour transaction.Fields inherited from interface StreamContainerHandle
TEMPORARY_SEGMENT -
Constructor Summary
ConstructorsConstructorDescriptionStreamFileContainerHandle(UUID rawStoreId, RawTransaction xact, ContainerKey identity, boolean hold) StreamFileContainerHandle(UUID rawStoreId, RawTransaction xact, StreamFileContainer container, boolean hold) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close me.booleanfetchNext(DataValueDescriptor[] row) fetch a row from the container.voidRequest the system properties associated with a container.getId()get the container key for the stream containerfinal RawTransactionReturn the RawTransaction this object was opened in.voidremove the stream containertoString()voidupdate(DerbyObservable obj, Object arg) Called when the transaction is about to complete.booleanAttach me to a container.
-
Field Details
-
rawStoreId
Raw Store identifier
MT - Immutable -
identity
Container identifier
MT - Immutable -
active
protected boolean activeIs this StreamContainerHandle active.
MT - Mutable : scoped -
container
The actual container we are accessing. Only valid when active is true.
MT - Mutable : scoped -
xact
our transaction. Only valid when active is true.
MT - Mutable : scoped -
hold
private boolean holdWhether this container should be held open across commit. Only valid when active is true.
MT - Mutable : scoped
-
-
Constructor Details
-
StreamFileContainerHandle
public StreamFileContainerHandle(UUID rawStoreId, RawTransaction xact, ContainerKey identity, boolean hold) -
StreamFileContainerHandle
public StreamFileContainerHandle(UUID rawStoreId, RawTransaction xact, StreamFileContainer container, boolean hold)
-
-
Method Details
-
getContainerProperties
Request the system properties associated with a container.- Specified by:
getContainerPropertiesin interfaceStreamContainerHandle- Parameters:
prop- Property list to fill in.- Throws:
StandardException- Standard exception policy.- See Also:
-
fetchNext
fetch a row from the container.- Specified by:
fetchNextin interfaceStreamContainerHandle- Parameters:
row- Row to be filled in with information from the record.- Throws:
StandardException- Standard exception policy.
-
close
public void close()Description copied from interface:StreamContainerHandleClose me. After using this method the caller must throw away the reference to the Container object, e.g.ref.close(); ref = null;
The container will be closed automatically at the commit or abort of the transaction if this method is not called explictly.- Specified by:
closein interfaceStreamContainerHandle- Throws:
StandardException- Standard exception policy.- See Also:
-
removeContainer
remove the stream container- Specified by:
removeContainerin interfaceStreamContainerHandle- Throws:
StandardException- Standard Derby error policy- See Also:
-
getId
get the container key for the stream container- Specified by:
getIdin interfaceStreamContainerHandle
-
update
Called when the transaction is about to complete.- Specified by:
updatein interfaceDerbyObserver- Parameters:
obj- The object which is being observedarg- Extra information being passed to the callback- See Also:
-
useContainer
Attach me to a container. If this method returns false then I cannot be used anymore, and any reference to me must be discarded.- Throws:
StandardException- Standard Derby error policy
-
getTransaction
Return the RawTransaction this object was opened in. -
toString
-