Skip to content
Permalink
Browse files
Merge branch 'cassandra-4.1' into trunk
  • Loading branch information
bereng committed May 19, 2022
2 parents 26dd119 + 0a7084a commit 733a4a58ef1a285031d0dd62f427327f36f31120
Showing 1 changed file with 10 additions and 9 deletions.
@@ -18,10 +18,6 @@

package org.apache.cassandra.tools;

import static java.lang.String.format;
import static org.apache.cassandra.cql3.QueryProcessor.executeInternal;
import static org.junit.Assert.assertEquals;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
@@ -31,15 +27,20 @@

import javax.management.openmbean.CompositeData;

import com.google.common.collect.Lists;

import org.junit.BeforeClass;
import org.junit.Test;

import org.apache.cassandra.SchemaLoader;
import org.apache.cassandra.db.ColumnFamilyStore;
import org.apache.cassandra.db.SystemKeyspace;
import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.service.StorageService;
import org.junit.BeforeClass;
import org.junit.Test;

import com.google.common.collect.Lists;
import static java.lang.String.format;
import static org.apache.cassandra.cql3.QueryProcessor.executeInternal;
import static org.junit.Assert.assertEquals;

public class TopPartitionsTest
{
@@ -75,10 +76,10 @@ public void testServiceTopPartitionsNoArg() throws Exception
@Test
public void testServiceTopPartitionsSingleTable() throws Exception
{
ColumnFamilyStore.getIfExists("system", "local").beginLocalSampling("READS", 5, 100000);
ColumnFamilyStore.getIfExists("system", "local").beginLocalSampling("READS", 5, 240000);
String req = "SELECT * FROM system.%s WHERE key='%s'";
executeInternal(format(req, SystemKeyspace.LOCAL, SystemKeyspace.LOCAL));
List<CompositeData> result = ColumnFamilyStore.getIfExists("system", "local").finishLocalSampling("READS", 5);
assertEquals(1, result.size());
assertEquals("If this failed you probably have to raise the beginLocalSampling duration", 1, result.size());
}
}

0 comments on commit 733a4a5

Please sign in to comment.