HBASE-1059 ConcurrentModificationException in notifyChangedReadersObservers
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@726152 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2ab4b14572
commit
0f3838e1d1
|
@ -106,6 +106,7 @@ Release 0.19.0 - Unreleased
|
|||
HBASE-1054 Index NPE on scanning (Clint Morgan via Andrew Purtell)
|
||||
HBASE-1052 Stopping a HRegionServer with unflushed cache causes data loss
|
||||
from org.apache.hadoop.hbase.DroppedSnapshotException
|
||||
HBASE-1059 ConcurrentModificationException in notifyChangedReadersObservers
|
||||
|
||||
IMPROVEMENTS
|
||||
HBASE-901 Add a limit to key length, check key and value length on client side
|
||||
|
|
|
@ -122,8 +122,10 @@ public class HStore implements HConstants {
|
|||
private final Path compactionDir;
|
||||
private final Integer compactLock = new Integer(0);
|
||||
private final int compactionThreshold;
|
||||
|
||||
// All access must be synchronized.
|
||||
private final Set<ChangedReadersObserver> changedReaderObservers =
|
||||
Collections.synchronizedSet(new HashSet<ChangedReadersObserver>());
|
||||
new HashSet<ChangedReadersObserver>();
|
||||
|
||||
/**
|
||||
* An HStore is a set of zero or more MapFiles, which stretch backwards over
|
||||
|
@ -740,15 +742,19 @@ public class HStore implements HConstants {
|
|||
* @param o Observer who wants to know about changes in set of Readers
|
||||
*/
|
||||
void addChangedReaderObserver(ChangedReadersObserver o) {
|
||||
this.changedReaderObservers.add(o);
|
||||
synchronized(this.changedReaderObservers) {
|
||||
this.changedReaderObservers.add(o);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @param o Observer no longer interested in changes in set of Readers.
|
||||
*/
|
||||
void deleteChangedReaderObserver(ChangedReadersObserver o) {
|
||||
if (!this.changedReaderObservers.remove(o)) {
|
||||
LOG.warn("Not in set" + o);
|
||||
synchronized (this.changedReaderObservers) {
|
||||
if (!this.changedReaderObservers.remove(o)) {
|
||||
LOG.warn("Not in set" + o);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue