|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.sync.impl.SyncCleanerBarrier.SyncTrigger
public static class SyncCleanerBarrier.SyncTrigger
Constructor Summary | |
---|---|
SyncCleanerBarrier.SyncTrigger(String triggerName)
|
Method Summary | |
---|---|
void |
abort(Transaction txn)
The trigger method invoked after the transaction has been aborted. |
void |
addTrigger(Transaction txn)
The trigger method invoked when this trigger is added to the database. |
void |
close()
The trigger method associated with the close of the last writable Database handle. |
void |
commit(Transaction txn)
The trigger method invoked after a transaction has been committed. |
void |
delete(Transaction txn,
DatabaseEntry key,
DatabaseEntry oldData)
The trigger method invoked after a successful delete, that is, one that actually resulted in a key/value pair being removed. |
String |
getDatabaseName()
Returns the result of the Trigger.setDatabaseName(String) operation. |
String |
getName()
Returns the name associated with the trigger. |
void |
open(Transaction txn,
Environment environment,
boolean isNew)
The trigger method invoked after the open of the first Database
writable handle. |
void |
put(Transaction txn,
DatabaseEntry key,
DatabaseEntry oldData,
DatabaseEntry newData)
The trigger method invoked after a successful put, that is, one that actually results in a modification to the database. |
void |
remove(Transaction txn)
The trigger method invoked after the successful removal of a primary Database . |
void |
removeTrigger(Transaction txn)
The trigger method invoked when this trigger is removed from the database, either as a result of opening the database with a different trigger configuration, or because the database it was associated with it has been removed. |
void |
rename(Transaction txn,
String newName)
The trigger method invoked after the successful renaming of a primary Database . |
void |
repeatAddTrigger(Transaction txn)
The trigger method invoked when an addTrigger operation needs to be repeated. |
void |
repeatCreate(Transaction txn)
The trigger method invoked when a database create trigger needs to be repeated. |
void |
repeatDelete(Transaction txn,
DatabaseEntry key)
The trigger method invoked when a database delete trigger needs to be repeated. |
void |
repeatPut(Transaction txn,
DatabaseEntry key,
DatabaseEntry newData)
The trigger method invoked when a database put trigger needs to be repeated. |
void |
repeatRemove(Transaction txn)
The trigger method invoked when a database remove trigger needs to be repeated. |
void |
repeatRemoveTrigger(Transaction txn)
The trigger method invoked when a removeTrigger operation needs to be repeated. |
void |
repeatRename(Transaction txn,
String newName)
The trigger method invoked when a database rename trigger needs to be repeated. |
void |
repeatTransaction(Transaction txn)
Used to inform the application that the trigger method calls associated with the partial transaction will be repeated. |
void |
repeatTruncate(Transaction txn)
The trigger method invoked when a database truncate trigger needs to be repeated. |
Trigger |
setDatabaseName(String dbName)
Sets the database name associated with this trigger. |
void |
truncate(Transaction txn)
The trigger method invoked after the successful truncation of a Database . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SyncCleanerBarrier.SyncTrigger(String triggerName)
Method Detail |
---|
public String getName()
Trigger
getName
in interface Trigger
public Trigger setDatabaseName(String dbName)
Trigger
This method is also invoked each time the trigger is de-serialized, so that the trigger does not need to store this information as part of it's serialized representation.
setDatabaseName
in interface Trigger
dbName
- the name of the database associated with this
trigger
public String getDatabaseName()
Trigger
Trigger.setDatabaseName(String)
operation.
getDatabaseName
in interface Trigger
public void addTrigger(Transaction txn)
Trigger
addTrigger
in interface Trigger
txn
- the active transaction associated with the operation. The
argument is null if the database is not transactional.public void removeTrigger(Transaction txn)
Trigger
Persistent#remove
remove trigger. If the
transaction is committed, there will be no subsequent trigger method
invocations for this trigger.
removeTrigger
in interface Trigger
txn
- the active transaction associated with the operation. The
argument is null if the database is not transactional.public void open(Transaction txn, Environment environment, boolean isNew)
PersistentTrigger
Database
writable handle.
A call to the open trigger always precedes any subsequent calls to the
Trigger.put(com.sleepycat.je.Transaction, com.sleepycat.je.DatabaseEntry, com.sleepycat.je.DatabaseEntry, com.sleepycat.je.DatabaseEntry)
and Trigger.delete(com.sleepycat.je.Transaction, com.sleepycat.je.DatabaseEntry, com.sleepycat.je.DatabaseEntry)
triggers defined below, since the
put
and delete
operations can only be invoked
on a database handle.
If the database is replicated, the replay mechanism on a
Replica
may open and close databases as it replays the
replication stream. The maximum number of databases that may be open at
any given time and the duration for which they can be left open can be
controlled by configuring
ReplicationConfig.REPLAY_MAX_OPEN_DB_HANDLES
and
ReplicationConfig.REPLAY_DB_HANDLE_TIMEOUT
respectively.
The method may be invoked when the database is first created, or
subsequently when a new trigger is added to an existing database. As a
result, a call to this trigger is always preceded by a call to the
addTrigger
trigger method.
open
in interface PersistentTrigger
txn
- the active transaction associated with the operation. The
argument is null if the operation is not transactional.environment
- a handle to the environment associated with the
database being opened. The trigger code must not close the environment
handle.isNew
- is true if the database was newly created as a result of
the call to Environment.openDatabase(com.sleepycat.je.Transaction, java.lang.String, com.sleepycat.je.DatabaseConfig)
Environment.openDatabase(com.sleepycat.je.Transaction, java.lang.String, com.sleepycat.je.DatabaseConfig)
public void close()
PersistentTrigger
Database
handle.
If the database is replicated, the replay mechanism on a
Replica
may open and close databases as it replays the
replication stream. The maximum number of databases that may be open at
any given time and the duration for which they can be left open can be
controlled by configuring
ReplicationConfig.REPLAY_MAX_OPEN_DB_HANDLES
and
ReplicationConfig.REPLAY_DB_HANDLE_TIMEOUT
respectively.
close
in interface PersistentTrigger
Database#close
public void remove(Transaction txn)
PersistentTrigger
Database
.
remove
in interface PersistentTrigger
txn
- the transaction associated with the operation. The argument
is null if the environment is non-transactional.Environment.removeDatabase(com.sleepycat.je.Transaction, java.lang.String)
public void truncate(Transaction txn)
PersistentTrigger
Database
.
truncate
in interface PersistentTrigger
txn
- the transaction associated with the operation. The argument
is null if the environment is non-transactional.Environment.truncateDatabase(com.sleepycat.je.Transaction, java.lang.String, boolean)
public void rename(Transaction txn, String newName)
PersistentTrigger
Database
.
rename
in interface PersistentTrigger
txn
- the transaction associated with the operation. The argument
is null if the environment is non-transactional.newName
- it's current (new) nameEnvironment.renameDatabase(com.sleepycat.je.Transaction, java.lang.String, java.lang.String)
public void put(Transaction txn, DatabaseEntry key, DatabaseEntry oldData, DatabaseEntry newData)
Trigger
If a new entry was inserted, oldData will be null and newData will be non-null. If an existing entry was updated, oldData and newData will be non-null.
put
in interface Trigger
txn
- the active transaction associated with the operation. The
argument is null if the database is non-transactional.key
- the non-null primary keyoldData
- the data before the change, or null if the record
did not exist.newData
- the non-null data after the changepublic void delete(Transaction txn, DatabaseEntry key, DatabaseEntry oldData)
Trigger
Truncating a database does not invoke this trigger;
PersistentTrigger.truncate(com.sleepycat.je.Transaction)
is invoked upon truncation.
delete
in interface Trigger
txn
- the active transaction associated with the operation. The
argument is null if the database is non-transactional.key
- the non-null primary keyoldData
- the non-null data that was associated with the deleted
keypublic void commit(Transaction txn)
TransactionTrigger
commit
in interface TransactionTrigger
txn
- the transaction that was committedpublic void abort(Transaction txn)
TransactionTrigger
abort
in interface TransactionTrigger
txn
- the transaction that was abortedpublic void repeatTransaction(Transaction txn)
ReplicatedDatabaseTrigger
repeatTransaction
in interface ReplicatedDatabaseTrigger
txn
- the partial transactionpublic void repeatAddTrigger(Transaction txn)
ReplicatedDatabaseTrigger
repeatAddTrigger
in interface ReplicatedDatabaseTrigger
Trigger.addTrigger(com.sleepycat.je.Transaction)
public void repeatRemoveTrigger(Transaction txn)
ReplicatedDatabaseTrigger
repeatRemoveTrigger
in interface ReplicatedDatabaseTrigger
Trigger.removeTrigger(com.sleepycat.je.Transaction)
public void repeatCreate(Transaction txn)
ReplicatedDatabaseTrigger
repeatCreate
in interface ReplicatedDatabaseTrigger
PersistentTrigger.open(com.sleepycat.je.Transaction, com.sleepycat.je.Environment, boolean)
public void repeatRemove(Transaction txn)
ReplicatedDatabaseTrigger
repeatRemove
in interface ReplicatedDatabaseTrigger
PersistentTrigger.remove(com.sleepycat.je.Transaction)
public void repeatTruncate(Transaction txn)
ReplicatedDatabaseTrigger
repeatTruncate
in interface ReplicatedDatabaseTrigger
PersistentTrigger.truncate(com.sleepycat.je.Transaction)
public void repeatRename(Transaction txn, String newName)
ReplicatedDatabaseTrigger
repeatRename
in interface ReplicatedDatabaseTrigger
PersistentTrigger.rename(com.sleepycat.je.Transaction, java.lang.String)
public void repeatPut(Transaction txn, DatabaseEntry key, DatabaseEntry newData)
ReplicatedDatabaseTrigger
Trigger.put
method in that it omits the
oldData
argument.
repeatPut
in interface ReplicatedDatabaseTrigger
Trigger.put(com.sleepycat.je.Transaction, com.sleepycat.je.DatabaseEntry, com.sleepycat.je.DatabaseEntry, com.sleepycat.je.DatabaseEntry)
public void repeatDelete(Transaction txn, DatabaseEntry key)
ReplicatedDatabaseTrigger
Trigger.delete
method in that it omits the
oldData
argument.
repeatDelete
in interface ReplicatedDatabaseTrigger
Trigger#remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |