mirror of https://github.com/apache/cassandra
Remove deprecated code in Cassandra 1.x and 2.x
patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-18959
This commit is contained in:
parent
256e39fc62
commit
4ecff92404
|
|
@ -1,4 +1,5 @@
|
|||
5.0-alpha2
|
||||
* Remove deprecated code in Cassandra 1.x and 2.x (CASSANDRA-18959)
|
||||
* ClientRequestSize metrics should not treat CONTAINS restrictions as being equality-based (CASSANDRA-18896)
|
||||
* Add support for vector search in SAI (CASSANDRA-18715)
|
||||
* Remove crc_check_chance from CompressionParams (CASSANDRA-18872)
|
||||
|
|
|
|||
1
NEWS.txt
1
NEWS.txt
|
|
@ -231,6 +231,7 @@ Upgrading
|
|||
|
||||
Deprecation
|
||||
-----------
|
||||
- Deprecated code in Cassandra 1.x and 2.x was removed. See CASSANDRA-18959 for more details.
|
||||
- In the JMX MBean `org.apache.cassandra.db:type=RepairService` (CASSANDRA-17668):
|
||||
- deprecate the getter/setter methods `getRepairSessionSpaceInMebibytes` and `setRepairSessionSpaceInMebibytes`
|
||||
in favor of `getRepairSessionSpaceInMiB` and `setRepairSessionSpaceInMiB` respectively
|
||||
|
|
|
|||
|
|
@ -31,13 +31,6 @@ import com.google.common.collect.Sets;
|
|||
*/
|
||||
public enum Permission
|
||||
{
|
||||
/** @deprecated See CASSANDRA-4874 */
|
||||
@Deprecated(since = "1.2.0")
|
||||
READ,
|
||||
/** @deprecated See CASSANDRA-4874 */
|
||||
@Deprecated(since = "1.2.0")
|
||||
WRITE,
|
||||
|
||||
// schema and role management
|
||||
// CREATE, ALTER and DROP permissions granted on an appropriate DataResource are required for
|
||||
// CREATE KEYSPACE and CREATE TABLE.
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ package org.apache.cassandra.auth;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cassandra.utils.Hex;
|
||||
|
||||
public final class Resources
|
||||
{
|
||||
/**
|
||||
|
|
@ -32,7 +30,7 @@ public final class Resources
|
|||
*/
|
||||
public static List<? extends IResource> chain(IResource resource)
|
||||
{
|
||||
List<IResource> chain = new ArrayList<IResource>();
|
||||
List<IResource> chain = new ArrayList<>();
|
||||
while (true)
|
||||
{
|
||||
chain.add(resource);
|
||||
|
|
@ -47,7 +45,7 @@ public final class Resources
|
|||
* Creates an IResource instance from its external name.
|
||||
* Resource implementation class is inferred by matching against the known IResource
|
||||
* impls' root level resources.
|
||||
* @param name
|
||||
* @param name external name to create IResource from
|
||||
* @return an IResource instance created from the name
|
||||
*/
|
||||
public static IResource fromName(String name)
|
||||
|
|
@ -63,27 +61,4 @@ public final class Resources
|
|||
else
|
||||
throw new IllegalArgumentException(String.format("Name %s is not valid for any resource type", name));
|
||||
}
|
||||
|
||||
/** @deprecated See CASSANDRA-4874 */
|
||||
@Deprecated(since = "1.2.0")
|
||||
public final static String ROOT = "cassandra";
|
||||
/** @deprecated See CASSANDRA-4874 */
|
||||
@Deprecated(since = "1.2.0")
|
||||
public final static String KEYSPACES = "keyspaces";
|
||||
|
||||
/** @deprecated See CASSANDRA-4874 */
|
||||
@Deprecated(since = "1.2.0")
|
||||
public static String toString(List<Object> resource)
|
||||
{
|
||||
StringBuilder buff = new StringBuilder();
|
||||
for (Object component : resource)
|
||||
{
|
||||
buff.append("/");
|
||||
if (component instanceof byte[])
|
||||
buff.append(Hex.bytesToHex((byte[])component));
|
||||
else
|
||||
buff.append(component);
|
||||
}
|
||||
return buff.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,10 +179,6 @@ public class Config
|
|||
public int concurrent_materialized_view_writes = 32;
|
||||
public int available_processors = -1;
|
||||
|
||||
/** @deprecated See CASSANDRA-6504 */
|
||||
@Deprecated(since = "2.1")
|
||||
public Integer concurrent_replicates = null;
|
||||
|
||||
public int memtable_flush_writers = 0;
|
||||
@Replaces(oldName = "memtable_heap_space_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE_INT, deprecated = true)
|
||||
public DataStorageSpec.IntMebibytesBound memtable_heap_space;
|
||||
|
|
@ -297,10 +293,6 @@ public class Config
|
|||
@Replaces(oldName = "native_transport_receive_queue_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
|
||||
public DataStorageSpec.IntBytesBound native_transport_receive_queue_capacity = new DataStorageSpec.IntBytesBound("1MiB");
|
||||
|
||||
/** @deprecated See CASSANDRA-5529 */
|
||||
@Deprecated(since = "1.2.6")
|
||||
public Integer native_transport_max_negotiable_protocol_version = null;
|
||||
|
||||
/**
|
||||
* Max size of values in SSTables, in MebiBytes.
|
||||
* Default is the same as the native protocol frame limit: 256MiB.
|
||||
|
|
@ -415,10 +407,6 @@ public class Config
|
|||
@Replaces(oldName = "cdc_free_space_check_interval_ms", converter = Converters.MILLIS_DURATION_INT, deprecated = true)
|
||||
public DurationSpec.IntMillisecondsBound cdc_free_space_check_interval = new DurationSpec.IntMillisecondsBound("250ms");
|
||||
|
||||
/** @deprecated See CASSANDRA-3578 */
|
||||
@Deprecated(since = "2.1.3")
|
||||
public int commitlog_periodic_queue_size = -1;
|
||||
|
||||
public String endpoint_snitch;
|
||||
public boolean dynamic_snitch = true;
|
||||
@Replaces(oldName = "dynamic_snitch_update_interval_in_ms", converter = Converters.MILLIS_DURATION_INT, deprecated = true)
|
||||
|
|
|
|||
|
|
@ -550,9 +550,6 @@ public class DatabaseDescriptor
|
|||
if (conf.concurrent_counter_writes < 2)
|
||||
throw new ConfigurationException("concurrent_counter_writes must be at least 2, but was " + conf.concurrent_counter_writes, false);
|
||||
|
||||
if (conf.concurrent_replicates != null)
|
||||
logger.warn("concurrent_replicates has been deprecated and should be removed from cassandra.yaml");
|
||||
|
||||
if (conf.networking_cache_size == null)
|
||||
conf.networking_cache_size = new DataStorageSpec.IntMebibytesBound(Math.min(128, (int) (Runtime.getRuntime().maxMemory() / (16 * 1048576))));
|
||||
|
||||
|
|
@ -613,10 +610,6 @@ public class DatabaseDescriptor
|
|||
checkValidForByteConversion(conf.column_index_cache_size, "column_index_cache_size");
|
||||
checkValidForByteConversion(conf.batch_size_warn_threshold, "batch_size_warn_threshold");
|
||||
|
||||
if (conf.native_transport_max_negotiable_protocol_version != null)
|
||||
logger.warn("The configuration option native_transport_max_negotiable_protocol_version has been deprecated " +
|
||||
"and should be removed from cassandra.yaml as it has no longer has any effect.");
|
||||
|
||||
// if data dirs, commitlog dir, or saved caches dir are set in cassandra.yaml, use that. Otherwise,
|
||||
// use -Dcassandra.storagedir (set in cassandra-env.sh) as the parent dir for data/, commitlog/, and saved_caches/
|
||||
if (conf.commitlog_directory == null)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import java.lang.reflect.InvocationTargetException;
|
|||
import java.lang.reflect.Method;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
|
|
@ -214,7 +215,7 @@ public abstract class AbstractReplicationStrategy
|
|||
|
||||
for (Token token : metadata.sortedTokens())
|
||||
{
|
||||
Range<Token> range = metadata.getPrimaryRangeFor(token);
|
||||
Range<Token> range = metadata.getPrimaryRangesFor(List.of(token)).iterator().next();
|
||||
for (Replica replica : calculateNaturalReplicas(token, metadata))
|
||||
{
|
||||
// LocalStrategy always returns (min, min] ranges for it's replicas, so we skip the check here
|
||||
|
|
@ -231,7 +232,7 @@ public abstract class AbstractReplicationStrategy
|
|||
RangesAtEndpoint.Builder builder = RangesAtEndpoint.builder(endpoint);
|
||||
for (Token token : metadata.sortedTokens())
|
||||
{
|
||||
Range<Token> range = metadata.getPrimaryRangeFor(token);
|
||||
Range<Token> range = metadata.getPrimaryRangesFor(List.of(token)).iterator().next();
|
||||
Replica replica = calculateNaturalReplicas(token, metadata)
|
||||
.byEndpoint().get(endpoint);
|
||||
if (replica != null)
|
||||
|
|
@ -251,7 +252,7 @@ public abstract class AbstractReplicationStrategy
|
|||
|
||||
for (Token token : metadata.sortedTokens())
|
||||
{
|
||||
Range<Token> range = metadata.getPrimaryRangeFor(token);
|
||||
Range<Token> range = metadata.getPrimaryRangesFor(List.of(token)).iterator().next();
|
||||
for (Replica replica : calculateNaturalReplicas(token, metadata))
|
||||
{
|
||||
// LocalStrategy always returns (min, min] ranges for it's replicas, so we skip the check here
|
||||
|
|
|
|||
|
|
@ -349,13 +349,6 @@ public class TokenMetadata
|
|||
}
|
||||
}
|
||||
|
||||
/** @deprecated See CASSANDRA-4121 */
|
||||
@Deprecated(since = "1.2.0")
|
||||
public void addBootstrapToken(Token token, InetAddressAndPort endpoint)
|
||||
{
|
||||
addBootstrapTokens(Collections.singleton(token), endpoint);
|
||||
}
|
||||
|
||||
public void addBootstrapTokens(Collection<Token> tokens, InetAddressAndPort endpoint)
|
||||
{
|
||||
addBootstrapTokens(tokens, endpoint, null);
|
||||
|
|
@ -612,13 +605,6 @@ public class TokenMetadata
|
|||
}
|
||||
}
|
||||
|
||||
/** @deprecated See CASSANDRA-4121 */
|
||||
@Deprecated(since = "1.2.0")
|
||||
public Token getToken(InetAddressAndPort endpoint)
|
||||
{
|
||||
return getTokens(endpoint).iterator().next();
|
||||
}
|
||||
|
||||
public boolean isMember(InetAddressAndPort endpoint)
|
||||
{
|
||||
assert endpoint != null;
|
||||
|
|
@ -794,13 +780,6 @@ public class TokenMetadata
|
|||
return ranges;
|
||||
}
|
||||
|
||||
/** @deprecated See CASSANDRA-4121 */
|
||||
@Deprecated(since = "1.2.0")
|
||||
public Range<Token> getPrimaryRangeFor(Token right)
|
||||
{
|
||||
return getPrimaryRangesFor(Arrays.asList(right)).iterator().next();
|
||||
}
|
||||
|
||||
public ArrayList<Token> sortedTokens()
|
||||
{
|
||||
return sortedTokens;
|
||||
|
|
|
|||
|
|
@ -5520,7 +5520,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
|
|||
}
|
||||
|
||||
return String.format("Removing token (%s). Waiting for replication confirmation from [%s].",
|
||||
tokenMetadata.getToken(removingNode),
|
||||
tokenMetadata.getTokens(removingNode).iterator().next(),
|
||||
StringUtils.join(toFormat, ","));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -210,13 +210,6 @@ public interface StorageServiceMBean extends NotificationEmitter
|
|||
/** Retrieve this hosts unique ID */
|
||||
public String getLocalHostId();
|
||||
|
||||
/**
|
||||
* {@link StorageServiceMBean#getEndpointToHostId}
|
||||
* @deprecated See CASSANDRA-10382
|
||||
*/
|
||||
@Deprecated(since = "2.1.10")
|
||||
public Map<String, String> getHostIdMap();
|
||||
|
||||
/**
|
||||
* Retrieve the mapping of endpoint to host ID.
|
||||
* @deprecated See CASSANDRA-7544
|
||||
|
|
@ -411,15 +404,8 @@ public interface StorageServiceMBean extends NotificationEmitter
|
|||
* If tableNames array is empty, all CFs are scrubbed.
|
||||
*
|
||||
* Scrubbed CFs will be snapshotted first, if disableSnapshot is false
|
||||
* @deprecated See CASSANDRA-9406
|
||||
* @deprecated See CASSANDRA-11179
|
||||
*/
|
||||
@Deprecated(since = "2.2.0")
|
||||
default int scrub(boolean disableSnapshot, boolean skipCorrupted, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException
|
||||
{
|
||||
return scrub(disableSnapshot, skipCorrupted, true, keyspaceName, tableNames);
|
||||
}
|
||||
|
||||
/** @deprecated See CASSANDRA-11179 */
|
||||
@Deprecated(since = "3.5")
|
||||
default int scrub(boolean disableSnapshot, boolean skipCorrupted, boolean checkData, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException
|
||||
{
|
||||
|
|
|
|||
|
|
@ -302,7 +302,8 @@ public class JMXTool
|
|||
DiffResult<Operation> operations = diff(leftInfo.operationSet(), rightInfo.operationSet(), operation -> {
|
||||
for (CliPattern p : excludeOperations)
|
||||
{
|
||||
if (p.pattern.matcher(operation.name).matches())
|
||||
if (p.pattern.matcher(operation.name).matches() ||
|
||||
p.pattern.matcher(operation.toString().replaceAll(" +", "")).matches())
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -96,8 +96,6 @@ public class NodeTool
|
|||
List<Class<? extends NodeToolCmdRunnable>> commands = newArrayList(
|
||||
Assassinate.class,
|
||||
CassHelp.class,
|
||||
CfHistograms.class,
|
||||
CfStats.class,
|
||||
CIDRFilteringStats.class,
|
||||
Cleanup.class,
|
||||
ClearSnapshot.class,
|
||||
|
|
|
|||
|
|
@ -1,29 +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.tools.nodetool;
|
||||
|
||||
import io.airlift.airline.Command;
|
||||
|
||||
/**
|
||||
* @deprecated use TableHistograms
|
||||
*/
|
||||
@Command(name = "cfhistograms", hidden = true, description = "Print statistic histograms for a given column family")
|
||||
@Deprecated(since = "2.2.0")
|
||||
public class CfHistograms extends TableHistograms
|
||||
{
|
||||
}
|
||||
|
|
@ -1,29 +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.tools.nodetool;
|
||||
|
||||
import io.airlift.airline.Command;
|
||||
|
||||
/**
|
||||
* @deprecated use TableStats
|
||||
*/
|
||||
@Command(name = "cfstats", hidden = true, description = "Print statistics on tables")
|
||||
@Deprecated(since = "2.2.0")
|
||||
public class CfStats extends TableStats
|
||||
{
|
||||
}
|
||||
|
|
@ -206,7 +206,6 @@ zero_ttl_on_twcs_enabled: "java.lang.Boolean"
|
|||
cdc_free_space_check_interval: "org.apache.cassandra.config.DurationSpec.IntMillisecondsBound"
|
||||
roles_cache_max_entries: "java.lang.Integer"
|
||||
allow_filtering_enabled: "java.lang.Boolean"
|
||||
native_transport_max_negotiable_protocol_version: "java.lang.Integer"
|
||||
columns_per_table_fail_threshold: "java.lang.Integer"
|
||||
start_native_transport: "java.lang.Boolean"
|
||||
ssl_storage_port: "java.lang.Integer"
|
||||
|
|
@ -344,7 +343,6 @@ authenticator:
|
|||
internode_socket_receive_buffer_size: "org.apache.cassandra.config.DataStorageSpec.IntBytesBound"
|
||||
allow_insecure_udfs: "java.lang.Boolean"
|
||||
internode_application_receive_queue_capacity: "org.apache.cassandra.config.DataStorageSpec.IntBytesBound"
|
||||
concurrent_replicates: "java.lang.Integer"
|
||||
user_defined_functions_enabled: "java.lang.Boolean"
|
||||
user_defined_functions_threads_enabled: "java.lang.Boolean"
|
||||
streaming_slow_events_log_timeout: "org.apache.cassandra.config.DurationSpec.IntSecondsBound"
|
||||
|
|
@ -441,7 +439,6 @@ hints_compression:
|
|||
class_name: "java.lang.String"
|
||||
parameters: "java.util.Map"
|
||||
native_transport_max_auth_threads: "java.lang.Integer"
|
||||
commitlog_periodic_queue_size: "java.lang.Integer"
|
||||
force_new_prepared_statement_behaviour: "java.lang.Boolean"
|
||||
back_pressure_enabled: "java.lang.Boolean"
|
||||
materialized_views_per_table_warn_threshold: "java.lang.Integer"
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ package org.apache.cassandra.simulator.cluster;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cassandra.db.Keyspace;
|
||||
|
|
@ -87,7 +88,7 @@ class OnInstanceRepair extends ClusterAction
|
|||
Keyspace keyspace = Keyspace.open(keyspaceName);
|
||||
TokenMetadata metadata = StorageService.instance.getTokenMetadata().cloneOnlyTokenMap();
|
||||
invokeRepair(keyspaceName, repairPaxos, repairOnlyPaxos,
|
||||
() -> primaryRangeOnly ? Collections.singletonList(metadata.getPrimaryRangeFor(currentToken()))
|
||||
() -> primaryRangeOnly ? Collections.singletonList(metadata.getPrimaryRangesFor(List.of(currentToken())).iterator().next())
|
||||
: keyspace.getReplicationStrategy().getAddressReplicas(metadata).get(getBroadcastAddressAndPort()).asList(Replica::range),
|
||||
primaryRangeOnly, force, listener);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ public class ConfigCompatibilityTest
|
|||
|
||||
private static final Set<String> REMOVED_IN_50 = ImmutableSet.<String>builder()
|
||||
.add("commitlog_sync_batch_window_in_ms")
|
||||
.add("native_transport_max_negotiable_protocol_version")
|
||||
.add("concurrent_replicates")
|
||||
.add("commitlog_periodic_queue_size")
|
||||
.build();
|
||||
|
||||
private static final Set<String> ALLOW_LIST = Sets.union(REMOVED_IN_40, REMOVED_IN_50);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.apache.cassandra.locator;
|
|||
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
|
@ -211,7 +212,7 @@ public class SimpleStrategyTest
|
|||
// bootstrap at the end of the ring
|
||||
Token bsToken = new BigIntegerToken(String.valueOf(210));
|
||||
InetAddressAndPort bootstrapEndpoint = InetAddressAndPort.getByName("127.0.0.11");
|
||||
tmd.addBootstrapToken(bsToken, bootstrapEndpoint);
|
||||
tmd.addBootstrapTokens(Collections.singleton(bsToken), bootstrapEndpoint);
|
||||
|
||||
AbstractReplicationStrategy strategy = null;
|
||||
for (String keyspaceName : Schema.instance.distributedKeyspaces().names())
|
||||
|
|
|
|||
|
|
@ -529,10 +529,10 @@ public class LeaveAndBootstrapTest
|
|||
|
||||
assertTrue(tmd.isMember(hosts.get(2)));
|
||||
assertFalse(tmd.isLeaving(hosts.get(2)));
|
||||
assertEquals(keyTokens.get(3), tmd.getToken(hosts.get(2)));
|
||||
assertEquals(keyTokens.get(3), tmd.getTokens(hosts.get(2)).iterator().next());
|
||||
assertTrue(tmd.isMember(hosts.get(3)));
|
||||
assertFalse(tmd.isLeaving(hosts.get(3)));
|
||||
assertEquals(keyTokens.get(2), tmd.getToken(hosts.get(3)));
|
||||
assertEquals(keyTokens.get(2), tmd.getTokens(hosts.get(3)).iterator().next());
|
||||
|
||||
assertTrue(tmd.getBootstrapTokens().isEmpty());
|
||||
}
|
||||
|
|
@ -559,14 +559,14 @@ public class LeaveAndBootstrapTest
|
|||
ss.onChange(hosts.get(2), ApplicationState.STATUS, valueFactory.leaving(Collections.singleton(endpointTokens.get(2))));
|
||||
|
||||
assertTrue(tmd.isLeaving(hosts.get(2)));
|
||||
assertEquals(endpointTokens.get(2), tmd.getToken(hosts.get(2)));
|
||||
assertEquals(endpointTokens.get(2), tmd.getTokens(hosts.get(2)).iterator().next());
|
||||
|
||||
// back to normal
|
||||
Gossiper.instance.injectApplicationState(hosts.get(2), ApplicationState.TOKENS, valueFactory.tokens(Collections.singleton(keyTokens.get(2))));
|
||||
ss.onChange(hosts.get(2), ApplicationState.STATUS, valueFactory.normal(Collections.singleton(keyTokens.get(2))));
|
||||
|
||||
assertTrue(tmd.getSizeOfLeavingEndpoints() == 0);
|
||||
assertEquals(keyTokens.get(2), tmd.getToken(hosts.get(2)));
|
||||
assertEquals(keyTokens.get(2), tmd.getTokens(hosts.get(2)).iterator().next());
|
||||
|
||||
// node 3 goes through leave and left and then jumps to normal at its new token
|
||||
ss.onChange(hosts.get(2), ApplicationState.STATUS, valueFactory.leaving(Collections.singleton(keyTokens.get(2))));
|
||||
|
|
@ -577,7 +577,7 @@ public class LeaveAndBootstrapTest
|
|||
|
||||
assertTrue(tmd.getBootstrapTokens().isEmpty());
|
||||
assertTrue(tmd.getSizeOfLeavingEndpoints() == 0);
|
||||
assertEquals(keyTokens.get(4), tmd.getToken(hosts.get(2)));
|
||||
assertEquals(keyTokens.get(4), tmd.getTokens(hosts.get(2)).iterator().next());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -602,7 +602,7 @@ public class LeaveAndBootstrapTest
|
|||
Gossiper.instance.injectApplicationState(hosts.get(2), ApplicationState.TOKENS, valueFactory.tokens(Collections.singleton(keyTokens.get(0))));
|
||||
ss.onChange(hosts.get(2), ApplicationState.STATUS, valueFactory.leaving(Collections.singleton(keyTokens.get(0))));
|
||||
|
||||
assertEquals(keyTokens.get(0), tmd.getToken(hosts.get(2)));
|
||||
assertEquals(keyTokens.get(0), tmd.getTokens(hosts.get(2)).iterator().next());
|
||||
assertTrue(tmd.isLeaving(hosts.get(2)));
|
||||
assertNull(tmd.getEndpoint(endpointTokens.get(2)));
|
||||
|
||||
|
|
|
|||
|
|
@ -967,14 +967,14 @@ public class MoveTest
|
|||
ss.onChange(hosts.get(2), ApplicationState.STATUS, valueFactory.moving(newToken));
|
||||
|
||||
assertTrue(tmd.isMoving(hosts.get(2)));
|
||||
assertEquals(endpointTokens.get(2), tmd.getToken(hosts.get(2)));
|
||||
assertEquals(endpointTokens.get(2), tmd.getTokens(hosts.get(2)).iterator().next());
|
||||
|
||||
// back to normal
|
||||
Gossiper.instance.injectApplicationState(hosts.get(2), ApplicationState.TOKENS, valueFactory.tokens(Collections.singleton(newToken)));
|
||||
ss.onChange(hosts.get(2), ApplicationState.STATUS, valueFactory.normal(Collections.singleton(newToken)));
|
||||
|
||||
assertTrue(tmd.getSizeOfMovingEndpoints() == 0);
|
||||
assertEquals(newToken, tmd.getToken(hosts.get(2)));
|
||||
assertEquals(newToken, tmd.getTokens(hosts.get(2)).iterator().next());
|
||||
|
||||
newToken = positionToken(8);
|
||||
// node 2 goes through leave and left and then jumps to normal at its new token
|
||||
|
|
@ -984,7 +984,7 @@ public class MoveTest
|
|||
|
||||
assertTrue(tmd.getBootstrapTokens().isEmpty());
|
||||
assertTrue(tmd.getSizeOfMovingEndpoints() == 0);
|
||||
assertEquals(newToken, tmd.getToken(hosts.get(2)));
|
||||
assertEquals(newToken, tmd.getTokens(hosts.get(2)).iterator().next());
|
||||
}
|
||||
|
||||
private static Collection<InetAddressAndPort> makeAddrs(String... hosts) throws UnknownHostException
|
||||
|
|
|
|||
|
|
@ -89,13 +89,13 @@ public class JMXCompatabilityTest extends CQLTester
|
|||
GCInspector.register();
|
||||
CassandraDaemon.registerNativeAccess();
|
||||
|
||||
String name = KEYSPACE + "." + createTable("CREATE TABLE %s (pk int PRIMARY KEY)");
|
||||
String name = KEYSPACE + '.' + createTable("CREATE TABLE %s (pk int PRIMARY KEY)");
|
||||
|
||||
// use net to register everything like storage proxy
|
||||
executeNet(ProtocolVersion.CURRENT, new SimpleStatement("INSERT INTO " + name + " (pk) VALUES (?)", 42));
|
||||
executeNet(ProtocolVersion.CURRENT, new SimpleStatement("SELECT * FROM " + name + " WHERE pk=?", 42));
|
||||
|
||||
String script = "tools/bin/jmxtool dump -f yaml --url service:jmx:rmi:///jndi/rmi://" + jmxHost + ":" + jmxPort + "/jmxrmi > " + TMP.getRoot().getAbsolutePath() + "/out.yaml";
|
||||
String script = "tools/bin/jmxtool dump -f yaml --url service:jmx:rmi:///jndi/rmi://" + jmxHost + ':' + jmxPort + "/jmxrmi > " + TMP.getRoot().getAbsolutePath() + "/out.yaml";
|
||||
ToolRunner.invoke(ENV, "bash", "-c", script).assertOnCleanExit();
|
||||
CREATED_TABLE = true;
|
||||
}
|
||||
|
|
@ -119,14 +119,16 @@ public class JMXCompatabilityTest extends CQLTester
|
|||
".*keyspace=system,(scope|table|columnfamily)=hints.*",
|
||||
".*keyspace=system,(scope|table|columnfamily)=batchlog.*");
|
||||
List<String> excludeAttributes = newArrayList("RPCServerRunning", // removed in CASSANDRA-11115
|
||||
"MaxNativeProtocolVersion");
|
||||
"MaxNativeProtocolVersion",
|
||||
"HostIdMap"); // removed in CASSANDRA-18959
|
||||
List<String> excludeOperations = newArrayList("startRPCServer", "stopRPCServer", // removed in CASSANDRA-11115
|
||||
// nodetool apis that were changed,
|
||||
"decommission", // -> decommission(boolean)
|
||||
"forceRepairAsync", // -> repairAsync
|
||||
"forceRepairRangeAsync", // -> repairAsync
|
||||
"beginLocalSampling", // -> beginLocalSampling(p1: java.lang.String, p2: int, p3: int): void
|
||||
"finishLocalSampling" // -> finishLocalSampling(p1: java.lang.String, p2: int): java.util.List
|
||||
"finishLocalSampling", // -> finishLocalSampling(p1: java.lang.String, p2: int): java.util.List
|
||||
"scrub\\(p1:boolean,p2:boolean,p3:java.lang.String,p4:java.lang.String\\[\\]\\):int" // removed in CASSANDRA-18959
|
||||
);
|
||||
|
||||
if (BtiFormat.isSelected())
|
||||
|
|
@ -157,14 +159,16 @@ public class JMXCompatabilityTest extends CQLTester
|
|||
);
|
||||
List<String> excludeAttributes = newArrayList("RPCServerRunning", // removed in CASSANDRA-11115
|
||||
"MaxNativeProtocolVersion",
|
||||
"StreamingSocketTimeout");
|
||||
"StreamingSocketTimeout",
|
||||
"HostIdMap"); // removed in CASSANDRA-18959;
|
||||
List<String> excludeOperations = newArrayList("startRPCServer", "stopRPCServer", // removed in CASSANDRA-11115
|
||||
// nodetool apis that were changed,
|
||||
"decommission", // -> decommission(boolean)
|
||||
"forceRepairAsync", // -> repairAsync
|
||||
"forceRepairRangeAsync", // -> repairAsync
|
||||
"beginLocalSampling", // -> beginLocalSampling(p1: java.lang.String, p2: int, p3: int): void
|
||||
"finishLocalSampling" // -> finishLocalSampling(p1: java.lang.String, p2: int): java.util.List
|
||||
"finishLocalSampling", // -> finishLocalSampling(p1: java.lang.String, p2: int): java.util.List
|
||||
"scrub\\(p1:boolean,p2:boolean,p3:java.lang.String,p4:java.lang.String\\[\\]\\):int" // removed in CASSANDRA-18959
|
||||
);
|
||||
|
||||
if (BtiFormat.isSelected())
|
||||
|
|
@ -181,8 +185,8 @@ public class JMXCompatabilityTest extends CQLTester
|
|||
{
|
||||
List<String> excludeObjects = newArrayList("org.apache.cassandra.metrics:type=BufferPool,name=(Misses|Size)" // removed in CASSANDRA-18313
|
||||
);
|
||||
List<String> excludeAttributes = newArrayList();
|
||||
List<String> excludeOperations = newArrayList();
|
||||
List<String> excludeAttributes = newArrayList("HostIdMap"); // removed in CASSANDRA-18959
|
||||
List<String> excludeOperations = newArrayList("scrub\\(p1:boolean,p2:boolean,p3:java.lang.String,p4:java.lang.String\\[\\]\\):int"); // removed in CASSANDRA-18959
|
||||
|
||||
if (BtiFormat.isSelected())
|
||||
{
|
||||
|
|
@ -198,8 +202,8 @@ public class JMXCompatabilityTest extends CQLTester
|
|||
{
|
||||
List<String> excludeObjects = newArrayList("org.apache.cassandra.metrics:type=BufferPool,name=(Misses|Size)" // removed in CASSANDRA-18313
|
||||
);
|
||||
List<String> excludeAttributes = newArrayList();
|
||||
List<String> excludeOperations = newArrayList();
|
||||
List<String> excludeAttributes = newArrayList("HostIdMap"); // removed in CASSANDRA-18959
|
||||
List<String> excludeOperations = newArrayList("scrub\\(p1:boolean,p2:boolean,p3:java.lang.String,p4:java.lang.String\\[\\]\\):int"); // removed in CASSANDRA-18959
|
||||
|
||||
if (BtiFormat.isSelected())
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue