void readCheckpointDelta ( TableKelp table , PageServiceImpl pageActor , ReadStream is , int length ) throws IOException { Row row = table . row ( ) ; // int keyLength = row.getKeyLength(); int removeLength = row . removeLength ( ) ; int rowLength = row . length ( ) ; BlockLeaf block = _blocks [ 0 ] ; long endPosition = is . position ( ) + length ; int rowHead = block . rowHead ( ) ; int blobTail = block . getBlobTail ( ) ; long pos ; while ( ( pos = is . position ( ) ) < endPosition ) { int code = is . read ( ) ; is . unread ( ) ; code = code & CODE_MASK ; if ( code == REMOVE ) { rowHead -= removeLength ; if ( rowHead < blobTail ) { block = extendBlocks ( ) ; rowHead = BLOCK_SIZE - removeLength ; blobTail = 0 ; } is . readAll ( block . getBuffer ( ) , rowHead , removeLength ) ; } else if ( code == INSERT ) { rowHead -= rowLength ; while ( ( blobTail = row . readCheckpoint ( is , block . getBuffer ( ) , rowHead , blobTail ) ) < 0 ) { //is.setPosition(pos + 1); is . position ( pos ) ; block = extendBlocks ( ) ; rowHead = BLOCK_SIZE - rowLength ; blobTail = 0 ; } // byte []buffer = block.getBuffer(); // buffer[rowHead] = (byte) ((buffer[rowHead] & ~CODE_MASK) | INSERT); } else { throw new IllegalStateException ( L . l ( "{0} Corrupted checkpoint at pos={1} with code {2}" , this , pos , code ) ) ; } block . rowHead ( rowHead ) ; block . setBlobTail ( blobTail ) ; } clearDirty ( ) ; validate ( table ) ; }
Reads a delta entry from the checkpoint .