HBASE-756 In HBase shell, the put command doesn't process the timestamp

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@678454 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-07-21 15:47:35 +00:00
parent c04a282e7c
commit a34a37985f
3 changed files with 13 additions and 11 deletions

View File

@ -251,7 +251,7 @@ module HBase
now = Time.now
bu = nil
if timestamp
bu = BatchUpdate.new(row)
bu = BatchUpdate.new(row, timestamp)
else
bu = BatchUpdate.new(row)
end

View File

@ -840,8 +840,7 @@ public class HStore implements HConstants {
int timesSeen = 0;
byte [] lastRow = null;
byte [] lastColumn = null;
// Map of a row deletes keyed by column with a list of timestamps for value
Map<byte [], List<Long>> deletes = null;
while (numDone < done.length) {
// Find the reader with the smallest key. If two files have same key
// but different values -- i.e. one is delete and other is non-delete
@ -869,14 +868,9 @@ public class HStore implements HConstants {
timesSeen++;
} else {
timesSeen = 0;
// We are on to a new row. Create a new deletes list.
deletes = new TreeMap<byte [], List<Long>>(Bytes.BYTES_COMPARATOR);
}
byte [] value = (vals[smallestKey] == null)?
null: vals[smallestKey].get();
if (!isDeleted(sk, value, false, deletes) &&
timesSeen <= family.getMaxVersions()) {
if (timesSeen <= family.getMaxVersions()) {
// Keep old versions until we have maxVersions worth.
// Then just skip them.
if (sk.getRow().length != 0 && sk.getColumn().length != 0) {

View File

@ -144,16 +144,24 @@ public class TestCompaction extends HBaseTestCase {
// Assert that the first row is still deleted.
cellValues = r.get(STARTROW, COLUMN_FAMILY_TEXT, 100 /*Too many*/);
assertNull(cellValues);
// Assert the store files do not have the first record 'aaa' keys in them.
// Make sure the store files do have some 'aaa' keys in them.
boolean containsStartRow = false;
for (MapFile.Reader reader: this.r.stores.
get(Bytes.mapKey(COLUMN_FAMILY_TEXT_MINUS_COLON)).getReaders()) {
reader.reset();
HStoreKey key = new HStoreKey();
ImmutableBytesWritable val = new ImmutableBytesWritable();
while(reader.next(key, val)) {
assertFalse(Bytes.equals(key.getRow(), STARTROW));
if (Bytes.equals(key.getRow(), STARTROW)) {
containsStartRow = true;
break;
}
}
if (containsStartRow) {
break;
}
}
assertTrue(containsStartRow);
}
private void createStoreFile(final HRegion region) throws IOException {