Skip to content
Closed
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
@@ -0,0 +1,46 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cassandra.io.sstable;


import org.junit.BeforeClass;

import org.apache.cassandra.SchemaLoader;
import org.apache.cassandra.config.Config;
import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.db.Keyspace;
import org.apache.cassandra.db.commitlog.CommitLog;
import org.apache.cassandra.dht.Murmur3Partitioner;
import org.apache.cassandra.service.StorageService;

public class CQLSSTableWriterDaemonMurmur3Test extends CQLSSTableWriterTest
{
@BeforeClass
public static void setup() throws Exception
{
DatabaseDescriptor.daemonInitialization(() -> {
Config config = DatabaseDescriptor.loadConfig();
config.partitioner = Murmur3Partitioner.class.getName();
return config;
});
CommitLog.instance.start();
SchemaLoader.cleanupAndLeaveDirs();
Keyspace.setInitialized();
StorageService.instance.initServer();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
Expand Down Expand Up @@ -569,6 +570,10 @@ public void testConcurrentWriters() throws Exception
@SuppressWarnings("unchecked")
public void testWritesWithUdts() throws Exception
{
Assume.assumeTrue("Skip test when using DaemonInitialization with Murmur3Partitioner",
!DatabaseDescriptor.isDaemonInitialized()
|| !(DatabaseDescriptor.getPartitioner() instanceof Murmur3Partitioner));

final String schema = "CREATE TABLE " + qualifiedTable + " ("
+ " k int,"
+ " v1 list<frozen<tuple2>>,"
Expand Down Expand Up @@ -639,6 +644,10 @@ public void testWritesWithUdts() throws Exception
@SuppressWarnings("unchecked")
public void testWritesWithDependentUdts() throws Exception
{
Assume.assumeTrue("Skip test when using DaemonInitialization with Murmur3Partitioner",
!DatabaseDescriptor.isDaemonInitialized()
|| !(DatabaseDescriptor.getPartitioner() instanceof Murmur3Partitioner));

final String schema = "CREATE TABLE " + qualifiedTable + " ("
+ " k int,"
+ " v1 frozen<nested_tuple>,"
Expand Down Expand Up @@ -699,6 +708,10 @@ public void testWritesWithDependentUdts() throws Exception
@Test
public void testUnsetValues() throws Exception
{
Assume.assumeTrue("Skip test when using DaemonInitialization with Murmur3Partitioner",
!DatabaseDescriptor.isDaemonInitialized()
|| !(DatabaseDescriptor.getPartitioner() instanceof Murmur3Partitioner));

final String schema = "CREATE TABLE " + qualifiedTable + " ("
+ " k int,"
+ " c1 int,"
Expand Down Expand Up @@ -1238,6 +1251,10 @@ public void testWriteWithTimestampsAndTtl() throws Exception
@Test
public void testWriteWithSorted() throws Exception
{
Assume.assumeTrue("Skip test when using DaemonInitialization with Murmur3Partitioner",
!DatabaseDescriptor.isDaemonInitialized()
|| !(DatabaseDescriptor.getPartitioner() instanceof Murmur3Partitioner));

String schema = "CREATE TABLE " + qualifiedTable + " ("
+ " k int PRIMARY KEY,"
+ " v blob )";
Expand Down Expand Up @@ -1269,6 +1286,10 @@ public void testWriteWithSorted() throws Exception
@Test
public void testWriteWithSortedAndMaxSize() throws Exception
{
Assume.assumeTrue("Skip test when using DaemonInitialization with Murmur3Partitioner",
!DatabaseDescriptor.isDaemonInitialized()
|| !(DatabaseDescriptor.getPartitioner() instanceof Murmur3Partitioner));

String schema = "CREATE TABLE " + qualifiedTable + " ("
+ " k int PRIMARY KEY,"
+ " v blob )";
Expand Down Expand Up @@ -1359,6 +1380,9 @@ private void testWriters(String table1, String table2) throws IOException, Inval
@Test
public void testWriteWithSAI() throws Exception
{
Assume.assumeTrue("Skip test when using DaemonInitialization without Murmur3Partitioner",
!DatabaseDescriptor.isDaemonInitialized()
|| DatabaseDescriptor.getPartitioner() instanceof Murmur3Partitioner);
writeWithSaiInternal();
writeWithSaiInternal();
}
Expand Down Expand Up @@ -1410,6 +1434,10 @@ private void writeWithSaiInternal() throws Exception
@Test
public void testSkipBuildingIndexesWithSAI() throws Exception
{
Assume.assumeTrue("Skip test when using DaemonInitialization without Murmur3Partitioner",
!DatabaseDescriptor.isDaemonInitialized()
|| DatabaseDescriptor.getPartitioner() instanceof Murmur3Partitioner);

String schema = "CREATE TABLE " + qualifiedTable + " ("
+ " k int PRIMARY KEY,"
+ " v1 text,"
Expand Down