Exemplo n.º 1
0
 /// <summary>
 ///   10/17/2011
 ///   Initializes a new instance of the <see cref = "Operation" /> class.
 /// </summary>
 /// <param name = "mode">The operation mode.</param>
 /// <param name = "transId">The ID of the transaction on whose behalf the operation is created</param>
 /// <param name = "dataId">The index of the data item the operation operates on (or a sentinel value in case its a begin/commit/abort op)</param>
 /// <param name = "newValue">The new value to write in case the operation is a write op.</param>
 /// <param name = "ro">Whether the transaction issuing the operation is a read only transaction - used for MVCC</param>
 /// <param name = "ts">The timestamp of the operation.</param>
 public Operation(Enumerations.OperationMode mode, int transId, int dataId = -1, int newValue = -1,
     bool ro = false, int ts = 0)
 {
     opMode = mode;
     transactionNumber = transId;
     dataItem = dataId;
     this.newValue = newValue;
     readOnly = ro;
     timeStamp = ts;
 }
Exemplo n.º 2
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "Result" /> class.
 /// </summary>
 /// <param name = "transaction">The transaction that issued the operation.</param>
 /// <param name = "mode">The mode of the operation (begin, commit, read, write, etc).</param>
 /// <param name = "siteNumber">The site number that created the result.</param>
 /// <param name = "rstatus">The result status (success / failure).</param>
 /// <param name = "trans">The ids of all transactions which have blocked the operation from begin successful.</param>
 /// <param name = "val">The value read if it was a read operation.</param>
 /// <param name = "dataItem">The data item that was accessed if one was accessed.</param>
 /// <param name = "ts">The timestamp for which the result object should correspond to.</param>
 public Result(int transaction, Enumerations.OperationMode mode, int siteNumber,
     Enumerations.ResultStatus rstatus, List<int> trans, int val = 0, int dataItem = 0, int ts = 0)
 {
     issuingTransaction = transaction;
     opMode = mode;
     this.siteNumber = siteNumber;
     status = rstatus;
     timeStamp = ts;
     transId = new List<int>();
     if (trans != null)
         transId.AddRange(trans);
     this.val = val;
     this.dataItem = dataItem;
 }
Exemplo n.º 3
0
 /// <summary>
 ///   10/16/2011
 ///   Initializes a new instance of the <see cref = "Lock" /> class.
 /// </summary>
 /// <param name = "id">The id.</param>
 /// <param name = "lockMode">The lock mode.</param>
 public Lock(int id, Enumerations.OperationMode lockMode)
 {
     mode = lockMode;
     transactionId = id;
 }