diff --git a/src/main/java/com/upserve/uppend/AppendOnlyObjectStore.java b/src/main/java/com/upserve/uppend/AppendOnlyObjectStore.java index eaa92ded..6a83d200 100644 --- a/src/main/java/com/upserve/uppend/AppendOnlyObjectStore.java +++ b/src/main/java/com/upserve/uppend/AppendOnlyObjectStore.java @@ -1,5 +1,6 @@ package com.upserve.uppend; +import java.io.*; import java.util.function.*; import java.util.stream.Stream; @@ -8,7 +9,7 @@ * convenience typed-access to the deserialized form in an append-only * multi-map. */ -public class AppendOnlyObjectStore implements AutoCloseable { +public class AppendOnlyObjectStore implements AutoCloseable, Flushable { private final AppendOnlyStore store; private final Function serializer; private final Function deserializer; @@ -82,4 +83,9 @@ public void clear() { public void close() throws Exception { store.close(); } -} \ No newline at end of file + + @Override + public void flush() throws IOException { + store.flush(); + } +} diff --git a/src/test/java/com/upserve/uppend/AppendOnlyObjectStoreTest.java b/src/test/java/com/upserve/uppend/AppendOnlyObjectStoreTest.java index 2bd4c34d..b8137db2 100644 --- a/src/test/java/com/upserve/uppend/AppendOnlyObjectStoreTest.java +++ b/src/test/java/com/upserve/uppend/AppendOnlyObjectStoreTest.java @@ -78,6 +78,12 @@ public void testClear() { verify(store).clear(); } + @Test + public void testFlush() throws Exception { + instance.flush(); + verify(store).flush(); + } + @Test public void testClose() throws Exception { instance.close();