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 boolean
active
Is this StreamContainerHandle active.protected StreamFileContainer
container
The actual container we are accessing.private boolean
hold
Whether this container should be held open across commit.protected ContainerKey
identity
Container identifier
MT - Immutableprivate UUID
rawStoreId
Raw Store identifier
MT - Immutableprotected RawTransaction
xact
our 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 void
close()
Close me.boolean
fetchNext(DataValueDescriptor[] row)
fetch a row from the container.void
getContainerProperties(java.util.Properties prop)
Request the system properties associated with a container.ContainerKey
getId()
get the container key for the stream containerRawTransaction
getTransaction()
Return the RawTransaction this object was opened in.void
removeContainer()
remove the stream containerjava.lang.String
toString()
void
update(DerbyObservable obj, java.lang.Object arg)
Called when the transaction is about to complete.boolean
useContainer()
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 StandardException
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:
StreamContainerHandle.getContainerProperties(java.util.Properties)
-
fetchNext
public boolean fetchNext(DataValueDescriptor[] row) throws StandardException
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:
StreamContainerHandle.close()
-
removeContainer
public void removeContainer() throws StandardException
remove the stream container- Specified by:
removeContainer
in 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:
getId
in interfaceStreamContainerHandle
-
update
public void update(DerbyObservable obj, java.lang.Object arg)
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:
DerbyObserver.update(org.apache.derby.iapi.services.monitor.DerbyObservable, java.lang.Object)
-
useContainer
public boolean useContainer() throws StandardException
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
public final RawTransaction getTransaction()
Return the RawTransaction this object was opened in.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-