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 boolean
Is this StreamContainerHandle active.protected StreamFileContainer
The actual container we are accessing.private boolean
Whether this container should be held open across commit.protected final ContainerKey
Container identifier
MT - Immutableprivate final UUID
Raw Store identifier
MT - Immutableprotected RawTransaction
our transaction.Fields inherited from interface org.apache.derby.iapi.store.raw.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 TypeMethodDescriptionvoid
close()
Close me.boolean
fetchNext
(DataValueDescriptor[] row) fetch a row from the container.void
Request the system properties associated with a container.getId()
get the container key for the stream containerfinal RawTransaction
Return the RawTransaction this object was opened in.void
remove the stream containertoString()
void
update
(DerbyObservable obj, Object arg) Called when the transaction is about to complete.boolean
Attach 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:
getContainerProperties
in interfaceStreamContainerHandle
- Parameters:
prop
- Property list to fill in.- Throws:
StandardException
- Standard exception policy.- See Also:
-
fetchNext
fetch a row from the container.- Specified by:
fetchNext
in 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:StreamContainerHandle
Close 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:
close
in interfaceStreamContainerHandle
- Throws:
StandardException
- Standard exception policy.- See Also:
-
removeContainer
remove the stream container- Specified by:
removeContainer
in interfaceStreamContainerHandle
- Throws:
StandardException
- Standard Derby error policy- See Also:
-
getId
get the container key for the stream container- Specified by:
getId
in interfaceStreamContainerHandle
-
update
Called when the transaction is about to complete.- Specified by:
update
in 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
-