mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-3.11' into trunk
This commit is contained in:
commit
d45cd7e658
|
|
@ -59,6 +59,7 @@
|
|||
|
||||
|
||||
3.11.0
|
||||
* Fix compaction-stress by using daemonInitialization (CASSANDRA-13188)
|
||||
* V5 protocol flags decoding broken (CASSANDRA-13443)
|
||||
* Use write lock not read lock for removing sstables from compaction strategies. (CASSANDRA-13422)
|
||||
* Use corePoolSize equal to maxPoolSize in JMXEnabledThreadPoolExecutors (CASSANDRA-13329)
|
||||
|
|
@ -161,7 +162,6 @@ Merged from 2.1:
|
|||
* Upgrade netty version to fix memory leak with client encryption (CASSANDRA-13114)
|
||||
* Coalescing strategy can enter infinite loop (CASSANDRA-13159)
|
||||
|
||||
|
||||
3.10
|
||||
* Fix secondary index queries regression (CASSANDRA-13013)
|
||||
* Add duration type to the protocol V5 (CASSANDRA-12850)
|
||||
|
|
|
|||
|
|
@ -1576,7 +1576,7 @@
|
|||
]]>
|
||||
</scriptdef>
|
||||
|
||||
<target name="test" depends="build-test" description="Parallel Test Runner">
|
||||
<target name="test" depends="build-test,stress-build" description="Parallel Test Runner">
|
||||
<path id="all-test-classes-path">
|
||||
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />
|
||||
</path>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
# Copied from https://gist.github.com/tjake/8995058fed11d9921e31
|
||||
### DML ###
|
||||
|
||||
# Keyspace Name
|
||||
keyspace: stresscql
|
||||
|
||||
# The CQL for creating a keyspace (optional if it already exists)
|
||||
keyspace_definition: |
|
||||
CREATE KEYSPACE stresscql WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};
|
||||
|
||||
# Table name
|
||||
table: blogposts
|
||||
|
||||
# The CQL for creating a table you wish to stress (optional if it already exists)
|
||||
table_definition: |
|
||||
CREATE TABLE blogposts (
|
||||
domain text,
|
||||
published_date timeuuid,
|
||||
url text,
|
||||
author text,
|
||||
title text,
|
||||
body text,
|
||||
PRIMARY KEY(domain, published_date)
|
||||
) WITH CLUSTERING ORDER BY (published_date DESC)
|
||||
AND compaction = { 'class':'LeveledCompactionStrategy' }
|
||||
AND comment='A table to hold blog posts'
|
||||
|
||||
### Column Distribution Specifications ###
|
||||
|
||||
columnspec:
|
||||
- name: domain
|
||||
size: gaussian(5..100) #domain names are relatively short
|
||||
population: uniform(1..10M) #10M possible domains to pick from
|
||||
|
||||
- name: published_date
|
||||
cluster: fixed(1000) #under each domain we will have max 1000 posts
|
||||
|
||||
- name: url
|
||||
size: uniform(30..300)
|
||||
|
||||
- name: title #titles shouldn't go beyond 200 chars
|
||||
size: gaussian(10..200)
|
||||
|
||||
- name: author
|
||||
size: uniform(5..20) #author names should be short
|
||||
|
||||
- name: body
|
||||
size: gaussian(100..5000) #the body of the blog post can be long
|
||||
|
||||
### Batch Ratio Distribution Specifications ###
|
||||
|
||||
insert:
|
||||
partitions: fixed(1) # Our partition key is the domain so only insert one per batch
|
||||
|
||||
select: fixed(1)/1000 # We have 1000 posts per domain so 1/1000 will allow 1 post per batch
|
||||
|
||||
batchtype: UNLOGGED # Unlogged batches
|
||||
|
||||
|
||||
#
|
||||
# A list of queries you wish to run against the schema
|
||||
#
|
||||
queries:
|
||||
singlepost:
|
||||
cql: select * from blogposts where domain = ? LIMIT 1
|
||||
fields: samerow
|
||||
timeline:
|
||||
cql: select url, title, published_date from blogposts where domain = ? LIMIT 10
|
||||
fields: samerow
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* 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.tools;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.apache.cassandra.OrderedJUnit4ClassRunner;
|
||||
|
||||
@RunWith(OrderedJUnit4ClassRunner.class)
|
||||
public class CompactionStressTest extends ToolsTester
|
||||
{
|
||||
@Test
|
||||
public void testNoArgs()
|
||||
{
|
||||
runTool(0, "org.apache.cassandra.stress.CompactionStress");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWriteAndCompact()
|
||||
{
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
File file = new File(classLoader.getResource("blogpost.yaml").getFile());
|
||||
String profileFile = file.getAbsolutePath();
|
||||
|
||||
runTool(0,
|
||||
"org.apache.cassandra.stress.CompactionStress",
|
||||
"write",
|
||||
"-d", "build/test/cassandra",
|
||||
"-g", "0",
|
||||
"-p", profileFile,
|
||||
"-t", "4");
|
||||
|
||||
runTool(0,
|
||||
"org.apache.cassandra.stress.CompactionStress",
|
||||
"compact",
|
||||
"-d", "build/test/cassandra",
|
||||
"-p", profileFile,
|
||||
"-t", "4");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -612,15 +612,17 @@ public class StressCQLSSTableWriter implements Closeable
|
|||
|
||||
KeyspaceMetadata ksm = Schema.instance.getKeyspaceMetadata(keyspace);
|
||||
|
||||
assert ksm.tables.getNullable(schemaStatement.columnFamily()) == null;
|
||||
TableMetadata tableMetadata = ksm.tables.getNullable(schemaStatement.columnFamily());
|
||||
if (tableMetadata != null)
|
||||
return Schema.instance.getColumnFamilyStoreInstance(tableMetadata.id);
|
||||
|
||||
CreateTableStatement statement = (CreateTableStatement) schemaStatement.prepare(ksm.types).statement;
|
||||
statement.validate(ClientState.forInternalCalls());
|
||||
|
||||
//Build metadata with a portable tableId
|
||||
TableMetadata tableMetadata = statement.builder()
|
||||
.id(deterministicId(statement.keyspace(), statement.columnFamily()))
|
||||
.build();
|
||||
tableMetadata = statement.builder()
|
||||
.id(deterministicId(statement.keyspace(), statement.columnFamily()))
|
||||
.build();
|
||||
|
||||
Keyspace.setInitialized();
|
||||
Directories directories = new Directories(tableMetadata, directoryList.stream().map(Directories.DataDirectory::new).collect(Collectors.toList()));
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public abstract class CompactionStress implements Runnable
|
|||
|
||||
static
|
||||
{
|
||||
DatabaseDescriptor.toolInitialization();
|
||||
DatabaseDescriptor.daemonInitialization();
|
||||
}
|
||||
|
||||
List<File> getDataDirectories()
|
||||
|
|
|
|||
Loading…
Reference in New Issue