You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2013/03/11 18:42:30 UTC
svn commit: r1455252 -
/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/InMemoryMap.java
Author: kturner
Date: Mon Mar 11 17:42:30 2013
New Revision: 1455252
URL: http://svn.apache.org/r1455252
Log:
ACCUMULO-1170 fixed race condition
Modified:
accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/InMemoryMap.java
Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/InMemoryMap.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/InMemoryMap.java?rev=1455252&r1=1455251&r2=1455252&view=diff
==============================================================================
--- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/InMemoryMap.java (original)
+++ accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/InMemoryMap.java Mon Mar 11 17:42:30 2013
@@ -268,8 +268,6 @@ public class InMemoryMap {
*
*/
public void mutate(List<Mutation> mutations) {
- int mc = nextMutationCount.getAndAdd(mutations.size());
- int numKVs = 0;
// Can not update mutationCount while writes that started before
// are in progress, this would cause partial mutations to be seen.
// Also, can not continue until mutation count is updated, because
@@ -277,7 +275,8 @@ public class InMemoryMap {
// wait for writes that started before to finish.
//
// using separate lock from this map, to allow read/write in parallel
- synchronized (writeSerializer ) {
+ synchronized (writeSerializer) {
+ int mc = nextMutationCount.getAndAdd(mutations.size());
try {
map.mutate(mutations, mc);
} finally {