Exemplo n.º 1
0
 public void tierEntries(long tierEntries) {
   if (tier == 0) {
     segmentHeader.entries(segmentHeaderAddress, tierEntries);
   } else {
     TierCountersArea.entries(tierCountersAreaAddr(), tierEntries);
   }
 }
Exemplo n.º 2
0
 public long lowestPossiblyFreeChunk() {
   if (tier == 0) {
     return segmentHeader.lowestPossiblyFreeChunk(segmentHeaderAddress);
   } else {
     return TierCountersArea.lowestPossiblyFreeChunkTiered(tierCountersAreaAddr());
   }
 }
Exemplo n.º 3
0
 public void nextTierIndex(long nextTierIndex) {
   if (tier == 0) {
     segmentHeader.nextTierIndex(segmentHeaderAddress, nextTierIndex);
   } else {
     TierCountersArea.nextTierIndex(tierCountersAreaAddr(), nextTierIndex);
   }
 }
Exemplo n.º 4
0
 public long tierEntries() {
   if (tier == 0) {
     return segmentHeader.entries(segmentHeaderAddress);
   } else {
     return TierCountersArea.entries(tierCountersAreaAddr());
   }
 }
Exemplo n.º 5
0
 public long nextTierIndex() {
   if (tier == 0) {
     return segmentHeader.nextTierIndex(segmentHeaderAddress);
   } else {
     return TierCountersArea.nextTierIndex(tierCountersAreaAddr());
   }
 }
Exemplo n.º 6
0
 public void tierDeleted(long tierDeleted) {
   if (tier == 0) {
     segmentHeader.deleted(segmentHeaderAddress, tierDeleted);
   } else {
     TierCountersArea.deleted(tierCountersAreaAddr(), tierDeleted);
   }
 }
Exemplo n.º 7
0
 public long tierDeleted() {
   if (tier == 0) {
     return segmentHeader.deleted(segmentHeaderAddress);
   } else {
     return TierCountersArea.deleted(tierCountersAreaAddr());
   }
 }
Exemplo n.º 8
0
 public void lowestPossiblyFreeChunk(long lowestPossiblyFreeChunk) {
   if (tier == 0) {
     segmentHeader.lowestPossiblyFreeChunk(segmentHeaderAddress, lowestPossiblyFreeChunk);
   } else {
     TierCountersArea.lowestPossiblyFreeChunkTiered(
         tierCountersAreaAddr(), lowestPossiblyFreeChunk);
   }
 }
Exemplo n.º 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);
    }
  }
Exemplo n.º 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);
           }
         }
       }
   }
 }