/** * Called (in order) for every row present in the CF. * Hashes the row, and adds it to the tree being built. * * @param row Row to add hash */ public void add(AbstractCompactedRow row) { assert desc.range.contains(row.key.getToken()) : row.key.getToken() + " is not contained in " + desc.range; assert lastKey == null || lastKey.compareTo(row.key) < 0 : "row " + row.key + " received out of order wrt " + lastKey; lastKey = row.key; if (range == null) range = ranges.next(); // generate new ranges as long as case 1 is true while (!range.contains(row.key.getToken())) { // add the empty hash, and move to the next range range.ensureHashInitialised(); range = ranges.next(); } // case 3 must be true: mix in the hashed row RowHash rowHash = rowHash(row); if (rowHash != null) { range.addHash(rowHash); } }
/** * Called (in order) for every row present in the CF. * Hashes the row, and adds it to the tree being built. * * @param partition Partition to add hash */ public void add(UnfilteredRowIterator partition) { assert Range.isInRanges(partition.partitionKey().getToken(), desc.ranges) : partition.partitionKey().getToken() + " is not contained in " + desc.ranges; assert lastKey == null || lastKey.compareTo(partition.partitionKey()) < 0 : "partition " + partition.partitionKey() + " received out of order wrt " + lastKey; lastKey = partition.partitionKey(); if (range == null) range = ranges.next(); // generate new ranges as long as case 1 is true if (!findCorrectRange(lastKey.getToken())) { // add the empty hash, and move to the next range ranges = trees.invalids(); findCorrectRange(lastKey.getToken()); } assert range.contains(lastKey.getToken()) : "Token not in MerkleTree: " + lastKey.getToken(); // case 3 must be true: mix in the hashed row RowHash rowHash = rowHash(partition); if (rowHash != null) { range.addHash(rowHash); } }
/** * Called (in order) for every row present in the CF. * Hashes the row, and adds it to the tree being built. * * @param partition Partition to add hash */ public void add(UnfilteredRowIterator partition) { assert Range.isInRanges(partition.partitionKey().getToken(), desc.ranges) : partition.partitionKey().getToken() + " is not contained in " + desc.ranges; assert lastKey == null || lastKey.compareTo(partition.partitionKey()) < 0 : "partition " + partition.partitionKey() + " received out of order wrt " + lastKey; lastKey = partition.partitionKey(); if (range == null) range = ranges.next(); // generate new ranges as long as case 1 is true if (!findCorrectRange(lastKey.getToken())) { // add the empty hash, and move to the next range ranges = trees.invalids(); findCorrectRange(lastKey.getToken()); } assert range.contains(lastKey.getToken()) : "Token not in MerkleTree: " + lastKey.getToken(); // case 3 must be true: mix in the hashed row RowHash rowHash = rowHash(partition); if (rowHash != null) { range.addHash(rowHash); } }
/** * Called (in order) for every row present in the CF. * Hashes the row, and adds it to the tree being built. * * @param partition Partition to add hash */ public void add(UnfilteredRowIterator partition) { assert Range.isInRanges(partition.partitionKey().getToken(), desc.ranges) : partition.partitionKey().getToken() + " is not contained in " + desc.ranges; assert lastKey == null || lastKey.compareTo(partition.partitionKey()) < 0 : "partition " + partition.partitionKey() + " received out of order wrt " + lastKey; lastKey = partition.partitionKey(); if (range == null) range = ranges.next(); // generate new ranges as long as case 1 is true if (!findCorrectRange(lastKey.getToken())) { // add the empty hash, and move to the next range ranges = trees.invalids(); findCorrectRange(lastKey.getToken()); } assert range.contains(lastKey.getToken()) : "Token not in MerkleTree: " + lastKey.getToken(); // case 3 must be true: mix in the hashed row RowHash rowHash = rowHash(partition); if (rowHash != null) { range.addHash(rowHash); } }