コード例 #1
0
 @Override
 public void afterOperation(
     LSMOperationType opType, List<ILSMComponent> oldComponents, ILSMComponent newComponent)
     throws HyracksDataException {
   if (newComponent != null) {
     LSMRTreeDiskComponent rtreeComponent = (LSMRTreeDiskComponent) newComponent;
     putLSNIntoMetadata(rtreeComponent.getRTree(), oldComponents);
     putLSNIntoMetadata(rtreeComponent.getBTree(), oldComponents);
   }
 }
コード例 #2
0
 @Override
 public long getComponentLSN(List<ILSMComponent> diskComponents) throws HyracksDataException {
   if (diskComponents == null) {
     // Implies a flush IO operation.
     synchronized (this) {
       long lsn = mutableLastLSNs[readIndex];
       return lsn;
     }
   }
   // Get max LSN from the diskComponents. Implies a merge IO operation or Recovery operation.
   long maxLSN = -1;
   for (Object o : diskComponents) {
     LSMRTreeDiskComponent rtreeComponent = (LSMRTreeDiskComponent) o;
     maxLSN = Math.max(getTreeIndexLSN(rtreeComponent.getRTree()), maxLSN);
   }
   return maxLSN;
 }