HBASE-1322 hbase-1234 broke TestAtomicIncrement; fix and reenable

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@770397 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-04-30 19:00:52 +00:00
parent f241c6cc28
commit 55d09dcc84
4 changed files with 12 additions and 7 deletions

View File

@ -96,6 +96,8 @@ Release 0.20.0 - Unreleased
each access
HBASE-1358 Bug in reading from Memcache method (read only from snapshot)
(Evgeny Ryabitskiy via Stack)
HBASE-1322 hbase-1234 broke TestAtomicIncrement; fix and reenable
(Evgeny Ryabitskiy and Ryan Rawson via Stack)
IMPROVEMENTS
HBASE-1089 Add count of regions on filesystem to master UI; add percentage

View File

@ -465,8 +465,6 @@ public class HTableDescriptor implements WritableComparable<HTableDescriptor>, I
* @return true if the table contains the specified family name
*/
public boolean hasFamily(final byte [] c) {
// If index is -1, then presume we were passed a column family name minus
// the colon delimiter.
return families.containsKey(c);
}

View File

@ -191,6 +191,11 @@ class Memcache {
this.lock.readLock().lock();
try {
boolean notpresent = this.memcache.add(kv);
// if false then memcache is not changed (look memcache.add(kv) docs)
// need to remove kv and add again to replace it
if (!notpresent && this.memcache.remove(kv)) {
this.memcache.add(kv);
}
size = heapSize(kv, notpresent);
} finally {
this.lock.readLock().unlock();

View File

@ -32,8 +32,8 @@ import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.io.BatchUpdate;
import org.apache.hadoop.hbase.util.Bytes;
public class DisabledTestAtomicIncrement extends HBaseClusterTestCase {
static final Log LOG = LogFactory.getLog(DisabledTestAtomicIncrement.class);
public class TestAtomicIncrement extends HBaseClusterTestCase {
static final Log LOG = LogFactory.getLog(TestAtomicIncrement.class);
private static final byte [] CONTENTS = Bytes.toBytes("contents:");
@ -80,14 +80,14 @@ public class DisabledTestAtomicIncrement extends HBaseClusterTestCase {
// set a weird value, then increment:
row = Bytes.toBytes("foo2");
byte [] value = {0,0,1};
byte [] value = {0,0,2};
BatchUpdate bu = new BatchUpdate(row);
bu.put(column, value);
table.commit(bu);
assertEquals(2L, table.incrementColumnValue(row, column, 1));
assertEquals(3L, table.incrementColumnValue(row, column, 1));
assertEquals(-2L, table.incrementColumnValue(row, column, -4));
assertEquals(-2L, table.incrementColumnValue(row, column, -5));
row = Bytes.toBytes("foo3");
byte[] value2 = {1,2,3,4,5,6,7,8,9};