Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ public void start(Map<byte[], List<Cell>> familyMaps) throws RegionTooBusyExcept
}

String tooBusyStore = null;
boolean aboveParallelThreadLimit = false;
boolean aboveParallelPrePutLimit = false;

for (Map.Entry<byte[], List<Cell>> e : familyMaps.entrySet()) {
Store store = this.region.getStore(e.getKey());
Expand All @@ -123,12 +125,16 @@ public void start(Map<byte[], List<Cell>> familyMaps) throws RegionTooBusyExcept
int preparePutCount = preparePutToStoreMap
.computeIfAbsent(e.getKey(), key -> new AtomicInteger())
.incrementAndGet();
if (store.getCurrentParallelPutCount() > this.parallelPutToStoreThreadLimit
|| preparePutCount > this.parallelPreparePutToStoreThreadLimit) {
boolean storeAboveThread =
store.getCurrentParallelPutCount() > this.parallelPutToStoreThreadLimit;
boolean storeAbovePrePut = preparePutCount > this.parallelPreparePutToStoreThreadLimit;
if (storeAboveThread || storeAbovePrePut) {
tooBusyStore = (tooBusyStore == null ?
store.getColumnFamilyName() :
tooBusyStore + "," + store.getColumnFamilyName());
}
aboveParallelThreadLimit |= storeAboveThread;
aboveParallelPrePutLimit |= storeAbovePrePut;

if (LOG.isTraceEnabled()) {
LOG.trace(store.getColumnFamilyName() + ": preparePutCount=" + preparePutCount
Expand All @@ -137,10 +143,15 @@ public void start(Map<byte[], List<Cell>> familyMaps) throws RegionTooBusyExcept
}
}

if (tooBusyStore != null) {
if (aboveParallelThreadLimit || aboveParallelPrePutLimit) {
String msg =
"StoreTooBusy," + this.region.getRegionInfo().getRegionNameAsString() + ":" + tooBusyStore
+ " Above parallelPutToStoreThreadLimit(" + this.parallelPutToStoreThreadLimit + ")";
+ " Above "
+ (aboveParallelThreadLimit ? "parallelPutToStoreThreadLimit("
+ this.parallelPutToStoreThreadLimit + ")" : "")
+ (aboveParallelThreadLimit && aboveParallelPrePutLimit ? " or " : "")
+ (aboveParallelPrePutLimit ? "parallelPreparePutToStoreThreadLimit("
+ this.parallelPreparePutToStoreThreadLimit + ")" : "");
LOG.trace(msg);
throw new RegionTooBusyException(msg);
}
Expand Down