HBASE-1659, merge tool binary fixes
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@794125 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
740749bcea
commit
3e6fa5f0b8
|
@ -266,6 +266,7 @@ Release 0.20.0 - Unreleased
|
|||
start-up/shut down. ie: you cant start/stop thrift on a cluster
|
||||
anymore
|
||||
HBASE-1658 Remove UI refresh -- its annoying
|
||||
HBASE-1659 merge tool doesnt take binary regions with \x escape format
|
||||
|
||||
IMPROVEMENTS
|
||||
HBASE-1089 Add count of regions on filesystem to master UI; add percentage
|
||||
|
|
|
@ -345,8 +345,8 @@ public class Merge extends Configured implements Tool {
|
|||
tableName = Bytes.toBytes(remainingArgs[0]);
|
||||
isMetaTable = Bytes.compareTo(tableName, HConstants.META_TABLE_NAME) == 0;
|
||||
|
||||
region1 = Bytes.toBytes(remainingArgs[1]);
|
||||
region2 = Bytes.toBytes(remainingArgs[2]);
|
||||
region1 = Bytes.toBytesBinary(remainingArgs[1]);
|
||||
region2 = Bytes.toBytesBinary(remainingArgs[2]);
|
||||
int status = 0;
|
||||
if (notInTable(tableName, region1) || notInTable(tableName, region2)) {
|
||||
status = -1;
|
||||
|
|
|
@ -53,6 +53,30 @@ public class TestStoreScanner extends TestCase {
|
|||
return cols;
|
||||
}
|
||||
|
||||
public void testScanSameTimestamp() throws IOException {
|
||||
// returns only 1 of these 2 even though same timestamp
|
||||
KeyValue [] kvs = new KeyValue[] {
|
||||
KeyValueTestUtil.create("R1", "cf", "a", 1, KeyValue.Type.Put, "dont-care"),
|
||||
KeyValueTestUtil.create("R1", "cf", "a", 1, KeyValue.Type.Put, "dont-care"),
|
||||
};
|
||||
KeyValueScanner [] scanners = new KeyValueScanner[] {
|
||||
new KeyValueScanFixture(KeyValue.COMPARATOR,
|
||||
kvs)
|
||||
};
|
||||
|
||||
Scan scanSpec = new Scan(Bytes.toBytes("R1"));
|
||||
// this only uses maxVersions (default=1) and TimeRange (default=all)
|
||||
StoreScanner scan =
|
||||
new StoreScanner(scanSpec, CF, Long.MAX_VALUE,
|
||||
KeyValue.COMPARATOR, getCols("a"),
|
||||
scanners);
|
||||
|
||||
List<KeyValue> results = new ArrayList<KeyValue>();
|
||||
assertEquals(true, scan.next(results));
|
||||
assertEquals(1, results.size());
|
||||
assertEquals(kvs[0], results.get(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test test shows exactly how the matcher's return codes confuses the StoreScanner
|
||||
* and prevent it from doing the right thing. Seeking once, then nexting twice
|
||||
|
|
Loading…
Reference in New Issue