Class StreamFileContainerHandle
- java.lang.Object
-
- org.apache.derby.impl.store.raw.data.StreamFileContainerHandle
-
- All Implemented Interfaces:
DerbyObserver,StreamContainerHandle
final class StreamFileContainerHandle extends java.lang.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
Fields Modifier and Type Field Description protected booleanactiveIs this StreamContainerHandle active.protected StreamFileContainercontainerThe actual container we are accessing.private booleanholdWhether this container should be held open across commit.protected ContainerKeyidentityContainer identifier
MT - Immutableprivate UUIDrawStoreIdRaw Store identifier
MT - Immutableprotected RawTransactionxactour transaction.-
Fields inherited from interface org.apache.derby.iapi.store.raw.StreamContainerHandle
TEMPORARY_SEGMENT
-
-
Constructor Summary
Constructors Constructor Description StreamFileContainerHandle(UUID rawStoreId, RawTransaction xact, ContainerKey identity, boolean hold)StreamFileContainerHandle(UUID rawStoreId, RawTransaction xact, StreamFileContainer container, boolean hold)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close me.booleanfetchNext(DataValueDescriptor[] row)fetch a row from the container.voidgetContainerProperties(java.util.Properties prop)Request the system properties associated with a container.ContainerKeygetId()get the container key for the stream containerRawTransactiongetTransaction()Return the RawTransaction this object was opened in.voidremoveContainer()remove the stream containerjava.lang.StringtoString()voidupdate(DerbyObservable obj, java.lang.Object arg)Called when the transaction is about to complete.booleanuseContainer()Attach me to a container.
-
-
-
Field Detail
-
rawStoreId
private final UUID rawStoreId
Raw Store identifier
MT - Immutable
-
identity
protected final ContainerKey identity
Container identifier
MT - Immutable
-
active
protected boolean active
Is this StreamContainerHandle active.
MT - Mutable : scoped
-
container
protected StreamFileContainer container
The actual container we are accessing. Only valid when active is true.
MT - Mutable : scoped
-
xact
protected RawTransaction xact
our transaction. Only valid when active is true.
MT - Mutable : scoped
-
hold
private boolean hold
Whether this container should be held open across commit. Only valid when active is true.
MT - Mutable : scoped
-
-
Constructor Detail
-
StreamFileContainerHandle
public StreamFileContainerHandle(UUID rawStoreId, RawTransaction xact, ContainerKey identity, boolean hold)
-
StreamFileContainerHandle
public StreamFileContainerHandle(UUID rawStoreId, RawTransaction xact, StreamFileContainer container, boolean hold)
-
-
Method Detail
-
getContainerProperties
public void getContainerProperties(java.util.Properties prop) throws StandardExceptionRequest 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:
StreamContainerHandle.getContainerProperties(java.util.Properties)
-
fetchNext
public boolean fetchNext(DataValueDescriptor[] row) throws StandardException
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:
StreamContainerHandle.close()
-
removeContainer
public void removeContainer() throws StandardExceptionremove the stream container- Specified by:
removeContainerin interfaceStreamContainerHandle- Throws:
StandardException- Standard Derby error policy- See Also:
StreamContainerHandle.removeContainer()
-
getId
public ContainerKey getId()
get the container key for the stream container- Specified by:
getIdin interfaceStreamContainerHandle
-
update
public void update(DerbyObservable obj, java.lang.Object arg)
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:
DerbyObserver.update(org.apache.derby.iapi.services.monitor.DerbyObservable, java.lang.Object)
-
useContainer
public boolean useContainer() throws StandardExceptionAttach 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
public final RawTransaction getTransaction()
Return the RawTransaction this object was opened in.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-