01: /*
02: This source file is part of Smyle, a database library.
03: For up-to-date information, see http://www.drjava.de/smyle
04: Copyright (C) 2001 Stefan Reich (doc@drjava.de)
05:
06: This library is free software; you can redistribute it and/or
07: modify it under the terms of the GNU Lesser General Public
08: License as published by the Free Software Foundation; either
09: version 2.1 of the License, or (at your option) any later version.
10:
11: This library is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: Lesser General Public License for more details.
15:
16: You should have received a copy of the GNU Lesser General Public
17: License along with this library; if not, write to the Free Software
18: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19:
20: For full license text, see doc/license/lgpl.txt in this distribution
21: */
22:
23: package drjava.smyle;
24:
25: import java.io.*;
26: import org.artsProject.mcop.*;
27:
28: /** A Smyle store */
29: public interface Store {
30: /** creates an immutable snapshot */
31: public Snapshot snapshot();
32:
33: /** creates a mutable snapshot.
34: Throws a TimeoutException if the write lock isn't being released
35: after the time specified in setTimeout() */
36: public Snapshot mutableSnapshot() throws TimeoutException;
37:
38: /** closes the store */
39: public void close();
40:
41: /** sets the time that mutableSnapshot() will wait for the write lock to be released.
42: Default value is 0 (no timeout, wait infinitely) */
43: public void setTimeout(int ms);
44:
45: /** WARNING: Any open snapshots become invalid when you do this */
46: //public void deleteEverything();
47: /** Specify where to print log messages (warnings, further explanations
48: on exceptions).
49: Default is System.err. A null value is allowed (turns off logging)
50: */
51: public void logTo(PrintWriter writer);
52:
53: /** returns true if write locking is exclusive - that is, if there can only be one
54: mutable snapshot at any time */
55: public boolean exclusiveWriteLocking();
56:
57: /** determines how often a garbage collection should take place
58: @param bytes the number of bytes that must be written before
59: a GC is performed */
60: public void setGCFrequency(int bytes);
61:
62: /** informs Smyle about the OS's assumed cluster size
63: - GC frequency is calculated
64: more exactly if cluster size is set correctly */
65: public void setClusterSize(int bytes);
66:
67: /** optimize store on disk (relocate data to minimize seeks) */
68: public void optimize();
69: }
|