diff --git a/test/unit/org/apache/cassandra/index/sai/memory/OffHeapTrieMemtableIndexTest.java b/test/unit/org/apache/cassandra/index/sai/memory/OffHeapTrieMemtableIndexTest.java deleted file mode 100644 index f297bde0f812..000000000000 --- a/test/unit/org/apache/cassandra/index/sai/memory/OffHeapTrieMemtableIndexTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.index.sai.memory; - -import org.junit.BeforeClass; -import org.junit.Test; - -import org.apache.cassandra.config.Config; -import org.apache.cassandra.config.DatabaseDescriptor; -import org.apache.cassandra.db.memtable.AbstractShardedMemtable; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class OffHeapTrieMemtableIndexTest extends AbstractTrieMemtableIndexTest -{ - @BeforeClass - public static void setUpClass() - { - DatabaseDescriptor.getRawConfig().memtable_allocation_type = Config.MemtableAllocationType.offheap_buffers; - AbstractTrieMemtableIndexTest.setUpClass(); - } - - @Test - public void offHeapAllocation() - { - memtableIndex = new TrieMemtableIndex(indexContext, memtable); - assertEquals(AbstractShardedMemtable.getDefaultShardCount(), memtableIndex.shardCount()); - - assertEquals(0, memtable.getAllocator().onHeap().owns()); - assertEquals(0, memtable.getAllocator().offHeap().owns()); - - for (int row = 0; row < 100; row++) - { - addRow(row, row); - } - - assertTrue(memtable.getAllocator().onHeap().owns() > 0); - assertTrue(memtable.getAllocator().offHeap().owns() > 0); - } -} diff --git a/test/unit/org/apache/cassandra/index/sai/memory/OnHeapTrieMemtableIndexTest.java b/test/unit/org/apache/cassandra/index/sai/memory/OnHeapTrieMemtableIndexTest.java deleted file mode 100644 index 0ff6e087ec69..000000000000 --- a/test/unit/org/apache/cassandra/index/sai/memory/OnHeapTrieMemtableIndexTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.index.sai.memory; - -import org.junit.BeforeClass; -import org.junit.Test; - -import org.apache.cassandra.config.Config; -import org.apache.cassandra.config.DatabaseDescriptor; -import org.apache.cassandra.db.memtable.AbstractShardedMemtable; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class OnHeapTrieMemtableIndexTest extends AbstractTrieMemtableIndexTest -{ - @BeforeClass - public static void setUpClass() - { - DatabaseDescriptor.getRawConfig().memtable_allocation_type = Config.MemtableAllocationType.heap_buffers; - AbstractTrieMemtableIndexTest.setUpClass(); - } - - @Test - public void onHeapAllocation() - { - memtableIndex = new TrieMemtableIndex(indexContext, memtable); - assertEquals(AbstractShardedMemtable.getDefaultShardCount(), memtableIndex.shardCount()); - - assertEquals(0, memtable.getAllocator().onHeap().owns()); - assertEquals(0, memtable.getAllocator().offHeap().owns()); - - for (int row = 0; row < 100; row++) - { - addRow(row, row); - } - - assertTrue(memtable.getAllocator().onHeap().owns() > 0); - assertEquals(0, memtable.getAllocator().offHeap().owns()); - } -} diff --git a/test/unit/org/apache/cassandra/index/sai/memory/AbstractTrieMemtableIndexTest.java b/test/unit/org/apache/cassandra/index/sai/memory/TrieMemtableIndexTest.java similarity index 87% rename from test/unit/org/apache/cassandra/index/sai/memory/AbstractTrieMemtableIndexTest.java rename to test/unit/org/apache/cassandra/index/sai/memory/TrieMemtableIndexTest.java index ecfc2d29cd8f..13cabd3e706b 100644 --- a/test/unit/org/apache/cassandra/index/sai/memory/AbstractTrieMemtableIndexTest.java +++ b/test/unit/org/apache/cassandra/index/sai/memory/TrieMemtableIndexTest.java @@ -18,23 +18,23 @@ package org.apache.cassandra.index.sai.memory; -import org.apache.cassandra.cql3.CQLTester; -import org.junit.BeforeClass; - import org.apache.cassandra.config.Config; import org.apache.cassandra.db.memtable.TrieMemtable; import org.apache.cassandra.io.compress.BufferType; +import org.junit.BeforeClass; + +import org.junit.Ignore; import static org.apache.cassandra.config.CassandraRelevantProperties.MEMTABLE_SHARD_COUNT; import static org.junit.Assert.assertEquals; -public class AbstractTrieMemtableIndexTest extends TrieMemtableIndexTestBase +@Ignore +public abstract class TrieMemtableIndexTest extends TrieMemtableIndexTestBase { @BeforeClass - public static void setUpClass() + public static void setShardCount() { MEMTABLE_SHARD_COUNT.setInt(8); - CQLTester.setUpClass(); setup(Config.MemtableAllocationType.offheap_buffers); assertEquals(TrieMemtable.BUFFER_TYPE, BufferType.OFF_HEAP); }