mirror of https://github.com/apache/cassandra
CEP-15: (C*) Enhance in-memory FileSystem to work with mmap and support tests to add custom logic
patch by David Capwell; reviewed by Caleb Rackliffe for CASSANDRA-18485
This commit is contained in:
parent
8633a301f7
commit
da92eed225
|
|
@ -727,7 +727,6 @@ public class ClusterSimulation<S extends Simulation> implements AutoCloseable
|
|||
.set("failure_detector", SimulatedFailureDetector.Instance.class.getName())
|
||||
.set("commitlog_compression", new ParameterizedClass(LZ4Compressor.class.getName(), emptyMap()))
|
||||
.set("commitlog_sync", "batch");
|
||||
|
||||
// TODO: Add remove() to IInstanceConfig
|
||||
if (config instanceof InstanceConfig)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ import org.apache.cassandra.exceptions.SyntaxException;
|
|||
import org.apache.cassandra.index.Index;
|
||||
import org.apache.cassandra.index.SecondaryIndexManager;
|
||||
import org.apache.cassandra.io.filesystem.ListenableFileSystem;
|
||||
import org.apache.cassandra.io.sstable.Descriptor;
|
||||
import org.apache.cassandra.io.util.File;
|
||||
import org.apache.cassandra.io.util.FileSystems;
|
||||
import org.apache.cassandra.io.util.FileUtils;
|
||||
|
|
@ -3238,6 +3239,18 @@ public abstract class CQLTester
|
|||
return;
|
||||
fs.clearListeners();
|
||||
}
|
||||
|
||||
protected ListenableFileSystem.PathFilter isCurrentTableIndexFile(String keyspace)
|
||||
{
|
||||
return path -> {
|
||||
if (!path.getFileName().toString().endsWith("Index.db"))
|
||||
return false;
|
||||
Descriptor desc = Descriptor.fromFile(new File(path));
|
||||
if (!desc.ksname.equals(keyspace) && desc.cfname.equals(currentTable()))
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private static class ClusterSettings
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import com.datastax.driver.core.ResultSet;
|
|||
import com.datastax.driver.core.Session;
|
||||
import com.datastax.driver.core.exceptions.SyntaxError;
|
||||
import com.datastax.driver.core.exceptions.WriteTimeoutException;
|
||||
import org.apache.cassandra.ServerTestUtils;
|
||||
import org.apache.cassandra.config.DatabaseDescriptor;
|
||||
import org.apache.cassandra.db.ConsistencyLevel;
|
||||
import org.apache.cassandra.exceptions.PreparedQueryNotFoundException;
|
||||
|
|
@ -66,6 +67,7 @@ public class PreparedStatementsTest extends CQLTester
|
|||
@BeforeClass
|
||||
public static void setUpClass()
|
||||
{
|
||||
ServerTestUtils.daemonInitialization();
|
||||
DatabaseDescriptor.setAccordTransactionsEnabled(true);
|
||||
CQLTester.setUpClass();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,12 @@ import org.junit.Test;
|
|||
import org.apache.cassandra.Util;
|
||||
import org.apache.cassandra.cql3.CQLTester;
|
||||
import org.apache.cassandra.cql3.restrictions.StatementRestrictions;
|
||||
import org.apache.cassandra.db.marshal.*;
|
||||
import org.apache.cassandra.db.marshal.AbstractType;
|
||||
import org.apache.cassandra.db.marshal.Int32Type;
|
||||
import org.apache.cassandra.db.marshal.ListType;
|
||||
import org.apache.cassandra.db.marshal.MapType;
|
||||
import org.apache.cassandra.db.marshal.SetType;
|
||||
import org.apache.cassandra.db.marshal.TupleType;
|
||||
import org.apache.cassandra.dht.ByteOrderedPartitioner;
|
||||
import org.apache.cassandra.exceptions.ConfigurationException;
|
||||
import org.apache.cassandra.exceptions.InvalidRequestException;
|
||||
|
|
|
|||
Loading…
Reference in New Issue