Top Description Fields Constructors Methods
org.apache.derby.iapi.store.raw

public final Class ContainerKey

extends Object
implements Matchable, Lockable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.locks.Lockable, org.apache.derby.iapi.util.Matchable
Imports
org.apache.derby.iapi.util.Matchable, org.apache.derby.iapi.services.io.CompressedNumber, java.io.ObjectOutput, .ObjectInput, .IOException, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.locks.Lockable, .Latch, .VirtualLockTable, java.util.Hashtable

A key that identifies a Container within the RawStore.
MT - Immutable

Field Summary

Modifier and TypeField and Description
private final long
private final long

Constructor Summary

AccessConstructor and Description
public
ContainerKey(long segmentId, long containerId)

Create a new ContainerKey

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public long
getContainerId()

Return my identifier within the segment

public long
getSegmentId()

Return my segment identifier

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
lockAttributes(int
use the bits in this int to decide if the user is interested in this kind of lockable object. The bits are defined in VirtualLockTable. For instance, the user may only ask for TABLE_AND_ROWLOCK and if this is not a table or row lock, then don't participate.
flag
,
Hashtable<String, Object>
if this decides to participate, put all relevant attributes into the Hashtable. The complete list of interesting attributes is listed in VirtualLockTable. The following attributes must be present for all participating lockables: VirtualLockTable.LOCKNAME, VirtualLockTable.LOCKTYPE, either VirtualLockTable.CONTAINERID or VirtualLockTable.CONGLOMID,

MT - this routine must be MP safe, caller will not be single threading the lock manager.

attributes
)

Implements org.apache.derby.iapi.services.locks.Lockable.lockAttributes.

This lockable wants to participate in the Virtual Lock table.

public boolean
lockerAlwaysCompatible()

Implements org.apache.derby.iapi.services.locks.Lockable.lockerAlwaysCompatible.

This method will only be called if requestCompatible returned false.

public void
lockEvent(Latch
Latch descriptor
lockInfo
)

Implements org.apache.derby.iapi.services.locks.Lockable.lockEvent.

Note the fact the object is locked.

public boolean
match(Object key)

Implements org.apache.derby.iapi.util.Matchable.match.

Return true if the passed in object matches this object.

public static ContainerKey
public boolean
requestCompatible(Object
The desired qualifier
requestedQualifier
,
Object
The already granted qualifier
grantedQualifier
)

Implements org.apache.derby.iapi.services.locks.Lockable.requestCompatible.

Return true if the requested qualifier is compatible with the already granted qualifier.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
unlockEvent(Latch
Latch descriptor
lockInfo
)

Implements org.apache.derby.iapi.services.locks.Lockable.unlockEvent.

Note that the object has been unlocked

Must only be called by the lock manager.

public void
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

containerIdback to summary
private final long containerId
segmentIdback to summary
private final long segmentId

Constructor Detail

ContainerKeyback to summary
public ContainerKey(long segmentId, long containerId)

Create a new ContainerKey

Method Detail

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

getContainerIdback to summary
public long getContainerId()

Return my identifier within the segment

getSegmentIdback to summary
public long getSegmentId()

Return my segment identifier

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

lockAttributesback to summary
public boolean lockAttributes(int flag, Hashtable<String, Object> attributes)

Implements org.apache.derby.iapi.services.locks.Lockable.lockAttributes.

This lockable wants to participate in the Virtual Lock table.

Parameters
flag:int

Doc from org.apache.derby.iapi.services.locks.Lockable.lockAttributes.

use the bits in this int to decide if the user is interested in this kind of lockable object. The bits are defined in VirtualLockTable. For instance, the user may only ask for TABLE_AND_ROWLOCK and if this is not a table or row lock, then don't participate.

attributes:Hashtable<String, Object>

Doc from org.apache.derby.iapi.services.locks.Lockable.lockAttributes.

if this decides to participate, put all relevant attributes into the Hashtable. The complete list of interesting attributes is listed in VirtualLockTable. The following attributes must be present for all participating lockables: VirtualLockTable.LOCKNAME, VirtualLockTable.LOCKTYPE, either VirtualLockTable.CONTAINERID or VirtualLockTable.CONGLOMID,

MT - this routine must be MP safe, caller will not be single threading the lock manager.

Returns:boolean

Doc from org.apache.derby.iapi.services.locks.Lockable.lockAttributes.

true if this object has diagnostic information to add to the virtual lock table. If this object either does not want to participate in the diagnostic virtual lock table or none of the attributes requested are attributes of this lock, returns false.

lockerAlwaysCompatibleback to summary
public boolean lockerAlwaysCompatible()

Implements org.apache.derby.iapi.services.locks.Lockable.lockerAlwaysCompatible.

This method will only be called if requestCompatible returned false. This results from two cases, some other compatabilty space has some lock that would conflict with the request, or this compatability space has a lock tha

Returns:boolean

Doc from org.apache.derby.iapi.services.locks.Lockable.lockerAlwaysCompatible.

if any lock request is allowed

lockEventback to summary
public void lockEvent(Latch lockInfo)

Implements org.apache.derby.iapi.services.locks.Lockable.lockEvent.

Doc from org.apache.derby.iapi.services.locks.Lockable.lockEvent.

Note the fact the object is locked. Performs required actions to ensure that unlockEvent() work correctly. This method does not actually perform any locking of the object, the locking mechanism is provided by the lock manager.

If the class supports multiple lockers of the object then this method will be called once per locker, each with their own qualifier.

Must only be called by the lock manager. Synchronization will be handled by the lock manager.

Parameters
lockInfo:Latch

Latch descriptor

matchback to summary
public boolean match(Object key)

Implements org.apache.derby.iapi.util.Matchable.match.

Doc from org.apache.derby.iapi.util.Matchable.match.

Return true if the passed in object matches this object.

readback to summary
public static ContainerKey read(ObjectInput in) throws IOException
requestCompatibleback to summary
public boolean requestCompatible(Object requestedQualifier, Object grantedQualifier)

Implements org.apache.derby.iapi.services.locks.Lockable.requestCompatible.

Doc from org.apache.derby.iapi.services.locks.Lockable.requestCompatible.

Return true if the requested qualifier is compatible with the already granted qualifier.

Parameters
requestedQualifier:Object

The desired qualifier

grantedQualifier:Object

The already granted qualifier

Returns:boolean

true if the request is compatible

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

unlockEventback to summary
public void unlockEvent(Latch lockInfo)

Implements org.apache.derby.iapi.services.locks.Lockable.unlockEvent.

Doc from org.apache.derby.iapi.services.locks.Lockable.unlockEvent.

Note that the object has been unlocked

Must only be called by the lock manager. Synchronization will be handled by the lock manager.

Parameters
lockInfo:Latch

Latch descriptor

writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException