Merge branch 'cassandra-5.0' into trunk

This commit is contained in:
Stefan Miklosovic 2023-10-10 10:19:12 +02:00
commit c40e0778b3
No known key found for this signature in database
GPG Key ID: 32F35CB2F546D93E
6 changed files with 5 additions and 97 deletions

View File

@ -48,10 +48,6 @@
<groupId>org.lz4</groupId>
<artifactId>lz4-java</artifactId>
</dependency>
<dependency>
<groupId>com.ning</groupId>
<artifactId>compress-lzf</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>

View File

@ -94,7 +94,7 @@
<property name="message" value="Avoid MoreExecutors.directExecutor() in favor of ImmediateExecutor.INSTANCE" />
</module>
<module name="IllegalImport">
<property name="illegalPkgs" value="junit.framework"/>
<property name="illegalPkgs" value="junit.framework,org.jboss.byteman"/>
<property name="illegalClasses" value="java.io.File,java.io.FileInputStream,java.io.FileOutputStream,java.io.FileReader,java.io.FileWriter,java.io.RandomAccessFile,java.util.concurrent.Semaphore,java.util.concurrent.CountDownLatch,java.util.concurrent.Executors,java.util.concurrent.LinkedBlockingQueue,java.util.concurrent.SynchronousQueue,java.util.concurrent.ArrayBlockingQueue,com.google.common.util.concurrent.Futures,java.util.concurrent.CompletableFuture,io.netty.util.concurrent.Future,io.netty.util.concurrent.Promise,io.netty.util.concurrent.AbstractFuture,com.google.common.util.concurrent.ListenableFutureTask,com.google.common.util.concurrent.ListenableFuture,com.google.common.util.concurrent.AbstractFuture,java.nio.file.Paths"/>
</module>
<module name="IllegalInstantiation">

View File

@ -298,12 +298,6 @@
<artifactId>lz4-java</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>com.ning</groupId>
<artifactId>compress-lzf</artifactId>
<version>0.8.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
@ -618,6 +612,8 @@
</exclusion>
</exclusions>
</dependency>
<!-- these dependencies have to be of provided scope as they are used by cassandra-dtests and ccm is looking
for these libraries in build/lib/jars -->
<dependency>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-install</artifactId>
@ -646,11 +642,13 @@
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${bytebuddy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${bytebuddy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>

View File

@ -70,8 +70,6 @@ public class CassandraStreamWriter
/**
* Stream file of specified sections to given channel.
*
* CassandraStreamWriter uses LZF compression on wire to decrease size to transfer.
*
* @param out where this writes data to
* @throws IOException on any I/O error
*/

View File

@ -1,58 +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.utils;
import java.util.concurrent.atomic.AtomicReference;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.util.concurrent.RateLimiter;
import org.jboss.byteman.rule.Rule;
import org.jboss.byteman.rule.helper.Helper;
/**
* Helper class to apply rate limiting during fault injection testing;
* for an example script, see test/resources/byteman/mutation_limiter.btm.
*/
@VisibleForTesting
public class TestRateLimiter extends Helper
{
private static final AtomicReference<RateLimiter> ref = new AtomicReference<>();
protected TestRateLimiter(Rule rule)
{
super(rule);
}
/**
* Acquires a single unit at the given rate. If the rate changes between calls, a new rate limiter is created
* and the old one is discarded.
*/
public void acquire(double rate)
{
RateLimiter limiter = ref.get();
if (limiter == null || limiter.getRate() != rate)
{
ref.compareAndSet(limiter, RateLimiter.create(rate));
limiter = ref.get();
}
limiter.acquire(1);
}
}

View File

@ -1,26 +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.
#
RULE mutation_limiter
CLASS org.apache.cassandra.db.MutationVerbHandler
METHOD doVerb
HELPER org.apache.cassandra.utils.TestRateLimiter
AT ENTRY
IF TRUE
DO acquire(1000.0)
ENDRULE