Top Fields Constructors Methods
org.apache.derby.impl.store.access

public abstract Class RAMAccessManager

extends Object
implements AccessFactory, CacheableFactory, ModuleControl, PropertySetCallback
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.property.PropertySetCallback, org.apache.derby.iapi.services.monitor.ModuleControl, org.apache.derby.iapi.services.cache.CacheableFactory, org.apache.derby.iapi.store.access.AccessFactory
Known Direct Subclasses
org.apache.derby.impl.store.access.RllRAMAccessManager
Imports
org.apache.derby.iapi.security.Securable, .SecurityUtil, org.apache.derby.iapi.services.cache.Cacheable, .CacheableFactory, .CacheFactory, .CacheManager, org.apache.derby.iapi.services.context.ContextManager, .Context, .ContextService, org.apache.derby.iapi.services.daemon.Serviceable, org.apache.derby.iapi.services.locks.LockFactory, org.apache.derby.iapi.services.monitor.ModuleControl, .ModuleFactory, .Monitor, .PersistentService, org.apache.derby.iapi.services.property.PropertySetCallback, .PropertyUtil, .PropertyFactory, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.conglomerate.Conglomerate, .ConglomerateFactory, .MethodFactory, .TransactionManager, org.apache.derby.iapi.store.access.AccessFactory, .AccessFactoryGlobals, .TransactionController, .TransactionInfo, org.apache.derby.iapi.store.raw.ContainerHandle, .LockingPolicy, .RawStoreFactory, .Transaction, org.apache.derby.iapi.store.raw.log.LogFactory, org.apache.derby.iapi.store.raw.data.DataFactory, org.apache.derby.catalog.UUID, org.apache.derby.shared.common.reference.SQLState, .Attribute, java.util.Dictionary, .Enumeration, .Hashtable, .Properties, java.io.Serializable

Field Summary

Modifier and TypeField and Description
private CacheManager
conglom_cache

Cache of Conglomerate objects, keyed by conglom id. Used to speed up subsquent open of conglomerates, first open will need to call the conglomerate to read and return it's description.

protected ConglomerateFactory[]
conglom_map

A map of the implementation specific id to conglomerate object.

private long
conglom_nextid

Routines to map to/from conglomid/containerid:

private Hashtable<UUID, MethodFactory>
formathash

Hash table on primary format.

private Hashtable<String, MethodFactory>
implhash

Hash table on primary implementation type.

private PropertyFactory
private RawStoreFactory
rawstore

The raw store that this access manager uses.

protected LockingPolicy[]
private Properties
serviceProperties

Service properties.

pack-priv LockingPolicy
system_default_locking_policy

Default locking policy for the entire system.

protected LockingPolicy[]
private PropertyConglomerate
xactProperties

The object providing the properties like behaviour that is transactional.

Constructor Summary

AccessConstructor and Description
public
RAMAccessManager()

Constructors for This class:

Method Summary

