Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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 @@ -18,6 +18,7 @@
*/
package org.apache.accumulo.tserver.tablet;

import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.file.FilePrefix;
import org.apache.accumulo.core.metadata.ReferencedTabletFile;
import org.apache.accumulo.core.metadata.schema.DataFileValue;
Expand All @@ -41,6 +42,8 @@ class MinorCompactionTask implements Runnable {
private final long flushId;
private final MinorCompactionReason mincReason;

private final long pauseLimit;

MinorCompactionTask(Tablet tablet, CommitSession commitSession, long flushId,
MinorCompactionReason mincReason) {
this.tablet = tablet;
Expand All @@ -49,6 +52,8 @@ class MinorCompactionTask implements Runnable {
this.commitSession = commitSession;
this.flushId = flushId;
this.mincReason = mincReason;
this.pauseLimit = tablet.getContext().getTableConfiguration(tablet.extent.tableId())
.getCount(Property.TABLE_FILE_PAUSE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ DataFileValue minorCompact(InMemoryMap memTable, ReferencedTabletFile tmpDatafil
boolean failed = false;
long start = System.currentTimeMillis();
timer.incrementStatusMinor();

long count = 0;

String oldName = Thread.currentThread().getName();
Expand All @@ -394,7 +393,6 @@ DataFileValue minorCompact(InMemoryMap memTable, ReferencedTabletFile tmpDatafil
Span span = TraceUtil.startSpan(this.getClass(), "minorCompact::write");
try (Scope scope = span.makeCurrent()) {
count = memTable.getNumEntries();

MinorCompactor compactor = new MinorCompactor(tabletServer, this, memTable, tmpDatafile,
mincReason, tableConfiguration);
stats = compactor.call();
Expand Down Expand Up @@ -585,15 +583,17 @@ private MinorCompactionTask createMinorCompactionTask(long flushId,
MinorCompactionReason mincReason) {
MinorCompactionTask mct;
long t1, t2;

long pauseLimit =
getContext().getTableConfiguration(extent.tableId()).getCount(Property.TABLE_FILE_PAUSE);
StringBuilder logMessage = null;

try {
synchronized (this) {
t1 = System.currentTimeMillis();

if (isClosing() || isClosed() || getTabletMemory().memoryReservedForMinC()
|| getTabletMemory().getMemTable().getNumEntries() == 0 || updatingFlushID) {
|| updatingFlushID || (mincReason == MinorCompactionReason.SYSTEM
&& getDatafiles().size() >= pauseLimit)) {

logMessage = new StringBuilder();

Expand All @@ -603,9 +603,9 @@ private MinorCompactionTask createMinorCompactionTask(long flushId,
logMessage.append(" tabletMemory.memoryReservedForMinC() "
+ getTabletMemory().memoryReservedForMinC());
}
if (getTabletMemory() != null && getTabletMemory().getMemTable() != null) {
logMessage.append(" tabletMemory.getMemTable().getNumEntries() "
+ getTabletMemory().getMemTable().getNumEntries());
if (mincReason == MinorCompactionReason.SYSTEM) {
logMessage.append(" fileCount " + getDatafiles().size());
logMessage.append(" fileCountPauseLimit " + pauseLimit);
}
logMessage.append(" updatingFlushID " + updatingFlushID);

Expand Down