Skip to content

Commit

Permalink
Update FasterKV.md
Browse files Browse the repository at this point in the history
  • Loading branch information
badrishc authored Oct 25, 2020
1 parent ba762ef commit b7bd249
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions docs/cs/FasterKV.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<long, long>(1L << 20, new Funcs(), new LogSettings { LogDevice = log });
var s = fht.NewSession(new SimpleFunctions<long, long>);
using var log = Devices.CreateLogDevice("C:\\Temp\\hlog.log");
using var store = new FasterKV<long, long>(1L << 20, new LogSettings { LogDevice = log });
using var s = store.NewSession(new SimpleFunctions<long, long>());
long key = 1, value = 1, input = 10, output = 0;
s.Upsert(ref key, ref value);
s.Read(ref key, ref output);
Expand All @@ -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<Key,Value>` in the above example. In these functions,
We use the default out-of-the-box provided `SimpleFunctions<Key,Value>` in the above example. In these functions,
`Input` and `Output` are simply set to `Value`, while `Context` is an empty struct `Empty`.

## More Examples
Expand Down

0 comments on commit b7bd249

Please sign in to comment.