Modifier and TypeMethod and Description
private void
public Serviceable
apply(String
Property key for the property being set
key
,
Serializable
proposed new value for the property being set or null if the property is being dropped.
value
,
Dictionary<K, V>
Property set before the change. SettingProperty may read but must never change p.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.apply.

Apply a property change.

public void
backup(String
the name of the directory where the backup should be stored.
backupDir
,
boolean
if true, waits for all the backup blocking operations in progress to finish.
wait
)

Implements org.apache.derby.iapi.store.access.AccessFactory.backup.

Backup the database to backupDir.

public void
backupAndEnableLogArchiveMode(String
the directory name where the database backup should go. This directory will be created if not it does not exist.
backupDir
,
boolean
If true deletes online archived log files that exist before this backup, delete will occur only after backup is complete.
deleteOnlineArchivedLogFiles
,
boolean
if true, waits for all the backup blocking operations in progress to finish.
wait
)

Implements org.apache.derby.iapi.store.access.AccessFactory.backupAndEnableLogArchiveMode.

Backup the database to a backup directory and enable the log archive mode that will keep the archived log files required for roll-forward from this version backup.

public void
boot(boolean
True if the database should be created
create
,
Properties
Configuration properties
startParams
)

Implements org.apache.derby.iapi.services.monitor.ModuleControl.boot.

Public Methods implementing ModuleControl Interface:

private void
protected abstract void
bootLookupSystemLockLevel(TransactionController tc)

Query property system to get the System lock level.

private static Object
bootServiceModule(final boolean create, final Object serviceModule, final String factoryInterface, final Properties properties)

Must be private so that user code can't call this entry point.

private static Object
bootServiceModule(final boolean create, final Object serviceModule, final String factoryInterface, final String identifier, final Properties properties)

Must be private so that user code can't call this entry point.

public void
checkpoint()

Implements org.apache.derby.iapi.store.access.AccessFactory.checkpoint.

Checkpoints the database, that is, flushes all dirty data to disk.

pack-priv void
conglomCacheAddEntry(long
The conglomid of conglomerate to replace.
conglomid
,
Conglomerate
The Conglom to add.
conglom
)

Add a newly created conglomerate to the cache.

pack-priv Conglomerate

Returns:

The conglomerate object identified by "conglomid".
conglomCacheFind
(long
The conglomerate id of the conglomerate to look up.
conglomid
)

Find a conglomerate by conglomid in the cache.

private void
conglomCacheInit()

Initialize the conglomerate cache.

protected void
conglomCacheInvalidate()

Invalide the current Conglomerate Cache.

pack-priv void
conglomCacheRemoveEntry(long
The conglomid of conglomerate to replace.
conglomid
)

Remove an entry from the cache.

public void
public void
createReadMeFiles()

Implements org.apache.derby.iapi.store.access.AccessFactory.createReadMeFiles.

DERBY-5996(Create readme files (cautioning users against modifying database files) at database hard upgrade time) This gets called during hard upgrade.

public void
disableLogArchiveMode(boolean
If true deletes all online archived log files that exist before this call immediately; Only restore that can be performed after disabling log archive mode is version recovery.
deleteOnlineArchivedLogFiles
)

Implements org.apache.derby.iapi.store.access.AccessFactory.disableLogArchiveMode.

disables the log archival process, i.e No old log files will be kept around for a roll-forward recovery.

public void
failover(String
the replication database that is being failed over.
dbname
)

Implements org.apache.derby.iapi.store.access.AccessFactory.failover.

Start the failover for this database.

public MethodFactory
findMethodFactoryByFormat(UUID format)

Implements org.apache.derby.iapi.store.access.AccessFactory.findMethodFactoryByFormat.

Find an access method that implements a format type.

public MethodFactory
findMethodFactoryByImpl(String impltype)

Implements org.apache.derby.iapi.store.access.AccessFactory.findMethodFactoryByImpl.

Find an access method that implements an implementation type.

private static Object
findServiceModule(final Object serviceModule, final String factoryInterface)

Must be private so that user code can't call this entry point.

public void
freeze()

Implements org.apache.derby.iapi.store.access.AccessFactory.freeze.

Freeze the database temporarily so a backup can be taken.

public TransactionController
getAndNameTransaction(ContextManager
The context manager for the current context.
cm
,
String
If a new transaction is started, it will be given this name. The name is displayed in the transactiontable VTI.
transName
)

Implements org.apache.derby.iapi.store.access.AccessFactory.getAndNameTransaction.

Get a transaction.

private static Context
getContext(final String contextID)

Must be private so that user code can't call this entry point.

private static ContextService
getContextService()

Must be private so that user code can't call this entry point.

pack-priv RAMTransactionContext

Returns:

a context object referencing the current transaction
getCurrentTransactionContext
()

Get the current transaction context.

protected LockingPolicy

Returns:

the default locking policy for this accessmanager.
getDefaultLockingPolicy
()

Return the default locking policy for this access manager.

pack-priv ConglomerateFactory

Returns:

The ConglomerateFactory which "owns" this conglomerate.
getFactoryFromConglomId
(long
The conglomerate id of the conglomerate to look up.
conglom_id
)

Given a conglomid, return the factory which "owns" it.

public LockFactory
getLockFactory()

Implements org.apache.derby.iapi.store.access.AccessFactory.getLockFactory.

Get the LockFactory to use with this store.

private static ModuleFactory
getMonitor()

Must be private so that user code can't call this entry point.

protected long

Returns:

The identifier to be used to open the conglomerate later.
getNextConglomId
(int
factory id as gotten from getConglomerateFactoryId()
factory_type
)

Return next conglomid to try to add the container with.

pack-priv RawStoreFactory
protected abstract int

Returns:

TransactionController.MODE_TABLE if only table locking allowed, else returns TransactionController.MODE_RECORD.
getSystemLockLevel
()

Return the locking level of the system.

public TransactionController
getTransaction(ContextManager
The context manager for the current context.
cm
)

Implements org.apache.derby.iapi.store.access.AccessFactory.getTransaction.

Get a transaction controller with which to manipulate data within the access manager.

pack-priv PropertyConglomerate
public TransactionInfo[]
getTransactionInfo()

Implements org.apache.derby.iapi.store.access.AccessFactory.getTransactionInfo.

Return a snap shot of all transactions in the db.

public Object

Returns:

The XAResourceManager associated with this accessfactory.
getXAResourceManager
()

Implements org.apache.derby.iapi.store.access.AccessFactory.getXAResourceManager.

Return the XAResourceManager associated with this AccessFactory.

public void
init(boolean
true if only per-database properties are to be looked at
dbOnly
,
Dictionary<K, V>
the complete set of per-database properties.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.init.

Initialize the properties for this callback.

public boolean
public Serializable
map(String
Property key for the property being set
key
,
Serializable
proposed new value for the property being set or null if the property is being dropped.
value
,
Dictionary<K, V>
Property set before the change. SettingProperty may read but must never change p.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.map.

Map a proposed new value for a property to an official value.

public Cacheable
public void
registerAccessMethod(MethodFactory factory)

Implements org.apache.derby.iapi.store.access.AccessFactory.registerAccessMethod.

Register an access method that this access manager can use.

public void
startReplicationMaster(String
The master database that is being replicated.
dbmaster
,
String
The hostname for the slave
host
,
int
The port the slave is listening on
port
,
String
The type of replication contract. Currently only asynchronous replication is supported, but 1-safe/2-safe/very-safe modes may be added later.
replicationMode
)

Implements org.apache.derby.iapi.store.access.AccessFactory.startReplicationMaster.

Start the replication master role for this database.

private static Object
startSystemModule(final String factoryInterface)

Must be private so that user code can't call this entry point.

public Object
startXATransaction(ContextManager
The context manager for the current context.
cm
,
int
the format id part of the Xid - ie. Xid.getFormatId().
format_id
,
byte[]
the global transaction identifier part of XID - ie. Xid.getGlobalTransactionId().
global_id
,
byte[]
The branch qualifier of the Xid - ie. Xid.getBranchQaulifier()
branch_id
)

Implements org.apache.derby.iapi.store.access.AccessFactory.startXATransaction.

Start a global transaction.

public void
public void
stopReplicationMaster()

Implements org.apache.derby.iapi.store.access.AccessFactory.stopReplicationMaster.

Stop the replication master role for this database.

public void
unfreeze()

Implements org.apache.derby.iapi.store.access.AccessFactory.unfreeze.

Unfreeze the database after a backup has been taken.

public boolean
validate(String
Property key for the property being set
key
,
Serializable
proposed new value for the property being set or null if the property is being dropped.
value
,
Dictionary<K, V>
Property set before the change. SettingProperty may read but must never change p.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.validate.

Validate a property change.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait