Skip to content

Commit 9ab5b62

Browse files
committed
Row set is accessed under lock, does not need to be a concurrent type
1 parent c6d2a11 commit 9ab5b62

File tree

1 file changed

+4
-4
lines changed
  • hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver

1 file changed

+4
-4
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6812,8 +6812,8 @@ public String toString() {
68126812
public static class RowCommitSequencer {
68136813

68146814
final AtomicLong sequence = new AtomicLong(EnvironmentEdgeManager.currentTime());
6815-
final AtomicReference<ConcurrentSkipListSet<HashedBytes>> sequenceRowSet =
6816-
new AtomicReference<>(new ConcurrentSkipListSet<>());
6815+
final AtomicReference<HashSet<HashedBytes>> sequenceRowSet =
6816+
new AtomicReference<>(new HashSet<>());
68176817
final ReentrantLock sequenceRowSetLock = new ReentrantLock();
68186818
final LongAdder yieldCount = new LongAdder();
68196819

@@ -6823,7 +6823,7 @@ long updateCurrentTime(final long now) {
68236823
// We only care that there is a unique CSLS for each discrete tick.
68246824
if (now != x) {
68256825
// When the clock ticks, we begin a new commit sequence.
6826-
sequenceRowSet.set(new ConcurrentSkipListSet<>());
6826+
sequenceRowSet.set(new HashSet<>());
68276827
}
68286828
return now;
68296829
});
@@ -6841,7 +6841,7 @@ boolean checkForOverlap(Collection<RowLock> rowLocks) throws IOException {
68416841
throw (IOException) new InterruptedIOException().initCause(e);
68426842
}
68436843
try {
6844-
ConcurrentSkipListSet<HashedBytes> rowSet = sequenceRowSet.get();
6844+
Set<HashedBytes> rowSet = sequenceRowSet.get();
68456845
for (RowLock l: rowLocks) {
68466846
HashedBytes row = ((RowLockImpl)l).context.row;
68476847
if (rowSet.contains(row)) {

0 commit comments

Comments
 (0)