Skip to content
Open
Show file tree
Hide file tree
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 @@ -148,7 +148,7 @@ public void testDeleteTableCancelsSleepingExternalCompaction() throws Exception
try (AccumuloClient client =
Accumulo.newClient().from(getCluster().getClientProperties()).build()) {

createTable(client, table1, "cs4"); // TODO which service
createTable(client, table1, "cs4");
TableId tid = getCluster().getServerContext().getTableId(table1);
writeData(client, table1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.verify;
import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.writeData;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Collection;
import java.util.List;
Expand All @@ -46,12 +47,14 @@
import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.dataImpl.KeyExtent;
import org.apache.accumulo.core.metadata.SystemTables;
import org.apache.accumulo.core.metadata.schema.Ample.DataLevel;
import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType;
import org.apache.accumulo.core.metadata.schema.TabletsMetadata;
import org.apache.accumulo.core.metrics.MetricsInfo;
import org.apache.accumulo.core.spi.metrics.LoggingMeterRegistryFactory;
import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.util.compaction.ExternalCompactionUtil;
import org.apache.accumulo.core.util.threads.Threads;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
Expand All @@ -61,6 +64,7 @@
import org.apache.accumulo.test.metrics.TestStatsDRegistryFactory;
import org.apache.accumulo.test.metrics.TestStatsDSink;
import org.apache.accumulo.test.metrics.TestStatsDSink.Metric;
import org.apache.accumulo.test.util.Wait;
import org.apache.hadoop.conf.Configuration;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -214,20 +218,22 @@ public void testMetrics() throws Exception {
thread.join();

// Wait for all external compactions to complete
long count;
do {
// TODO: Change this from waiting to verifying that all compactors are done running jobs,
// not just check that the jobs have been polled off the queues.
Comment thread
Amemeda marked this conversation as resolved.
UtilWaitThread.sleep(10000);
Wait.waitFor(() -> {
try (TabletsMetadata tm = getCluster().getServerContext().getAmple().readTablets()
.forLevel(DataLevel.USER).fetch(ColumnType.ECOMP).build()) {
count = tm.stream().mapToLong(t -> t.getExternalCompactions().keySet().size()).sum();
return tm.stream().allMatch(t -> t.getExternalCompactions().isEmpty());
}
} while (count > 0);
});
Comment thread
Amemeda marked this conversation as resolved.

// verify any running compactions contains only system tables
ExternalCompactionUtil.getCompactionsRunningOnCompactors(getCluster().getServerContext(),
externalCompaction -> {
var tableId = KeyExtent.fromThrift(externalCompaction.getJob().getExtent()).tableId();
assertTrue(SystemTables.tableIds().contains(tableId));
});

verify(client, table1, 7);
verify(client, table2, 13);

}
}

Expand Down