初始化

This commit is contained in:
2025-11-21 08:48:01 +08:00
commit b4d684a84c
202 changed files with 28585 additions and 0 deletions

28
Faster/Program.cs Normal file
View File

@@ -0,0 +1,28 @@
using FASTER.core;
namespace Faster
{
internal class Program
{
static void Main(string[] args)
{
using var settings = new FasterKVSettings<long, long>("c:/temp"); // backing storage device
using var store = new FasterKV<long, long>(settings);
// Create a session per sequence of interactions with FASTER
// We use default callback functions with a custom merger: RMW merges input by adding it to value
using var session = store.NewSession(new SimpleFunctions<long, long>((a, b) => a + b));
long key = 1, value = 1, input = 10, output = 0;
// Upsert and Read
session.Upsert(ref key, ref value);
session.Read(ref key, ref output);
// Read-Modify-Write (add input to value)
session.RMW(ref key, ref input);
session.RMW(ref key, ref input, ref output);
Console.WriteLine("Hello, World!");
}
}
}