Debian Codegraph @

src/main/org/h2/util/CacheWriter.java

raw
1 /*
2 * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0,
3 * and the EPL 1.0 (https://h2database.com/html/license.html).
4 * Initial Developer: H2 Group
5 */
6 package org.h2.util;
7
8 import org.h2.message.Trace;
9
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);
22
23 /**
24 * Flush the transaction log, so that entries can be removed from the cache.
25 * This is only required if the cache is full and contains data that is not
26 * yet written to the log. It is required to write the log entries to the
27 * log first, because the log is 'write ahead'.
28 */
29 void flushLog();
30
31 /**
32 * Get the trace writer.
33 *
34 * @return the trace writer
35 */
36 Trace getTrace();
37
38 }