Пример #1
0
 public void tierEntries(long tierEntries) {
   if (tier == 0) {
     segmentHeader.entries(segmentHeaderAddress, tierEntries);
   } else {
     TierCountersArea.entries(tierCountersAreaAddr(), tierEntries);
   }
 }
Пример #2
0
 public long lowestPossiblyFreeChunk() {
   if (tier == 0) {
     return segmentHeader.lowestPossiblyFreeChunk(segmentHeaderAddress);
   } else {
     return TierCountersArea.lowestPossiblyFreeChunkTiered(tierCountersAreaAddr());
   }
 }
Пример #3
0
 public void nextTierIndex(long nextTierIndex) {
   if (tier == 0) {
     segmentHeader.nextTierIndex(segmentHeaderAddress, nextTierIndex);
   } else {
     TierCountersArea.nextTierIndex(tierCountersAreaAddr(), nextTierIndex);
   }
 }
Пример #4
0
 public long tierEntries() {
   if (tier == 0) {
     return segmentHeader.entries(segmentHeaderAddress);
   } else {
     return TierCountersArea.entries(tierCountersAreaAddr());
   }
 }
Пример #5
0
 public long nextTierIndex() {
   if (tier == 0) {
     return segmentHeader.nextTierIndex(segmentHeaderAddress);
   } else {
     return TierCountersArea.nextTierIndex(tierCountersAreaAddr());
   }
 }
Пример #6
0
 public void tierDeleted(long tierDeleted) {
   if (tier == 0) {
     segmentHeader.deleted(segmentHeaderAddress, tierDeleted);
   } else {
     TierCountersArea.deleted(tierCountersAreaAddr(), tierDeleted);
   }
 }
Пример #7
0
 public long tierDeleted() {
   if (tier == 0) {
     return segmentHeader.deleted(segmentHeaderAddress);
   } else {
     return TierCountersArea.deleted(tierCountersAreaAddr());
   }
 }
Пример #8
0
 public void lowestPossiblyFreeChunk(long lowestPossiblyFreeChunk) {
   if (tier == 0) {
     segmentHeader.lowestPossiblyFreeChunk(segmentHeaderAddress, lowestPossiblyFreeChunk);
   } else {
     TierCountersArea.lowestPossiblyFreeChunkTiered(
         tierCountersAreaAddr(), lowestPossiblyFreeChunk);
   }
 }
Пример #9
0
  @Stage("Locks")
  private void closeRootLocks() {
    verifyInnermostContext();

    switch (localLockState) {
      case UNLOCKED:
        return;
      case READ_LOCKED:
        segmentHeader.readUnlock(segmentHeaderAddress);
        return;
      case UPDATE_LOCKED:
        segmentHeader.updateUnlock(segmentHeaderAddress);
        return;
      case WRITE_LOCKED:
        segmentHeader.writeUnlock(segmentHeaderAddress);
    }
  }
Пример #10
0
 @Stage("Locks")
 public void readUnlockAndDecrementCount() {
   switch (localLockState) {
     case UNLOCKED:
       return;
     case READ_LOCKED:
       if (decrementRead() == 0) {
         if (updateZero() && writeZero()) segmentHeader.readUnlock(segmentHeaderAddress);
       }
       return;
     case UPDATE_LOCKED:
       if (decrementUpdate() == 0) {
         if (writeZero()) {
           if (readZero()) {
             segmentHeader.updateUnlock(segmentHeaderAddress);
           } else {
             segmentHeader.downgradeUpdateToReadLock(segmentHeaderAddress);
           }
         }
       }
       return;
     case WRITE_LOCKED:
       if (decrementWrite() == 0) {
         if (!updateZero()) {
           segmentHeader.downgradeWriteToUpdateLock(segmentHeaderAddress);
         } else {
           if (!readZero()) {
             segmentHeader.downgradeWriteToReadLock(segmentHeaderAddress);
           } else {
             segmentHeader.writeUnlock(segmentHeaderAddress);
           }
         }
       }
   }
 }