From b7bd249cf68fa790b893335410a4d7a44ac371b8 Mon Sep 17 00:00:00 2001 From: Badrish Chandramouli Date: Sun, 25 Oct 2020 14:27:32 -0700 Subject: [PATCH] Update FasterKV.md --- docs/cs/FasterKV.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/cs/FasterKV.md b/docs/cs/FasterKV.md index b8bf8a2ca..fe5c6099f 100644 --- a/docs/cs/FasterKV.md +++ b/docs/cs/FasterKV.md @@ -170,9 +170,9 @@ I/O operations. There is no checkpointing in this example as well. ```cs public static void Test() { - var log = Devices.CreateLogDevice("C:\\Temp\\hlog.log"); - var store = new FasterKV(1L << 20, new Funcs(), new LogSettings { LogDevice = log }); - var s = fht.NewSession(new SimpleFunctions); + using var log = Devices.CreateLogDevice("C:\\Temp\\hlog.log"); + using var store = new FasterKV(1L << 20, new LogSettings { LogDevice = log }); + using var s = store.NewSession(new SimpleFunctions()); long key = 1, value = 1, input = 10, output = 0; s.Upsert(ref key, ref value); s.Read(ref key, ref output); @@ -181,13 +181,10 @@ public static void Test() s.RMW(ref key, ref input); s.Read(ref key, ref output); Debug.Assert(output == value + 20); - s.StopSession(); - store.Dispose(); - log.Close(); } ``` -We use default out-of-the-box provided `SimpleFunctions` in the above example. In these functions, +We use the default out-of-the-box provided `SimpleFunctions` in the above example. In these functions, `Input` and `Output` are simply set to `Value`, while `Context` is an empty struct `Empty`. ## More Examples