Mercurial > hg > blitz_condensed
comparison src/org/dancres/blitz/remote/BlitzAdmin.java @ 0:3dc0c5604566
Initial checkin of blitz 2.0 fcs - no installer yet.
author | Dan Creswell <dan.creswell@gmail.com> |
---|---|
date | Sat, 21 Mar 2009 11:00:06 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3dc0c5604566 |
---|---|
1 package org.dancres.blitz.remote; | |
2 | |
3 import java.io.IOException; | |
4 | |
5 import java.rmi.Remote; | |
6 import java.rmi.RemoteException; | |
7 | |
8 import net.jini.core.transaction.TransactionException; | |
9 | |
10 /** | |
11 Blitz specific admin operations are available on this interface | |
12 */ | |
13 public interface BlitzAdmin extends Remote { | |
14 /** | |
15 <p>Run a hot backup - whilst <code>requestSnapshot</code> requires one | |
16 to suspend access to the Blitz instance and simply checkpoints to the | |
17 database directory, this method can be used to produce a separate | |
18 snapshot (in another directory) whilst activity continues. The output | |
19 is suitable for restoration under circumstances of failure.</p> | |
20 | |
21 <p>Note, an Entry's lease may expire before the backup is restored | |
22 in which case it is deemed to have been remove from the space thus | |
23 archives created with this method will only restore state that is | |
24 not yet expired.</p> | |
25 | |
26 <p>Note also that transactions active during the backup will | |
27 <em>not</em> be reflected in the backup. This is a necessity as | |
28 otherwise it would be impossible to finish the backup under some | |
29 circumstances.</p> | |
30 | |
31 <p>This method may supercede <code>requestSnapshot</code> some time | |
32 in the future.</p> | |
33 | |
34 <p><b>WARNING: Experimental at this stage</b></p> | |
35 | |
36 @param aBackupDir is the directory in which to deposit the backup. | |
37 Ensure that the directory is empty before invoking this method. | |
38 Note that the directory will be created if it doesn't already exist. | |
39 */ | |
40 public void backup(String aBackupDir) throws RemoteException, IOException; | |
41 | |
42 /** | |
43 <p>Blocks the caller, issues a checkpoint and returns on completion. | |
44 Note, the caller should ensure that there's no current activity within | |
45 the Blitz instance such as active transactions. If Blitz is active, | |
46 the checkpoint will not contain *any* of the actions of these | |
47 transactions. Prepared (but not commited or aborted) transactions are | |
48 also problematic as they will be saved in the checkpoint but cannot, | |
49 for example, be restored to another Blitz instance and commited there | |
50 (unless you've used Activatable references in a suitable failover | |
51 configuration).</p> | |
52 | |
53 @throws IOException if the checkpoint failed. | |
54 @throws TransactionException if there are active/prepared transactions | |
55 which cannot be guarenteed to be recovered from the saved snapshot at | |
56 restore time. | |
57 */ | |
58 public void requestSnapshot() throws RemoteException, | |
59 TransactionException, IOException; | |
60 | |
61 /** | |
62 Causes Blitz to shutdown cleanly whilst retaining state. This can | |
63 also be achieved by calling DestroyAdmin::destroy() so long as the | |
64 configuration variable <code>compatDestroy</code> is set to <code> | |
65 false</code>. | |
66 */ | |
67 public void shutdown() throws RemoteException, IOException; | |
68 | |
69 /** | |
70 Clean up all Entry's, abort outstanding matches etc so the JavaSpace | |
71 is good as new. | |
72 */ | |
73 public void clean() throws RemoteException, IOException; | |
74 | |
75 /** | |
76 Request a manual reap of lease expired Entry's. Note, | |
77 <code>LeaseReaper.MANUAL_REAP</code> must be set for the relevant | |
78 lease reap time variable in the configuration file. | |
79 */ | |
80 public void reap() throws RemoteException; | |
81 } |