Exemplo n.º 1
0
 /// <inheritdoc/>
 public virtual void DisposeSingleWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref UpsertInfo upsertInfo, WriteReason reason)
 {
 }
Exemplo n.º 2
0
 /// <inheritdoc/>
 public virtual bool ConcurrentWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref UpsertInfo upsertInfo)
 {
     dst = src; return(true);
 }
Exemplo n.º 3
0
 /// <inheritdoc/>
 public virtual 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);
 }
Exemplo n.º 4
0
 public bool ConcurrentWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref RecordInfo recordInfo, ref UpsertInfo upsertInfo, out bool lockFailed)
 {
     // Note: KeyIndexes do not need notification of in-place updates because the key does not change.
     lockFailed = false;
     recordInfo.SetDirty();
     return(_clientSession.functions.ConcurrentWriter(ref key, ref input, ref src, ref dst, ref output, ref upsertInfo));
 }
Exemplo n.º 5
0
 public void DisposeSingleWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref RecordInfo recordInfo, ref UpsertInfo upsertInfo, WriteReason reason)
 => _clientSession.functions.DisposeSingleWriter(ref key, ref input, ref src, ref dst, ref output, ref upsertInfo, reason);
Exemplo n.º 6
0
 private bool ConcurrentWriterLock(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref RecordInfo recordInfo, ref UpsertInfo upsertInfo, out bool lockFailed)
 {
     if (!recordInfo.LockExclusive())
     {
         lockFailed = true;
         return(false);
     }
     try
     {
         lockFailed = false;
         return(!recordInfo.Tombstone && ConcurrentWriterNoLock(ref key, ref input, ref src, ref dst, ref output, ref recordInfo, ref upsertInfo));
     }
     finally
     {
         recordInfo.UnlockExclusive();
     }
 }
Exemplo n.º 7
0
 private bool ConcurrentWriterNoLock(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref RecordInfo recordInfo, ref UpsertInfo upsertInfo)
 {
     recordInfo.SetDirty();
     // Note: KeyIndexes do not need notification of in-place updates because the key does not change.
     return(_clientSession.functions.ConcurrentWriter(ref key, ref input, ref src, ref dst, ref output, ref upsertInfo));
 }
Exemplo n.º 8
0
 public bool ConcurrentWriter(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref RecordInfo recordInfo, ref UpsertInfo upsertInfo, out bool lockFailed)
 {
     lockFailed = false;
     return(this.DisableLocking
                        ? ConcurrentWriterNoLock(ref key, ref input, ref src, ref dst, ref output, ref recordInfo, ref upsertInfo)
                        : ConcurrentWriterLock(ref key, ref input, ref src, ref dst, ref output, ref recordInfo, ref upsertInfo, out lockFailed));
 }
Exemplo n.º 9
0
        /// <inheritdoc />
        public override bool ConcurrentWriter(ref Key key, ref SpanByte input, ref SpanByte src, ref SpanByte dst, ref Output output, ref UpsertInfo upsertInfo)
        {
            if (dst.Length < src.Length)
            {
                return(false);
            }

            // We can adjust the length header on the serialized log, if we wish.
            // This method will also zero out the extra space to retain log scan correctness.
            dst.UnmarkExtraMetadata();
            dst.ShrinkSerializedLength(src.Length);

            // Write the source data, leaving the destination size unchanged. You will need
            // to mange the actual space used by the value if you stop here.
            src.CopyTo(ref dst);

            return(true);
        }
Exemplo n.º 10
0
 /// <inheritdoc />
 public override bool SingleWriter(ref Key key, ref SpanByte input, ref SpanByte src, ref SpanByte dst, ref Output output, ref UpsertInfo upsertInfo, WriteReason reason)
 {
     src.CopyTo(ref dst);
     return(true);
 }