[1/6] hbase git commit: HBASE-21660 Apply the cell to right memstore for increment/append operation [Forced Update!]

2019-01-01 Thread zhangduo
Repository: hbase
Updated Branches:
  refs/heads/HBASE-21512 b33b072de -> 44462a48e (forced update)


HBASE-21660 Apply the cell to right memstore for increment/append operation


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3ab89597
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3ab89597
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3ab89597

Branch: refs/heads/HBASE-21512
Commit: 3ab895979b643a2980bcdb7fee2078f14b614210
Parents: 7755d4b
Author: Guanghao Zhang 
Authored: Sun Dec 30 18:52:03 2018 +0800
Committer: Guanghao Zhang 
Committed: Tue Jan 1 17:32:44 2019 +0800

--
 .../hadoop/hbase/regionserver/HRegion.java  |  14 +-
 .../TestPostIncrementAndAppendBeforeWAL.java| 235 +++
 2 files changed, 245 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/3ab89597/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index ec222c7..5ab61fa 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -7980,12 +7980,18 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 for (Map.Entry> entry: 
mutation.getFamilyCellMap().entrySet()) {
   final byte[] columnFamilyName = entry.getKey();
   List deltas = entry.getValue();
-  HStore store = this.stores.get(columnFamilyName);
   // Reckon for the Store what to apply to WAL and MemStore.
-  List toApply =
-reckonDeltasByStore(store, op, mutation, effectiveDurability, now, 
deltas, results);
+  List toApply = reckonDeltasByStore(stores.get(columnFamilyName), 
op, mutation,
+effectiveDurability, now, deltas, results);
   if (!toApply.isEmpty()) {
-forMemStore.put(store, toApply);
+for (Cell cell : toApply) {
+  HStore store = getStore(cell);
+  if (store == null) {
+checkFamily(CellUtil.cloneFamily(cell));
+  } else {
+forMemStore.computeIfAbsent(store, key -> new 
ArrayList<>()).add(cell);
+  }
+}
 if (writeToWAL) {
   if (walEdit == null) {
 walEdit = new WALEdit();

http://git-wip-us.apache.org/repos/asf/hbase/blob/3ab89597/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
new file mode 100644
index 000..031960b
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
@@ -0,0 +1,235 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.coprocessor;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellBuilderType;
+import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.ExtendedCellBuilderFactory;
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Append;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.Connection;
+import 

hbase git commit: HBASE-21660 Apply the cell to right memstore for increment/append operation

2019-01-01 Thread zghao
Repository: hbase
Updated Branches:
  refs/heads/branch-2 26700fb2c -> a237d97f7


HBASE-21660 Apply the cell to right memstore for increment/append operation


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/a237d97f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a237d97f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a237d97f

Branch: refs/heads/branch-2
Commit: a237d97f726a6a293104e88f25848bddc0f1056c
Parents: 26700fb
Author: Guanghao Zhang 
Authored: Sun Dec 30 18:52:03 2018 +0800
Committer: Guanghao Zhang 
Committed: Tue Jan 1 17:38:37 2019 +0800

--
 .../hadoop/hbase/regionserver/HRegion.java  |  14 +-
 .../TestPostIncrementAndAppendBeforeWAL.java| 235 +++
 2 files changed, 245 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/a237d97f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index fe10712..4a5f9ff 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -7924,12 +7924,18 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 for (Map.Entry> entry: 
mutation.getFamilyCellMap().entrySet()) {
   final byte[] columnFamilyName = entry.getKey();
   List deltas = entry.getValue();
-  HStore store = this.stores.get(columnFamilyName);
   // Reckon for the Store what to apply to WAL and MemStore.
-  List toApply =
-reckonDeltasByStore(store, op, mutation, effectiveDurability, now, 
deltas, results);
+  List toApply = reckonDeltasByStore(stores.get(columnFamilyName), 
op, mutation,
+effectiveDurability, now, deltas, results);
   if (!toApply.isEmpty()) {
-forMemStore.put(store, toApply);
+for (Cell cell : toApply) {
+  HStore store = getStore(cell);
+  if (store == null) {
+checkFamily(CellUtil.cloneFamily(cell));
+  } else {
+forMemStore.computeIfAbsent(store, key -> new 
ArrayList<>()).add(cell);
+  }
+}
 if (writeToWAL) {
   if (walEdit == null) {
 walEdit = new WALEdit();

http://git-wip-us.apache.org/repos/asf/hbase/blob/a237d97f/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
new file mode 100644
index 000..031960b
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
@@ -0,0 +1,235 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.coprocessor;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellBuilderType;
+import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.ExtendedCellBuilderFactory;
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Append;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.Connection;
+import org.apache.hadoop.hbase.client.Get;

hbase git commit: HBASE-21660 Apply the cell to right memstore for increment/append operation

2019-01-01 Thread zghao
Repository: hbase
Updated Branches:
  refs/heads/master 7755d4bee -> 3ab895979


HBASE-21660 Apply the cell to right memstore for increment/append operation


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3ab89597
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3ab89597
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3ab89597

Branch: refs/heads/master
Commit: 3ab895979b643a2980bcdb7fee2078f14b614210
Parents: 7755d4b
Author: Guanghao Zhang 
Authored: Sun Dec 30 18:52:03 2018 +0800
Committer: Guanghao Zhang 
Committed: Tue Jan 1 17:32:44 2019 +0800

--
 .../hadoop/hbase/regionserver/HRegion.java  |  14 +-
 .../TestPostIncrementAndAppendBeforeWAL.java| 235 +++
 2 files changed, 245 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/3ab89597/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index ec222c7..5ab61fa 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -7980,12 +7980,18 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 for (Map.Entry> entry: 
mutation.getFamilyCellMap().entrySet()) {
   final byte[] columnFamilyName = entry.getKey();
   List deltas = entry.getValue();
-  HStore store = this.stores.get(columnFamilyName);
   // Reckon for the Store what to apply to WAL and MemStore.
-  List toApply =
-reckonDeltasByStore(store, op, mutation, effectiveDurability, now, 
deltas, results);
+  List toApply = reckonDeltasByStore(stores.get(columnFamilyName), 
op, mutation,
+effectiveDurability, now, deltas, results);
   if (!toApply.isEmpty()) {
-forMemStore.put(store, toApply);
+for (Cell cell : toApply) {
+  HStore store = getStore(cell);
+  if (store == null) {
+checkFamily(CellUtil.cloneFamily(cell));
+  } else {
+forMemStore.computeIfAbsent(store, key -> new 
ArrayList<>()).add(cell);
+  }
+}
 if (writeToWAL) {
   if (walEdit == null) {
 walEdit = new WALEdit();

http://git-wip-us.apache.org/repos/asf/hbase/blob/3ab89597/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
new file mode 100644
index 000..031960b
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java
@@ -0,0 +1,235 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.coprocessor;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellBuilderType;
+import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.ExtendedCellBuilderFactory;
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Append;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.Connection;
+import org.apache.hadoop.hbase.client.Get;
+import