01: /*
02: * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
03: * (http://h2database.com/html/license.html).
04: * Initial Developer: H2 Group
05: */
06: package org.h2.util;
07:
08: import java.sql.SQLException;
09:
10: /**
11: * The cache writer is called by the cache to persist changed data that needs to
12: * be removed from the cache.
13: */
14: public interface CacheWriter {
15:
16: /**
17: * Persist a record.
18: *
19: * @param entry the cache entry
20: */
21: void writeBack(CacheObject entry) throws SQLException;
22:
23: /**
24: * Flush the log file, so that entries can be removed from the cache. This
25: * is only required if the cache is full and contains data that is not yet
26: * written to the log file. It is required to write the log entries to the
27: * log file first, because the log file is 'write ahead'.
28: */
29: void flushLog() throws SQLException;
30: }
|