Skip to content

Commit

Permalink
Merge pull request #38 from upserve/add_flush_to_object_store
Browse files Browse the repository at this point in the history
expose AppendOnlyStore.flush() in AppendOnlyObjectStore
  • Loading branch information
bfulton authored Nov 9, 2017
2 parents 8f771d0 + 941072f commit 9239ed3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/com/upserve/uppend/AppendOnlyObjectStore.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.upserve.uppend;

import java.io.*;
import java.util.function.*;
import java.util.stream.Stream;

Expand All @@ -8,7 +9,7 @@
* convenience typed-access to the deserialized form in an append-only
* multi-map.
*/
public class AppendOnlyObjectStore<T> implements AutoCloseable {
public class AppendOnlyObjectStore<T> implements AutoCloseable, Flushable {
private final AppendOnlyStore store;
private final Function<T, byte[]> serializer;
private final Function<byte[], T> deserializer;
Expand Down Expand Up @@ -82,4 +83,9 @@ public void clear() {
public void close() throws Exception {
store.close();
}
}

@Override
public void flush() throws IOException {
store.flush();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9239ed3

Please sign in to comment.