gjacoby126 commented on a change in pull request #638: PHOENIX-5494
URL: https://github.com/apache/phoenix/pull/638#discussion_r347614989
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/CachedLocalTable.java
##########
@@ -0,0 +1,49 @@
+package org.apache.phoenix.hbase.index.covered.data;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.client.Mutation;
+import org.apache.phoenix.hbase.index.covered.update.ColumnReference;
+import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
+
+import java.util.HashMap;
+
+public class CachedLocalTable implements LocalHBaseState {
+
+ private final HashMap<ImmutableBytesPtr, List<Cell>> rowKeyPtrToCells;
+
+ public CachedLocalTable(HashMap<ImmutableBytesPtr, List<Cell>>
rowKeyPtrToCells)
+ {
+ this.rowKeyPtrToCells = rowKeyPtrToCells;
+ }
+
+ @Override
+ public List<Cell> getCurrentRowState(
+ Mutation mutation,
+ Collection<? extends ColumnReference> columnReferences,
+ boolean ignoreNewerMutations) throws IOException {
+ byte[] rowKey = mutation.getRow();
+ List<Cell> cells = this.rowKeyPtrToCells.get(new
ImmutableBytesPtr(rowKey));
+
+ if(cells == null || cells.isEmpty()) {
+ return cells;
+ }
+ if(!ignoreNewerMutations) {
+ return cells;
+ }
+ long timestamp =
Review comment:
Can we guarantee that all Cells in a Mutation have the same timestamp?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services