OperationBase.cs (b0aec48e) OperationBase.cs (7eff8cd8)
1
2using System;
3using System.Collections.Generic;
4using System.IO;
5using System.Net;
6using System.Text;
7using System.Threading.Tasks;
8using Couchbase.Configuration.Server.Serialization;
9using Couchbase.Core;
10using Couchbase.Core.Buckets;
11using Couchbase.Core.Diagnostics;
12using Couchbase.Core.Transcoders;
13using Couchbase.IO.Converters;
14using Couchbase.IO.Operations.EnhancedDurability;
15using Couchbase.IO.Utils;
1
2using System;
3using System.Collections.Generic;
4using System.IO;
5using System.Net;
6using System.Text;
7using System.Threading.Tasks;
8using Couchbase.Configuration.Server.Serialization;
9using Couchbase.Core;
10using Couchbase.Core.Buckets;
11using Couchbase.Core.Diagnostics;
12using Couchbase.Core.Transcoders;
13using Couchbase.IO.Converters;
14using Couchbase.IO.Operations.EnhancedDurability;
15using Couchbase.IO.Utils;
16using Couchbase.Utils;
16
17namespace Couchbase.IO.Operations
18{
19 internal abstract class OperationBase : IOperation
20 {
21 private bool _timedOut;
22 protected IByteConverter Converter;
23 protected Flags Flags;
24 private Dictionary<TimingLevel, IOperationTimer> _timers;
25 private const int DefaultOffset = 24;
26 public const int HeaderLength = 24;
27 public const int DefaultRetries = 2;
28 protected static MutationToken DefaultMutationToken = new MutationToken(null, -1, -1, -1);
29
30 protected OperationBase(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint opaque, uint timeout)
31 {
17
18namespace Couchbase.IO.Operations
19{
20 internal abstract class OperationBase : IOperation
21 {
22 private bool _timedOut;
23 protected IByteConverter Converter;
24 protected Flags Flags;
25 private Dictionary<TimingLevel, IOperationTimer> _timers;
26 private const int DefaultOffset = 24;
27 public const int HeaderLength = 24;
28 public const int DefaultRetries = 2;
29 protected static MutationToken DefaultMutationToken = new MutationToken(null, -1, -1, -1);
30
31 protected OperationBase(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint opaque, uint timeout)
32 {
33 if (RequiresKey && string.IsNullOrWhiteSpace(key))
34 {
35 throw new MissingKeyException();
36 }
37
32 Key = key;
33 Transcoder = transcoder;
34 Opaque = opaque;
35 CreationTime = DateTime.UtcNow;
36 Timeout = timeout;
37 VBucket = vBucket;
38 Converter = transcoder.Converter;
39 MaxRetries = DefaultRetries;

--- 459 unchanged lines hidden (view full) ---

499 }
500 return _bodyLength;
501 }
502 }
503
504 public virtual byte[] BodyBytes { get; protected set; }
505
506 public virtual short PathLength { get; protected set; }
38 Key = key;
39 Transcoder = transcoder;
40 Opaque = opaque;
41 CreationTime = DateTime.UtcNow;
42 Timeout = timeout;
43 VBucket = vBucket;
44 Converter = transcoder.Converter;
45 MaxRetries = DefaultRetries;

--- 459 unchanged lines hidden (view full) ---

505 }
506 return _bodyLength;
507 }
508 }
509
510 public virtual byte[] BodyBytes { get; protected set; }
511
512 public virtual short PathLength { get; protected set; }
513
514 public virtual bool RequiresKey
515 {
516 get { return true; }
517 }
507 }
508
509#endregion
510}
518 }
519
520#endregion
521}