public override bool SingleWriter(ref MyKey key, ref MyInput input, ref MyValue src, ref MyValue dst, ref MyOutput output, ref UpsertInfo upsertInfo, WriteReason reason) { dst = src; return(true); }
public override void PostSingleWriter(ref int key, ref int input, ref int src, ref int dst, ref int output, ref UpsertInfo upsertInfo, WriteReason reason) { Assert.AreEqual((WriteReason)input, reason); actualReason = reason; }
public override bool ConcurrentWriter(ref int key, ref int input, ref int src, ref int dst, ref int output, ref UpsertInfo upsertInfo) { lastFunc = CancelLocation.ConcurrentWriter; if (cancelLocation == CancelLocation.ConcurrentWriter) { upsertInfo.Action = UpsertAction.CancelOperation; return(false); } dst = src; return(true); }
public override bool ConcurrentWriter(ref int key, ref MyInput input, ref MyValue src, ref MyValue dst, ref MyOutput output, ref UpsertInfo updateInfo) { dst.value = src.value; return(true); }
// Upsert functions public override bool SingleWriter(ref VLValue key, ref Input input, ref VLValue src, ref VLValue dst, ref int[] output, ref UpsertInfo upsertInfo, WriteReason reason) { src.CopyTo(ref dst); return(true); }
// Upsert functions public override bool SingleWriter(ref KeyStruct key, ref InputStruct input, ref ValueStruct src, ref ValueStruct dst, ref OutputStruct output, ref UpsertInfo upsertInfo, WriteReason reason) { Assert.IsFalse(upsertInfo.RecordInfo.IsNull()); dst = src; return(true); }
// Record addresses public override bool SingleWriter(ref Key key, ref Value input, ref Value src, ref Value dst, ref Output output, ref UpsertInfo upsertInfo, WriteReason reason) { dst = src; output.address = upsertInfo.Address; this.lastWriteAddress = upsertInfo.Address; return(true); }
public override void PostSingleWriter(ref CacheKey key, ref CacheValue input, ref CacheValue src, ref CacheValue dst, ref CacheValue output, ref UpsertInfo upsertInfo, WriteReason reason) { dst = src; sizeTracker.AddTrackedSize(key.GetSize + src.GetSize); }
public bool ConcurrentWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref UpsertInfo upsertInfo) { dst = src; return(true); }
// Return false to force a chain of values. public override bool ConcurrentWriter(ref Key key, ref Value input, ref Value src, ref Value dst, ref Output output, ref UpsertInfo upsertInfo) => false;
public bool SingleWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref UpsertInfo upsertInfo, WriteReason reason) { dst = src; return(true); }
public void DisposeSingleWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref UpsertInfo upsertInfo, WriteReason reason) => functions.DisposeSingleWriter(ref key, ref input, ref src, ref dst, ref output, ref upsertInfo, reason);
public bool ConcurrentWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref UpsertInfo upsertInfo) => functions.ConcurrentWriter(ref key, ref input, ref src, ref dst, ref output, ref upsertInfo);
/// <inheritdoc/> public override void PostSingleWriter(ref int key, ref int input, ref int src, ref int dst, ref int output, ref UpsertInfo upsertInfo, WriteReason reasons) { Assert.AreEqual(lastWriteAddress, upsertInfo.Address); Assert.AreEqual(key * input, dst); Assert.AreEqual(dst, output); }
public override bool ConcurrentWriter(ref int key, ref int input, ref int src, ref int dst, ref int output, ref UpsertInfo upsertInfo) => Increment(ref dst);
public override bool ConcurrentWriter(ref CacheKey key, ref CacheValue input, ref CacheValue src, ref CacheValue dst, ref CacheValue output, ref UpsertInfo upsertInfo) { var old = Interlocked.Exchange(ref dst, src); sizeTracker.AddTrackedSize(dst.GetSize - old.GetSize); return(true); }
public override void PostSingleWriter(ref int key, ref int input, ref int src, ref int dst, ref int output, ref UpsertInfo upsertInfo, WriteReason reason) { this.pswAddress = upsertInfo.Address; }
// Upsert functions public override bool SingleWriter(ref KeyStruct key, ref InputStruct input, ref ValueStruct src, ref ValueStruct dst, ref OutputStruct output, ref UpsertInfo upsertInfo, WriteReason reason) { dst = src; return(true); }
/// <summary> /// For compaction, we never perform concurrent writes as rolled over data defers to /// newly inserted data for the same key. /// </summary> public bool ConcurrentWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref UpsertInfo upsertInfo) => true;
public override bool ConcurrentWriter(ref VLValue key, ref Input input, ref VLValue src, ref VLValue dst, ref int[] output, ref UpsertInfo upsertInfo) { if (src.length != dst.length) { return(false); } src.CopyTo(ref dst); return(true); }
/// <summary> /// Write compacted live value to store /// </summary> public bool SingleWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref UpsertInfo upsertInfo, WriteReason reason) => _functions.SingleWriter(ref key, ref input, ref src, ref dst, ref output, ref upsertInfo, reason);
public override bool ConcurrentWriter(ref KeyStruct key, ref InputStruct input, ref ValueStruct src, ref ValueStruct dst, ref OutputStruct output, ref UpsertInfo upsertInfo) { Assert.IsFalse(upsertInfo.RecordInfo.IsNull()); Interlocked.Increment(ref _concurrentWriterCallCount); return(false); }
public void DisposeSingleWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref UpsertInfo upsertInfo, WriteReason reason) { }
// Upsert functions public override bool SingleWriter(ref int key, ref int input, ref int src, ref int dst, ref int output, ref UpsertInfo upsertInfo, WriteReason reason) { lastFunc = CancelLocation.SingleWriter; if (cancelLocation == CancelLocation.SingleWriter) { upsertInfo.Action = UpsertAction.CancelOperation; return(false); } dst = src; return(true); }
/// <inheritdoc/> public override bool ConcurrentWriter(ref int key, ref int input, ref int src, ref int dst, ref int output, ref UpsertInfo upsertInfo) => SingleWriter(ref key, ref input, ref src, ref dst, ref output, ref upsertInfo, WriteReason.Upsert);
public override bool ConcurrentWriter(ref MyKey key, ref MyInput input, ref MyLargeValue src, ref MyLargeValue dst, ref MyLargeOutput output, ref UpsertInfo updateInfo) { dst = src; return(true); }
/// <inheritdoc/> public override bool SingleWriter(ref int key, ref int input, ref int src, ref int dst, ref int output, ref UpsertInfo upsertInfo, WriteReason reason) { lastWriteAddress = upsertInfo.Address; dst = output = src * input; return(true); }
public override bool ConcurrentWriter(ref MyKey key, ref MyInput input, ref MyValue src, ref MyValue dst, ref MyOutput output, ref UpsertInfo upsertInfo) { if (src == null) { return(false); } if (dst.value.Length != src.value.Length) { return(false); } dst = src; return(true); }
public override bool SingleWriter(ref int key, ref int input, ref int src, ref int dst, ref int output, ref UpsertInfo upsertInfo, WriteReason reason) { Assert.AreEqual((WriteReason)input, reason); actualReason = reason; return(true); }