Пример #1
0
 public boolean canWrite(TransactionOperation op) {
   TimeStamp TS = op.transactionTimeStamp;
   if (TS.compareTo(RTM) == TimeStamp.BEFORE || TS.compareTo(WTM) == TimeStamp.BEFORE) {
     return false;
   } else {
     WTM = TS;
     return true;
   }
 }
Пример #2
0
  /**
   * Note that you should call read() pretty soon after this, else you could end up with a READ when
   * you shouldn't be able to.
   */
  public boolean canRead(TransactionOperation op) {
    TimeStamp TS = op.transactionTimeStamp;

    if (TS.compareTo(WTM) == TimeStamp.BEFORE) {
      return false;
    } else {
      setMaxRTM(TS);
      return true;
    }
  }
Пример #3
0
 /** Set RTM to be max (RTM, TS). */
 public void setMaxRTM(TimeStamp TS) {
   if (RTM == null) {
     RTM = TS;
   } else if (TS.compareTo(RTM) == TimeStamp.AFTER) {
     RTM = TS;
   }
 }