HBASE-9142 Mutation#getFamilyMap() return type change between HBase 94 and 96 breaks downstream apps

For 0.95/0.96, we need to preserve the getFamilyMap signature through a deprecation cycle.  The new
method needs to be present alongside the old in 0.95, so we rename the method with the new signature
to getFamilyCellMap() in both trunk and 0.95, and restore a deprecated version of the old in 0.95.



git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1512103 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Hsieh 2013-08-08 23:50:28 +00:00
parent 3bc9e2c95c
commit f528e81766
19 changed files with 48 additions and 48 deletions

View File

@ -137,7 +137,7 @@ public class Delete extends Mutation implements Comparable<Row> {
public Delete(final Delete d) { public Delete(final Delete d) {
this.row = d.getRow(); this.row = d.getRow();
this.ts = d.getTimeStamp(); this.ts = d.getTimeStamp();
this.familyMap.putAll(d.getFamilyMap()); this.familyMap.putAll(d.getFamilyCellMap());
this.durability = d.durability; this.durability = d.durability;
} }

View File

@ -1328,7 +1328,7 @@ public class HTable implements HTableInterface {
throw new IllegalArgumentException("No columns to insert"); throw new IllegalArgumentException("No columns to insert");
} }
if (maxKeyValueSize > 0) { if (maxKeyValueSize > 0) {
for (List<? extends Cell> list : put.getFamilyMap().values()) { for (List<? extends Cell> list : put.getFamilyCellMap().values()) {
for (Cell cell : list) { for (Cell cell : list) {
// KeyValue v1 expectation. Cast for now. // KeyValue v1 expectation. Cast for now.
KeyValue kv = KeyValueUtil.ensureKeyValue(cell); KeyValue kv = KeyValueUtil.ensureKeyValue(cell);

View File

@ -174,7 +174,7 @@ public class Increment extends Mutation implements Comparable<Row> {
* @since 0.95.0 * @since 0.95.0
*/ */
public Map<byte[], NavigableMap<byte [], Long>> getFamilyMapOfLongs() { public Map<byte[], NavigableMap<byte [], Long>> getFamilyMapOfLongs() {
NavigableMap<byte[], List<? extends Cell>> map = super.getFamilyMap(); NavigableMap<byte[], List<? extends Cell>> map = super.getFamilyCellMap();
Map<byte [], NavigableMap<byte[], Long>> results = Map<byte [], NavigableMap<byte[], Long>> results =
new TreeMap<byte[], NavigableMap<byte [], Long>>(Bytes.BYTES_COMPARATOR); new TreeMap<byte[], NavigableMap<byte [], Long>>(Bytes.BYTES_COMPARATOR);
for (Map.Entry<byte [], List<? extends Cell>> entry: map.entrySet()) { for (Map.Entry<byte [], List<? extends Cell>> entry: map.entrySet()) {

View File

@ -70,7 +70,7 @@ public abstract class Mutation extends OperationWithAttributes implements Row, C
@Override @Override
public CellScanner cellScanner() { public CellScanner cellScanner() {
return CellUtil.createCellScanner(getFamilyMap()); return CellUtil.createCellScanner(getFamilyCellMap());
} }
/** /**
@ -182,7 +182,7 @@ public abstract class Mutation extends OperationWithAttributes implements Row, C
* Method for retrieving the put's familyMap * Method for retrieving the put's familyMap
* @return familyMap * @return familyMap
*/ */
public NavigableMap<byte [], List<? extends Cell>> getFamilyMap() { public NavigableMap<byte [], List<? extends Cell>> getFamilyCellMap() {
return this.familyMap; return this.familyMap;
} }

View File

@ -93,7 +93,7 @@ public class Put extends Mutation implements HeapSize, Comparable<Row> {
public Put(Put putToCopy) { public Put(Put putToCopy) {
this(putToCopy.getRow(), putToCopy.ts); this(putToCopy.getRow(), putToCopy.ts);
this.familyMap = new TreeMap<byte [], List<? extends Cell>>(Bytes.BYTES_COMPARATOR); this.familyMap = new TreeMap<byte [], List<? extends Cell>>(Bytes.BYTES_COMPARATOR);
for(Map.Entry<byte [], List<? extends Cell>> entry: putToCopy.getFamilyMap().entrySet()) { for(Map.Entry<byte [], List<? extends Cell>> entry: putToCopy.getFamilyCellMap().entrySet()) {
this.familyMap.put(entry.getKey(), entry.getValue()); this.familyMap.put(entry.getKey(), entry.getValue());
} }
this.durability = putToCopy.durability; this.durability = putToCopy.durability;

View File

@ -927,7 +927,7 @@ public final class ProtobufUtil {
} }
ColumnValue.Builder columnBuilder = ColumnValue.newBuilder(); ColumnValue.Builder columnBuilder = ColumnValue.newBuilder();
QualifierValue.Builder valueBuilder = QualifierValue.newBuilder(); QualifierValue.Builder valueBuilder = QualifierValue.newBuilder();
for (Map.Entry<byte[], List<? extends Cell>> family: increment.getFamilyMap().entrySet()) { for (Map.Entry<byte[], List<? extends Cell>> family: increment.getFamilyCellMap().entrySet()) {
columnBuilder.setFamily(ByteString.copyFrom(family.getKey())); columnBuilder.setFamily(ByteString.copyFrom(family.getKey()));
columnBuilder.clearQualifierValue(); columnBuilder.clearQualifierValue();
List<? extends Cell> values = family.getValue(); List<? extends Cell> values = family.getValue();
@ -957,7 +957,7 @@ public final class ProtobufUtil {
MutationProto.Builder builder = getMutationBuilderAndSetCommonFields(type, mutation); MutationProto.Builder builder = getMutationBuilderAndSetCommonFields(type, mutation);
ColumnValue.Builder columnBuilder = ColumnValue.newBuilder(); ColumnValue.Builder columnBuilder = ColumnValue.newBuilder();
QualifierValue.Builder valueBuilder = QualifierValue.newBuilder(); QualifierValue.Builder valueBuilder = QualifierValue.newBuilder();
for (Map.Entry<byte[],List<? extends Cell>> family: mutation.getFamilyMap().entrySet()) { for (Map.Entry<byte[],List<? extends Cell>> family: mutation.getFamilyCellMap().entrySet()) {
columnBuilder.setFamily(ByteString.copyFrom(family.getKey())); columnBuilder.setFamily(ByteString.copyFrom(family.getKey()));
columnBuilder.clearQualifierValue(); columnBuilder.clearQualifierValue();
for (Cell cell: family.getValue()) { for (Cell cell: family.getValue()) {

View File

@ -61,9 +61,9 @@ public class PutCombiner<K> extends Reducer<K, Put, K, Put> {
cnt++; cnt++;
if (put == null) { if (put == null) {
put = p; put = p;
familyMap = put.getFamilyMap(); familyMap = put.getFamilyCellMap();
} else { } else {
for (Entry<byte[], List<? extends Cell>> entry : p.getFamilyMap() for (Entry<byte[], List<? extends Cell>> entry : p.getFamilyCellMap()
.entrySet()) { .entrySet()) {
List<? extends Cell> cells = familyMap.get(entry.getKey()); List<? extends Cell> cells = familyMap.get(entry.getKey());
List<KeyValue> kvs = (cells != null) ? (List<KeyValue>) cells : null; List<KeyValue> kvs = (cells != null) ? (List<KeyValue>) cells : null;

View File

@ -63,7 +63,7 @@ public class PutSortReducer extends
// stop at the end or the RAM threshold // stop at the end or the RAM threshold
while (iter.hasNext() && curSize < threshold) { while (iter.hasNext() && curSize < threshold) {
Put p = iter.next(); Put p = iter.next();
for (List<? extends Cell> cells: p.getFamilyMap().values()) { for (List<? extends Cell> cells: p.getFamilyCellMap().values()) {
for (Cell cell: cells) { for (Cell cell: cells) {
KeyValue kv = KeyValueUtil.ensureKeyValue(cell); KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
map.add(kv); map.add(kv);

View File

@ -1734,13 +1734,13 @@ public class HRegion implements HeapSize { // , Writable{
*/ */
void prepareDelete(Delete delete) throws IOException { void prepareDelete(Delete delete) throws IOException {
// Check to see if this is a deleteRow insert // Check to see if this is a deleteRow insert
if(delete.getFamilyMap().isEmpty()){ if(delete.getFamilyCellMap().isEmpty()){
for(byte [] family : this.htableDescriptor.getFamiliesKeys()){ for(byte [] family : this.htableDescriptor.getFamiliesKeys()){
// Don't eat the timestamp // Don't eat the timestamp
delete.deleteFamily(family, delete.getTimeStamp()); delete.deleteFamily(family, delete.getTimeStamp());
} }
} else { } else {
for(byte [] family : delete.getFamilyMap().keySet()) { for(byte [] family : delete.getFamilyCellMap().keySet()) {
if(family == null) { if(family == null) {
throw new NoSuchColumnFamilyException("Empty family is invalid"); throw new NoSuchColumnFamilyException("Empty family is invalid");
} }
@ -2026,7 +2026,7 @@ public class HRegion implements HeapSize { // , Writable{
Mutation mutation = batchOp.operations[lastIndexExclusive]; Mutation mutation = batchOp.operations[lastIndexExclusive];
boolean isPutMutation = mutation instanceof Put; boolean isPutMutation = mutation instanceof Put;
Map<byte[], List<? extends Cell>> familyMap = mutation.getFamilyMap(); Map<byte[], List<? extends Cell>> familyMap = mutation.getFamilyCellMap();
// store the family map reference to allow for mutations // store the family map reference to allow for mutations
familyMaps[lastIndexExclusive] = familyMap; familyMaps[lastIndexExclusive] = familyMap;
@ -2045,7 +2045,7 @@ public class HRegion implements HeapSize { // , Writable{
} else { } else {
checkFamilies(familyMap.keySet()); checkFamilies(familyMap.keySet());
} }
checkTimestamps(mutation.getFamilyMap(), now); checkTimestamps(mutation.getFamilyCellMap(), now);
} else { } else {
prepareDelete((Delete) mutation); prepareDelete((Delete) mutation);
} }
@ -2089,17 +2089,17 @@ public class HRegion implements HeapSize { // , Writable{
// individual puts then metrics can be reported as a mutliput across // individual puts then metrics can be reported as a mutliput across
// column families in the first put. // column families in the first put.
if (putsCfSet == null) { if (putsCfSet == null) {
putsCfSet = mutation.getFamilyMap().keySet(); putsCfSet = mutation.getFamilyCellMap().keySet();
} else { } else {
putsCfSetConsistent = putsCfSetConsistent putsCfSetConsistent = putsCfSetConsistent
&& mutation.getFamilyMap().keySet().equals(putsCfSet); && mutation.getFamilyCellMap().keySet().equals(putsCfSet);
} }
} else { } else {
if (deletesCfSet == null) { if (deletesCfSet == null) {
deletesCfSet = mutation.getFamilyMap().keySet(); deletesCfSet = mutation.getFamilyCellMap().keySet();
} else { } else {
deletesCfSetConsistent = deletesCfSetConsistent deletesCfSetConsistent = deletesCfSetConsistent
&& mutation.getFamilyMap().keySet().equals(deletesCfSet); && mutation.getFamilyCellMap().keySet().equals(deletesCfSet);
} }
} }
} }
@ -2185,7 +2185,7 @@ public class HRegion implements HeapSize { // , Writable{
durability = tmpDur; durability = tmpDur;
} }
if (tmpDur == Durability.SKIP_WAL) { if (tmpDur == Durability.SKIP_WAL) {
recordMutationWithoutWal(m.getFamilyMap()); recordMutationWithoutWal(m.getFamilyCellMap());
continue; continue;
} }
@ -4669,7 +4669,7 @@ public class HRegion implements HeapSize { // , Writable{
try { try {
long now = EnvironmentEdgeManager.currentTimeMillis(); long now = EnvironmentEdgeManager.currentTimeMillis();
// Process each family // Process each family
for (Map.Entry<byte[], List<? extends Cell>> family : append.getFamilyMap().entrySet()) { for (Map.Entry<byte[], List<? extends Cell>> family : append.getFamilyCellMap().entrySet()) {
Store store = stores.get(family.getKey()); Store store = stores.get(family.getKey());
List<KeyValue> kvs = new ArrayList<KeyValue>(family.getValue().size()); List<KeyValue> kvs = new ArrayList<KeyValue>(family.getValue().size());
@ -4755,7 +4755,7 @@ public class HRegion implements HeapSize { // , Writable{
walEdits, HConstants.DEFAULT_CLUSTER_ID, EnvironmentEdgeManager.currentTimeMillis(), walEdits, HConstants.DEFAULT_CLUSTER_ID, EnvironmentEdgeManager.currentTimeMillis(),
this.htableDescriptor); this.htableDescriptor);
} else { } else {
recordMutationWithoutWal(append.getFamilyMap()); recordMutationWithoutWal(append.getFamilyCellMap());
} }
//Actually write to Memstore now //Actually write to Memstore now
@ -4844,7 +4844,7 @@ public class HRegion implements HeapSize { // , Writable{
long now = EnvironmentEdgeManager.currentTimeMillis(); long now = EnvironmentEdgeManager.currentTimeMillis();
// Process each family // Process each family
for (Map.Entry<byte [], List<? extends Cell>> family: for (Map.Entry<byte [], List<? extends Cell>> family:
increment.getFamilyMap().entrySet()) { increment.getFamilyCellMap().entrySet()) {
Store store = stores.get(family.getKey()); Store store = stores.get(family.getKey());
List<KeyValue> kvs = new ArrayList<KeyValue>(family.getValue().size()); List<KeyValue> kvs = new ArrayList<KeyValue>(family.getValue().size());
@ -4905,7 +4905,7 @@ public class HRegion implements HeapSize { // , Writable{
walEdits, HConstants.DEFAULT_CLUSTER_ID, EnvironmentEdgeManager.currentTimeMillis(), walEdits, HConstants.DEFAULT_CLUSTER_ID, EnvironmentEdgeManager.currentTimeMillis(),
this.htableDescriptor); this.htableDescriptor);
} else { } else {
recordMutationWithoutWal(increment.getFamilyMap()); recordMutationWithoutWal(increment.getFamilyCellMap());
} }
//Actually write to Memstore now //Actually write to Memstore now
for (Map.Entry<Store, List<KeyValue>> entry : tempMemstore.entrySet()) { for (Map.Entry<Store, List<KeyValue>> entry : tempMemstore.entrySet()) {

View File

@ -73,20 +73,20 @@ MultiRowMutationProcessorResponse> {
// Check mutations and apply edits to a single WALEdit // Check mutations and apply edits to a single WALEdit
for (Mutation m : mutations) { for (Mutation m : mutations) {
if (m instanceof Put) { if (m instanceof Put) {
Map<byte[], List<? extends Cell>> familyMap = m.getFamilyMap(); Map<byte[], List<? extends Cell>> familyMap = m.getFamilyCellMap();
region.checkFamilies(familyMap.keySet()); region.checkFamilies(familyMap.keySet());
region.checkTimestamps(familyMap, now); region.checkTimestamps(familyMap, now);
region.updateKVTimestamps(familyMap.values(), byteNow); region.updateKVTimestamps(familyMap.values(), byteNow);
} else if (m instanceof Delete) { } else if (m instanceof Delete) {
Delete d = (Delete) m; Delete d = (Delete) m;
region.prepareDelete(d); region.prepareDelete(d);
region.prepareDeleteTimestamps(d.getFamilyMap(), byteNow); region.prepareDeleteTimestamps(d.getFamilyCellMap(), byteNow);
} else { } else {
throw new DoNotRetryIOException( throw new DoNotRetryIOException(
"Action must be Put or Delete. But was: " "Action must be Put or Delete. But was: "
+ m.getClass().getName()); + m.getClass().getName());
} }
for (List<? extends Cell> cells: m.getFamilyMap().values()) { for (List<? extends Cell> cells: m.getFamilyCellMap().values()) {
boolean writeToWAL = m.getDurability() != Durability.SKIP_WAL; boolean writeToWAL = m.getDurability() != Durability.SKIP_WAL;
for (Cell cell : cells) { for (Cell cell : cells) {
KeyValue kv = KeyValueUtil.ensureKeyValue(cell); KeyValue kv = KeyValueUtil.ensureKeyValue(cell);

View File

@ -184,7 +184,7 @@ public class RemoteHTable implements HTableInterface {
protected CellSetModel buildModelFromPut(Put put) { protected CellSetModel buildModelFromPut(Put put) {
RowModel row = new RowModel(put.getRow()); RowModel row = new RowModel(put.getRow());
long ts = put.getTimeStamp(); long ts = put.getTimeStamp();
for (List<? extends Cell> cells: put.getFamilyMap().values()) { for (List<? extends Cell> cells: put.getFamilyCellMap().values()) {
for (Cell cell: cells) { for (Cell cell: cells) {
KeyValue kv = KeyValueUtil.ensureKeyValue(cell); KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
row.addCell(new CellModel(kv.getFamily(), kv.getQualifier(), row.addCell(new CellModel(kv.getFamily(), kv.getQualifier(),
@ -404,7 +404,7 @@ public class RemoteHTable implements HTableInterface {
cells = new ArrayList<Cell>(); cells = new ArrayList<Cell>();
map.put(row, cells); map.put(row, cells);
} }
for (List<? extends Cell> l: put.getFamilyMap().values()) { for (List<? extends Cell> l: put.getFamilyCellMap().values()) {
cells.addAll(l); cells.addAll(l);
} }
} }
@ -445,7 +445,7 @@ public class RemoteHTable implements HTableInterface {
} }
public void delete(Delete delete) throws IOException { public void delete(Delete delete) throws IOException {
String spec = buildRowSpec(delete.getRow(), delete.getFamilyMap(), String spec = buildRowSpec(delete.getRow(), delete.getFamilyCellMap(),
delete.getTimeStamp(), delete.getTimeStamp(), 1); delete.getTimeStamp(), delete.getTimeStamp(), 1);
for (int i = 0; i < maxRetries; i++) { for (int i = 0; i < maxRetries; i++) {
Response response = client.delete(spec); Response response = client.delete(spec);

View File

@ -938,14 +938,14 @@ public class AccessController extends BaseRegionObserver
final Put put, final WALEdit edit, final Durability durability) final Put put, final WALEdit edit, final Durability durability)
throws IOException { throws IOException {
requirePermission("put", Permission.Action.WRITE, c.getEnvironment(), requirePermission("put", Permission.Action.WRITE, c.getEnvironment(),
put.getFamilyMap()); put.getFamilyCellMap());
} }
@Override @Override
public void postPut(final ObserverContext<RegionCoprocessorEnvironment> c, public void postPut(final ObserverContext<RegionCoprocessorEnvironment> c,
final Put put, final WALEdit edit, final Durability durability) { final Put put, final WALEdit edit, final Durability durability) {
if (aclRegion) { if (aclRegion) {
updateACL(c.getEnvironment(), put.getFamilyMap()); updateACL(c.getEnvironment(), put.getFamilyCellMap());
} }
} }
@ -954,7 +954,7 @@ public class AccessController extends BaseRegionObserver
final Delete delete, final WALEdit edit, final Durability durability) final Delete delete, final WALEdit edit, final Durability durability)
throws IOException { throws IOException {
requirePermission("delete", Permission.Action.WRITE, c.getEnvironment(), requirePermission("delete", Permission.Action.WRITE, c.getEnvironment(),
delete.getFamilyMap()); delete.getFamilyCellMap());
} }
@Override @Override
@ -962,7 +962,7 @@ public class AccessController extends BaseRegionObserver
final Delete delete, final WALEdit edit, final Durability durability) final Delete delete, final WALEdit edit, final Durability durability)
throws IOException { throws IOException {
if (aclRegion) { if (aclRegion) {
updateACL(c.getEnvironment(), delete.getFamilyMap()); updateACL(c.getEnvironment(), delete.getFamilyCellMap());
} }
} }
@ -1003,7 +1003,7 @@ public class AccessController extends BaseRegionObserver
@Override @Override
public Result preAppend(ObserverContext<RegionCoprocessorEnvironment> c, Append append) public Result preAppend(ObserverContext<RegionCoprocessorEnvironment> c, Append append)
throws IOException { throws IOException {
requirePermission("append", Permission.Action.WRITE, c.getEnvironment(), append.getFamilyMap()); requirePermission("append", Permission.Action.WRITE, c.getEnvironment(), append.getFamilyCellMap());
return null; return null;
} }
@ -1013,7 +1013,7 @@ public class AccessController extends BaseRegionObserver
throws IOException { throws IOException {
// Create a map of family to qualifiers. // Create a map of family to qualifiers.
Map<byte[], Set<byte[]>> familyMap = Maps.newTreeMap(Bytes.BYTES_COMPARATOR); Map<byte[], Set<byte[]>> familyMap = Maps.newTreeMap(Bytes.BYTES_COMPARATOR);
for (Map.Entry<byte [], List<? extends Cell>> entry: increment.getFamilyMap().entrySet()) { for (Map.Entry<byte [], List<? extends Cell>> entry: increment.getFamilyCellMap().entrySet()) {
Set<byte[]> qualifiers = Sets.newTreeSet(Bytes.BYTES_COMPARATOR); Set<byte[]> qualifiers = Sets.newTreeSet(Bytes.BYTES_COMPARATOR);
for (Cell cell: entry.getValue()) { for (Cell cell: entry.getValue()) {
KeyValue kv = KeyValueUtil.ensureKeyValue(cell); KeyValue kv = KeyValueUtil.ensureKeyValue(cell);

View File

@ -288,7 +288,7 @@ public class ThriftUtilities {
// Map<family, List<KeyValue>> // Map<family, List<KeyValue>>
for (Map.Entry<byte[], List<? extends org.apache.hadoop.hbase.Cell>> familyEntry: for (Map.Entry<byte[], List<? extends org.apache.hadoop.hbase.Cell>> familyEntry:
in.getFamilyMap().entrySet()) { in.getFamilyCellMap().entrySet()) {
TColumn column = new TColumn(ByteBuffer.wrap(familyEntry.getKey())); TColumn column = new TColumn(ByteBuffer.wrap(familyEntry.getKey()));
for (org.apache.hadoop.hbase.Cell cell: familyEntry.getValue()) { for (org.apache.hadoop.hbase.Cell cell: familyEntry.getValue()) {
KeyValue kv = KeyValueUtil.ensureKeyValue(cell); KeyValue kv = KeyValueUtil.ensureKeyValue(cell);

View File

@ -3796,10 +3796,10 @@ public class TestFromClientSide {
put.add(CONTENTS_FAMILY, null, value); put.add(CONTENTS_FAMILY, null, value);
assertEquals(put.size(), 1); assertEquals(put.size(), 1);
assertEquals(put.getFamilyMap().get(CONTENTS_FAMILY).size(), 1); assertEquals(put.getFamilyCellMap().get(CONTENTS_FAMILY).size(), 1);
// KeyValue v1 expectation. Cast for now until we go all Cell all the time. TODO // KeyValue v1 expectation. Cast for now until we go all Cell all the time. TODO
KeyValue kv = (KeyValue)put.getFamilyMap().get(CONTENTS_FAMILY).get(0); KeyValue kv = (KeyValue)put.getFamilyCellMap().get(CONTENTS_FAMILY).get(0);
assertTrue(Bytes.equals(kv.getFamily(), CONTENTS_FAMILY)); assertTrue(Bytes.equals(kv.getFamily(), CONTENTS_FAMILY));
// will it return null or an empty byte array? // will it return null or an empty byte array?

View File

@ -315,7 +315,7 @@ public class SimpleRegionObserver extends BaseRegionObserver {
public void prePut(final ObserverContext<RegionCoprocessorEnvironment> c, public void prePut(final ObserverContext<RegionCoprocessorEnvironment> c,
final Put put, final WALEdit edit, final Put put, final WALEdit edit,
final Durability durability) throws IOException { final Durability durability) throws IOException {
Map<byte[], List<? extends Cell>> familyMap = put.getFamilyMap(); Map<byte[], List<? extends Cell>> familyMap = put.getFamilyCellMap();
RegionCoprocessorEnvironment e = c.getEnvironment(); RegionCoprocessorEnvironment e = c.getEnvironment();
assertNotNull(e); assertNotNull(e);
assertNotNull(e.getRegion()); assertNotNull(e.getRegion());
@ -348,7 +348,7 @@ public class SimpleRegionObserver extends BaseRegionObserver {
public void postPut(final ObserverContext<RegionCoprocessorEnvironment> c, public void postPut(final ObserverContext<RegionCoprocessorEnvironment> c,
final Put put, final WALEdit edit, final Put put, final WALEdit edit,
final Durability durability) throws IOException { final Durability durability) throws IOException {
Map<byte[], List<? extends Cell>> familyMap = put.getFamilyMap(); Map<byte[], List<? extends Cell>> familyMap = put.getFamilyCellMap();
RegionCoprocessorEnvironment e = c.getEnvironment(); RegionCoprocessorEnvironment e = c.getEnvironment();
assertNotNull(e); assertNotNull(e);
assertNotNull(e.getRegion()); assertNotNull(e.getRegion());
@ -381,7 +381,7 @@ public class SimpleRegionObserver extends BaseRegionObserver {
public void preDelete(final ObserverContext<RegionCoprocessorEnvironment> c, public void preDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
final Delete delete, final WALEdit edit, final Delete delete, final WALEdit edit,
final Durability durability) throws IOException { final Durability durability) throws IOException {
Map<byte[], List<? extends Cell>> familyMap = delete.getFamilyMap(); Map<byte[], List<? extends Cell>> familyMap = delete.getFamilyCellMap();
RegionCoprocessorEnvironment e = c.getEnvironment(); RegionCoprocessorEnvironment e = c.getEnvironment();
assertNotNull(e); assertNotNull(e);
assertNotNull(e.getRegion()); assertNotNull(e.getRegion());
@ -395,7 +395,7 @@ public class SimpleRegionObserver extends BaseRegionObserver {
public void postDelete(final ObserverContext<RegionCoprocessorEnvironment> c, public void postDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
final Delete delete, final WALEdit edit, final Delete delete, final WALEdit edit,
final Durability durability) throws IOException { final Durability durability) throws IOException {
Map<byte[], List<? extends Cell>> familyMap = delete.getFamilyMap(); Map<byte[], List<? extends Cell>> familyMap = delete.getFamilyCellMap();
RegionCoprocessorEnvironment e = c.getEnvironment(); RegionCoprocessorEnvironment e = c.getEnvironment();
assertNotNull(e); assertNotNull(e);
assertNotNull(e.getRegion()); assertNotNull(e.getRegion());

View File

@ -208,7 +208,7 @@ public class TestRegionObserverBypass {
public void prePut(final ObserverContext<RegionCoprocessorEnvironment> e, public void prePut(final ObserverContext<RegionCoprocessorEnvironment> e,
final Put put, final WALEdit edit, final Durability durability) final Put put, final WALEdit edit, final Durability durability)
throws IOException { throws IOException {
Map<byte[], List<? extends Cell>> familyMap = put.getFamilyMap(); Map<byte[], List<? extends Cell>> familyMap = put.getFamilyCellMap();
if (familyMap.containsKey(test)) { if (familyMap.containsKey(test)) {
e.bypass(); e.bypass();
} }

View File

@ -157,7 +157,7 @@ public class TestWALObserver {
// Use a Put to create familyMap. // Use a Put to create familyMap.
Put p = creatPutWith2Families(TEST_ROW); Put p = creatPutWith2Families(TEST_ROW);
Map<byte[], List<? extends Cell>> familyMap = p.getFamilyMap(); Map<byte[], List<? extends Cell>> familyMap = p.getFamilyCellMap();
WALEdit edit = new WALEdit(); WALEdit edit = new WALEdit();
addFamilyMapToWALEdit(familyMap, edit); addFamilyMapToWALEdit(familyMap, edit);

View File

@ -99,7 +99,7 @@ public final class HLogPerformanceEvaluation extends Configured implements Tool
Put put = setupPut(rand, key, value, numFamilies); Put put = setupPut(rand, key, value, numFamilies);
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
WALEdit walEdit = new WALEdit(); WALEdit walEdit = new WALEdit();
addFamilyMapToWALEdit(put.getFamilyMap(), walEdit); addFamilyMapToWALEdit(put.getFamilyCellMap(), walEdit);
HRegionInfo hri = region.getRegionInfo(); HRegionInfo hri = region.getRegionInfo();
if (this.noSync) { if (this.noSync) {
hlog.appendNoSync(hri, hri.getTableName(), walEdit, hlog.appendNoSync(hri, hri.getTableName(), walEdit,

View File

@ -222,12 +222,12 @@ public class TestCoprocessorScanPolicy {
public void prePut(final ObserverContext<RegionCoprocessorEnvironment> c, final Put put, public void prePut(final ObserverContext<RegionCoprocessorEnvironment> c, final Put put,
final WALEdit edit, final Durability durability) throws IOException { final WALEdit edit, final Durability durability) throws IOException {
if (put.getAttribute("ttl") != null) { if (put.getAttribute("ttl") != null) {
Cell cell = put.getFamilyMap().values().iterator().next().get(0); Cell cell = put.getFamilyCellMap().values().iterator().next().get(0);
KeyValue kv = KeyValueUtil.ensureKeyValue(cell); KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
ttls.put(TableName.valueOf(kv.getQualifier()), Bytes.toLong(kv.getValue())); ttls.put(TableName.valueOf(kv.getQualifier()), Bytes.toLong(kv.getValue()));
c.bypass(); c.bypass();
} else if (put.getAttribute("versions") != null) { } else if (put.getAttribute("versions") != null) {
Cell cell = put.getFamilyMap().values().iterator().next().get(0); Cell cell = put.getFamilyCellMap().values().iterator().next().get(0);
KeyValue kv = KeyValueUtil.ensureKeyValue(cell); KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
versions.put(TableName.valueOf(kv.getQualifier()), Bytes.toInt(kv.getValue())); versions.put(TableName.valueOf(kv.getQualifier()), Bytes.toInt(kv.getValue()));
c.bypass(); c.bypass();