Author: jbellis Date: Wed Jul 27 01:20:04 2011 New Revision: 1151302 URL: http://svn.apache.org/viewvc?rev=1151302&view=rev Log: update comments
Modified: cassandra/trunk/src/java/org/apache/cassandra/service/RowDigestResolver.java cassandra/trunk/src/java/org/apache/cassandra/service/RowRepairResolver.java cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java Modified: cassandra/trunk/src/java/org/apache/cassandra/service/RowDigestResolver.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/RowDigestResolver.java?rev=1151302&r1=1151301&r2=1151302&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/service/RowDigestResolver.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/service/RowDigestResolver.java Wed Jul 27 01:20:04 2011 @@ -49,12 +49,12 @@ public class RowDigestResolver extends A /* * This method handles two different scenarios: * - * 1a)we're handling the initial read, of data from the closest replica + digests + * a) we're handling the initial read, of data from the closest replica + digests * from the rest. In this case we check the digests against each other, * throw an exception if there is a mismatch, otherwise return the data row. * - * 1b)we're checking additional digests that arrived after the minimum to handle - * the requested ConsistencyLevel, i.e. asynchronouse read repair check + * b) we're checking additional digests that arrived after the minimum to handle + * the requested ConsistencyLevel, i.e. asynchronous read repair check */ public Row resolve() throws DigestMismatchException, IOException { @@ -64,7 +64,7 @@ public class RowDigestResolver extends A long startTime = System.currentTimeMillis(); ColumnFamily data = null; - // case 1: validate digests against each other; throw immediately on mismatch. + // validate digests against each other; throw immediately on mismatch. // also, collects data results into versions/endpoints lists. // // results are cleared as we process them, to avoid unnecessary duplication of work @@ -93,12 +93,11 @@ public class RowDigestResolver extends A } } - // If there was a digest query compare it with all the data digests - // If there is a mismatch then throw an exception so that read repair can happen. + // Compare digest (only one, since we threw earlier if there were different replies) + // with the data response. If there is a mismatch then throw an exception so that read repair can happen. // - // It's important to note that we do not compare the digests of multiple data responses -- - // if we are in that situation we know there was a previous mismatch and now we're doing a repair, - // so our job is now case 2: figure out what the most recent version is and update everyone to that version. + // It's important to note that we do not consider the possibility of multiple data responses -- + // that can only happen when we're doing the repair post-mismatch, and will be handled by RowRepairResolver. if (digest != null) { ByteBuffer digest2 = ColumnFamily.digest(data); Modified: cassandra/trunk/src/java/org/apache/cassandra/service/RowRepairResolver.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/RowRepairResolver.java?rev=1151302&r1=1151301&r2=1151302&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/service/RowRepairResolver.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/service/RowRepairResolver.java Wed Jul 27 01:20:04 2011 @@ -45,7 +45,7 @@ public class RowRepairResolver extends A /* * This method handles the following scenario: * - * there was a mismatch on the initial read (1a or 1b), so we redid the digest requests + * there was a mismatch on the initial read, so we redid the digest requests * as full data reads. In this case we need to compute the most recent version * of each column, and send diffs to out-of-date replicas. */ Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java?rev=1151302&r1=1151301&r2=1151302&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java Wed Jul 27 01:20:04 2011 @@ -528,14 +528,12 @@ public class StorageProxy implements Sto InetAddress dataPoint = handler.endpoints.get(0); if (dataPoint.equals(FBUtilities.getBroadcastAddress())) { - if (logger.isDebugEnabled()) - logger.debug("reading data locally"); + logger.debug("reading data locally"); StageManager.getStage(Stage.READ).execute(new LocalReadRunnable(command, handler)); } else { - if (logger.isDebugEnabled()) - logger.debug("reading data from " + dataPoint); + logger.debug("reading data from {}", dataPoint); MessagingService.instance().sendRR(command, dataPoint, handler); } @@ -546,14 +544,12 @@ public class StorageProxy implements Sto { if (digestPoint.equals(FBUtilities.getBroadcastAddress())) { - if (logger.isDebugEnabled()) - logger.debug("reading digest locally"); + logger.debug("reading digest locally"); StageManager.getStage(Stage.READ).execute(new LocalReadRunnable(digestCommand, handler)); } else { - if (logger.isDebugEnabled()) - logger.debug("reading digest for from " + digestPoint); + logger.debug("reading digest from {}", digestPoint); MessagingService.instance().sendRR(producer, digestPoint, handler); } }