[31/50] [abbrv] hbase git commit: HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki)
HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9da4e690 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9da4e690 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9da4e690 Branch: refs/heads/HBASE-18467 Commit: 9da4e6906e9d7f62b8a8fe5dc996b066dac4066e Parents: b087818 Author: RamkrishnaAuthored: Wed Aug 16 11:05:43 2017 +0530 Committer: Ramkrishna Committed: Wed Aug 16 11:06:31 2017 +0530 -- .../hadoop/hbase/regionserver/CellFlatMap.java | 63 +--- .../hadoop/hbase/regionserver/CellSet.java | 7 +-- 2 files changed, 57 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/9da4e690/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java index c83a382..aff6018 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java @@ -282,37 +282,85 @@ public abstract class CellFlatMap implements NavigableMap { } // Entry's getters - // all interfaces returning Entries are unsupported because we are dealing only with the keys + + private static class CellFlatMapEntry implements Entry | { +private final Cell cell; + +public CellFlatMapEntry (Cell cell) { + this.cell = cell; +} + +@Override +public Cell getKey() { + return cell; +} + +@Override +public Cell getValue() { + return cell; +} + +@Override +public Cell setValue(Cell value) { + throw new UnsupportedOperationException(); +} + } + @Override public Entry | lowerEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = lowerKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | higherEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = higherKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | ceilingEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = ceilingKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | floorEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = floorKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | firstEntry() { -throw new UnsupportedOperationException(); +Cell cell = firstKey(); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | lastEntry() { -throw new UnsupportedOperationException(); +Cell cell = lastKey(); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } + // The following 2 methods (pollFirstEntry, pollLastEntry) are unsupported because these are updating methods. @Override public Entry | pollFirstEntry() { throw new UnsupportedOperationException(); @@ -323,7 +371,6 @@ public abstract class CellFlatMap implements NavigableMap | { throw new UnsupportedOperationException(); } - // Updates // All updating methods below are unsupported. // Assuming an array of Cells will be allocated externally, http://git-wip-us.apache.org/repos/asf/hbase/blob/9da4e690/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java index 48262a9..6da57d3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java @@ -126,15 +126,12 @@ public class CellSet implements NavigableSet { throw new |
[40/50] [abbrv] hbase git commit: HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki)
HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9da4e690 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9da4e690 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9da4e690 Branch: refs/heads/HBASE-14070.HLC Commit: 9da4e6906e9d7f62b8a8fe5dc996b066dac4066e Parents: b087818 Author: RamkrishnaAuthored: Wed Aug 16 11:05:43 2017 +0530 Committer: Ramkrishna Committed: Wed Aug 16 11:06:31 2017 +0530 -- .../hadoop/hbase/regionserver/CellFlatMap.java | 63 +--- .../hadoop/hbase/regionserver/CellSet.java | 7 +-- 2 files changed, 57 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/9da4e690/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java index c83a382..aff6018 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java @@ -282,37 +282,85 @@ public abstract class CellFlatMap implements NavigableMap { } // Entry's getters - // all interfaces returning Entries are unsupported because we are dealing only with the keys + + private static class CellFlatMapEntry implements Entry | { +private final Cell cell; + +public CellFlatMapEntry (Cell cell) { + this.cell = cell; +} + +@Override +public Cell getKey() { + return cell; +} + +@Override +public Cell getValue() { + return cell; +} + +@Override +public Cell setValue(Cell value) { + throw new UnsupportedOperationException(); +} + } + @Override public Entry | lowerEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = lowerKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | higherEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = higherKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | ceilingEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = ceilingKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | floorEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = floorKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | firstEntry() { -throw new UnsupportedOperationException(); +Cell cell = firstKey(); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | lastEntry() { -throw new UnsupportedOperationException(); +Cell cell = lastKey(); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } + // The following 2 methods (pollFirstEntry, pollLastEntry) are unsupported because these are updating methods. @Override public Entry | pollFirstEntry() { throw new UnsupportedOperationException(); @@ -323,7 +371,6 @@ public abstract class CellFlatMap implements NavigableMap | { throw new UnsupportedOperationException(); } - // Updates // All updating methods below are unsupported. // Assuming an array of Cells will be allocated externally, http://git-wip-us.apache.org/repos/asf/hbase/blob/9da4e690/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java index 48262a9..6da57d3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java @@ -126,15 +126,12 @@ public class CellSet implements NavigableSet { throw new |
hbase git commit: HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki)
Repository: hbase Updated Branches: refs/heads/branch-1 a49d43bfb -> 6255dc700 HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6255dc70 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6255dc70 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6255dc70 Branch: refs/heads/branch-1 Commit: 6255dc70014ad3faf70ae43a786e8d4f5b79dd41 Parents: a49d43b Author: RamkrishnaAuthored: Wed Aug 16 11:05:43 2017 +0530 Committer: Andrew Purtell Committed: Wed Aug 16 10:50:58 2017 -0700 -- .../org/apache/hadoop/hbase/regionserver/CellSkipListSet.java| 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/6255dc70/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSkipListSet.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSkipListSet.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSkipListSet.java index 4c3ab50..916a428 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSkipListSet.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSkipListSet.java @@ -123,11 +123,11 @@ public class CellSkipListSet implements NavigableSet { } public Cell first() { -return this.delegatee.get(this.delegatee.firstKey()); +return this.delegatee.firstEntry().getValue(); } public Cell last() { -return this.delegatee.get(this.delegatee.lastKey()); +return this.delegatee.lastEntry().getValue(); } public boolean add(Cell e) {
hbase git commit: HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki)
Repository: hbase Updated Branches: refs/heads/branch-2 b2afd6c24 -> 8fa637103 HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8fa63710 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8fa63710 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8fa63710 Branch: refs/heads/branch-2 Commit: 8fa6371039e21cee1c7f76d299786a2fb5ed68ee Parents: b2afd6c Author: RamkrishnaAuthored: Wed Aug 16 11:05:43 2017 +0530 Committer: Ramkrishna Committed: Wed Aug 16 11:42:40 2017 +0530 -- .../hadoop/hbase/regionserver/CellFlatMap.java | 63 +--- .../hadoop/hbase/regionserver/CellSet.java | 7 +-- 2 files changed, 57 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/8fa63710/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java index c83a382..aff6018 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java @@ -282,37 +282,85 @@ public abstract class CellFlatMap implements NavigableMap { } // Entry's getters - // all interfaces returning Entries are unsupported because we are dealing only with the keys + + private static class CellFlatMapEntry implements Entry | { +private final Cell cell; + +public CellFlatMapEntry (Cell cell) { + this.cell = cell; +} + +@Override +public Cell getKey() { + return cell; +} + +@Override +public Cell getValue() { + return cell; +} + +@Override +public Cell setValue(Cell value) { + throw new UnsupportedOperationException(); +} + } + @Override public Entry | lowerEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = lowerKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | higherEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = higherKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | ceilingEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = ceilingKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | floorEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = floorKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | firstEntry() { -throw new UnsupportedOperationException(); +Cell cell = firstKey(); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | lastEntry() { -throw new UnsupportedOperationException(); +Cell cell = lastKey(); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } + // The following 2 methods (pollFirstEntry, pollLastEntry) are unsupported because these are updating methods. @Override public Entry | pollFirstEntry() { throw new UnsupportedOperationException(); @@ -323,7 +371,6 @@ public abstract class CellFlatMap implements NavigableMap | { throw new UnsupportedOperationException(); } - // Updates // All updating methods below are unsupported. // Assuming an array of Cells will be allocated externally, http://git-wip-us.apache.org/repos/asf/hbase/blob/8fa63710/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java index 48262a9..6da57d3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java @@ -126,15 +126,12 @@ public class |
hbase git commit: HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki)
Repository: hbase Updated Branches: refs/heads/branch-1.4 5b27f6253 -> 3552c70b5 HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3552c70b Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3552c70b Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3552c70b Branch: refs/heads/branch-1.4 Commit: 3552c70b5557b3b2486fab6594b1fc63c3d787fc Parents: 5b27f62 Author: RamkrishnaAuthored: Wed Aug 16 11:05:43 2017 +0530 Committer: Ramkrishna Committed: Wed Aug 16 11:18:41 2017 +0530 -- .../org/apache/hadoop/hbase/regionserver/CellSkipListSet.java| 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/3552c70b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSkipListSet.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSkipListSet.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSkipListSet.java index 4c3ab50..916a428 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSkipListSet.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSkipListSet.java @@ -123,11 +123,11 @@ public class CellSkipListSet implements NavigableSet { } public Cell first() { -return this.delegatee.get(this.delegatee.firstKey()); +return this.delegatee.firstEntry().getValue(); } public Cell last() { -return this.delegatee.get(this.delegatee.lastKey()); +return this.delegatee.lastEntry().getValue(); } public boolean add(Cell e) {
hbase git commit: HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki)
Repository: hbase Updated Branches: refs/heads/master b0878184a -> 9da4e6906 HBASE-18251 Remove unnecessary traversing to the first and last keys in the CellSet (Toshihoro Suzuki) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9da4e690 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9da4e690 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9da4e690 Branch: refs/heads/master Commit: 9da4e6906e9d7f62b8a8fe5dc996b066dac4066e Parents: b087818 Author: RamkrishnaAuthored: Wed Aug 16 11:05:43 2017 +0530 Committer: Ramkrishna Committed: Wed Aug 16 11:06:31 2017 +0530 -- .../hadoop/hbase/regionserver/CellFlatMap.java | 63 +--- .../hadoop/hbase/regionserver/CellSet.java | 7 +-- 2 files changed, 57 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/9da4e690/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java index c83a382..aff6018 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellFlatMap.java @@ -282,37 +282,85 @@ public abstract class CellFlatMap implements NavigableMap { } // Entry's getters - // all interfaces returning Entries are unsupported because we are dealing only with the keys + + private static class CellFlatMapEntry implements Entry | { +private final Cell cell; + +public CellFlatMapEntry (Cell cell) { + this.cell = cell; +} + +@Override +public Cell getKey() { + return cell; +} + +@Override +public Cell getValue() { + return cell; +} + +@Override +public Cell setValue(Cell value) { + throw new UnsupportedOperationException(); +} + } + @Override public Entry | lowerEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = lowerKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | higherEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = higherKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | ceilingEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = ceilingKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | floorEntry(Cell k) { -throw new UnsupportedOperationException(); +Cell cell = floorKey(k); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | firstEntry() { -throw new UnsupportedOperationException(); +Cell cell = firstKey(); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } @Override public Entry | lastEntry() { -throw new UnsupportedOperationException(); +Cell cell = lastKey(); +if (cell == null) { + return null; +} +return new CellFlatMapEntry(cell); } + // The following 2 methods (pollFirstEntry, pollLastEntry) are unsupported because these are updating methods. @Override public Entry | pollFirstEntry() { throw new UnsupportedOperationException(); @@ -323,7 +371,6 @@ public abstract class CellFlatMap implements NavigableMap | { throw new UnsupportedOperationException(); } - // Updates // All updating methods below are unsupported. // Assuming an array of Cells will be allocated externally, http://git-wip-us.apache.org/repos/asf/hbase/blob/9da4e690/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java index 48262a9..6da57d3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java @@ -126,15 +126,12 @@ public class |