|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.odi.Placement
com.odi.Segment
PSE/PSE Pro uses the Segment class to represent a segment in a database. Every segment has a number that is unique in the database. PSE/PSE Pro assigns this number and uses it as a segment ID, which identifies the segment.
When you are using PSE or PSE Pro, a database can have only one segment.
Field Summary |
Fields inherited from interface com.odi.ObjectStoreConstants |
ALL_EXECUTE, ALL_READ, ALL_WRITE, DEFAULT, DISABLE_AUTO_OPEN, GROUP_EXECUTE, GROUP_READ, GROUP_WRITE, INSTALL_SCHEMA_BATCH, INSTALL_SCHEMA_INCREMENTAL, MULTI_DB_MVCC, MVCC, OBJECTSTORE, OTHER_EXECUTE, OTHER_READ, OTHER_WRITE, OWNER_EXECUTE, OWNER_READ, OWNER_WRITE, PSE, PSE_PRO, READONLY, READONLY_NON_BLOCKING, RETAIN_HOLLOW, RETAIN_READONLY, RETAIN_STALE, RETAIN_TRANSIENT, RETAIN_UPDATE, UPDATE, UPDATE_NON_BLOCKING, WAIT_FOREVER, XA_TRANSACTION |
Method Summary | |
abstract void |
acquireLock(int lockType,
int timeoutMillis)
Attempts to acquire a lock on a segment |
abstract boolean |
clusterExists(int clusterId)
Checks whether a cluster exists. |
abstract Cluster |
createCluster()
Creates a new cluster in the segment if you are using ObjectStore, and not PSE or PSE Pro. |
abstract void |
destroy()
Destroys a segment (not available in PSE or PSE Pro) |
abstract Properties |
GC()
Collects garbage in the segment. |
abstract Properties |
GC(Properties GCProperties)
Garbage collects the segment. |
abstract Cluster |
getCluster(int clusterId)
Returns a handle to an existing cluster. |
abstract Iterator |
getClusters()
Returns an iterator over the clusters in the segment. |
abstract Database |
getDatabase()
Obtains the Database object associated with the database that contains the segment. |
abstract Cluster |
getDefaultCluster()
Returns the default cluster for this segment. |
abstract Iterator |
getObjects()
Returns an iterator over the objects in the segment. |
abstract Iterator |
getObjects(Class ofType)
Returns an iterator over the objects that can be converted to the specified type in the segment. |
abstract int |
getSegmentId()
Obtains the segment ID of a segment. |
abstract long |
getSizeInBytes()
Obtains the number of bytes of storage occupied by the segment. |
abstract boolean |
isDestroyed()
Determines whether or not the segment has been destroyed. |
abstract boolean |
isInternal()
Determines if this is an internal segment. |
static Segment |
of(Object object)
Obtains the segment that contains the object. |
abstract void |
setDefaultCluster(Cluster cluster)
Sets the default cluster for this segment. |
Methods inherited from class com.odi.Placement |
getCluster, getSegment, getSession |
Method Detail |
public abstract void destroy()
SegmentException
- If the application is using PSE or PSE Pro.
public abstract boolean isDestroyed()
DatabaseNotOpenException
- If the database is not open.
NoTransactionInProgressException
- If there is no
transaction in progress.
ObjectStoreException
- If the session implied by the segment
has been terminated or if the current thread is associated with a
session other than the session implied by the segment.public abstract int getSegmentId()
public abstract Database getDatabase()
getDatabase
in class Placement
DatabaseNotOpenException
- If the database is not open.
ObjectStoreException
- If the session implied by the segment
has been terminated or if the current thread is associated with a
session other than the session implied by the segment.public abstract long getSizeInBytes()
DatabaseNotOpenException
- If the database is not open.
NoTransactionInProgressException
- If there is no
transaction in progress.
ObjectStoreException
- If the session implied by the segment
has been terminated or if the current thread is associated with a
session other than the session implied by the segment.
SegmentNotFoundException
- If the segment is not found.public abstract boolean isInternal()
DatabaseNotOpenException
- If the database is not open.
ObjectStoreException
- If the session implied by the segment
has been terminated or if the current thread is associated with a
session other than the session implied by the segment.
SegmentNotFoundException
- If the segment is not found.public abstract Cluster createCluster()
DatabaseNotOpenException
- If the database is not open.
NoTransactionInProgressException
- If a transaction is not in
progress.
ObjectStoreException
- If the session implied by the
segment has been terminated or if the current thread is associated
with a session other than the session implied by the segment.
SegmentException
- If you are using PSE or PSE Pro.
PSE and PSE Pro allow only one cluster for application data
per segment (and one segment per database) and they create the
allowed segment and cluster when they create a database.
UpdateReadOnlyException
- If there is a read-only
transaction in progress or if the database is open for read-only.public abstract Cluster getDefaultCluster()
DatabaseNotOpenException
- If the database is not open.
NoTransactionInProgressException
- If a transaction
is not in progress.
ObjectStoreException
- If the session implied by the
database has been terminated or if the current thread is associated
with a session other than the session implied by the database.
SegmentNotFoundException
- If the specified segment is not found.
ClusterNotFoundException
- If the default cluster is not found.public abstract void setDefaultCluster(Cluster cluster)
cluster
- The cluster to make the default cluster.
DatabaseNotOpenException
- If this database, or the database
associated with the cluster argument, is not open.
SegmentNotFoundException
- If the specified segment is not found.
ClusterNotFoundException
- If the specified cluster is not found.
IllegalArgumentException
- If the cluster parameter is
null or
is associated with a different segment or database.
NoTransactionInProgressException
- If a transaction
is not in progress.
ObjectStoreException
- If the session implied by the
database has been terminated or if the current thread is associated
with a session other than the session implied by the database.public abstract Cluster getCluster(int clusterId)
clusterId
- The cluster identifier.
DatabaseNotOpenException
- If the database is not open.
NoTransactionInProgressException
- If a transaction
is not in progress.
ObjectStoreException
- If the session implied by the
database has been terminated or if the current thread is associated
with a session other than the session implied by the database.
ClusterNotFoundException
- If the cluster is not found.
SegmentNotFoundException
- If the segment is not found.public abstract Iterator getClusters()
DatabaseNotOpenException
- If the database is not open.
SegmentNotFoundException
- If the segment is destroyed.
NoTransactionInProgressException
- If a transaction is not in
progress.
ObjectStoreException
- If the session implied by the
segment has been terminated or if the current thread is associated
with a session other than the session implied by the segment.public abstract boolean clusterExists(int clusterId)
clusterId
- The cluster identifier.
DatabaseNotOpenException
- If the database is not open.
NoTransactionInProgressException
- If a transaction
is not in progress.
ObjectStoreException
- If the session implied by the
database has been terminated or if the current thread is associated
with a session other than the session implied by the database.
SegmentNotFoundException
- If the segment is not found.public static Segment of(Object object)
object
- A persistent object in the segment you want
to obtain.
IllegalArgumentException
- If the object argument is null.
NoTransactionInProgressException
- If there is no
transaction in progress.
ObjectException
- If the object is stale.
ObjectNotPersistentException
- If the object is not
persistent.
ObjectStoreException
- If the session implied by the segment
has been terminated or if the current thread is associated with a
session other than the session implied by the segment.
SegmentNotFoundException
- If the segment is not found.public abstract Iterator getObjects()
DatabaseNotOpenException
- If the database is not open.
NoTransactionInProgressException
- If a transaction is not in
progress.
ObjectStoreException
- If the session implied by the segment
has been terminated or if the current thread is associated with a
session other than the session implied by the segment.
SegmentNotFoundException
- If the segment is not found.public abstract Iterator getObjects(Class ofType)
The class type argument can be any class type, interface type, or array type. Because primitive types are stored using wrapper types, the type argument should not be a primitive type. For array types, the objects in the iteration are all arrays of the element type (or types that can be converted to this type) regardless of the dimension of the array.
DatabaseNotOpenException
- If the database is not open.
NoTransactionInProgressException
- If a transaction is not in
progress.
ObjectStoreException
- If the session implied by the segment
has been terminated or if the current thread is associated with a
session other than the session implied by the segment.
SegmentNotFoundException
- If the segment is not found.
IllegalArgumentException
- If ofType is null.public abstract Properties GC()
AccessViolationException
- If PSE/PSE Pro is unable to open the database
that contains the segment because of a file system access violation.
DatabaseNotFoundException
- If the database that contains the
segment does not exist.
DatabaseOpenException
- If the database associated with
the segment is open.
ObjectStoreException
- If the session implied by the segment
has been terminated or if the current thread is associated with a
session other than the session implied by the segment.
TransactionException
- If a transaction is in progress.public abstract Properties GC(Properties GCProperties)
GCProperties
- Specifies the properties PSE/PSE Pro
should use during garbage collection. A null value instructs the GC
to use the default properties. The properties you can specify are
AccessViolationException
- If PSE/PSE Pro is unable to open the database
that contains the segment because of a file system access violation.
DatabaseNotFoundException
- If the database that contains the
segment does not exist.
DatabaseOpenException
- If the database associated with
the segment is open.
ObjectStoreException
- If the session implied by the segment
has been terminated or if the current thread is associated with a
session other than the session implied by the segment.
TransactionException
- If a transaction is in progress.public abstract void acquireLock(int lockType, int timeoutMillis)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |