mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-4.0' into trunk
This commit is contained in:
commit
7bd2764962
|
|
@ -75,6 +75,7 @@
|
|||
* Update JNA library to 5.9.0 and snappy-java to version 1.1.8.4 (CASSANDRA-17040)
|
||||
|
||||
Merged from 4.0:
|
||||
* Deduplicate warnings for deprecated parameters (changed names) (CASSANDRA-17160)
|
||||
* Update ant-junit to version 1.10.12 (CASSANDRA-17218)
|
||||
* Add droppable tombstone metrics to nodetool tablestats (CASSANDRA-16308)
|
||||
* Fix disk failure triggered when enabling FQL on an unclean directory (CASSANDRA-17136)
|
||||
|
|
|
|||
|
|
@ -219,6 +219,8 @@ public class YamlConfigurationLoader implements ConfigurationLoader
|
|||
|
||||
private final Set<String> nullProperties = new HashSet<>();
|
||||
|
||||
private final Set<String> deprecationWarnings = new HashSet<>();
|
||||
|
||||
private final Map<Class<?>, Map<String, Replacement>> replacements;
|
||||
|
||||
public PropertiesChecker(Map<Class<?>, Map<String, Replacement>> replacements)
|
||||
|
|
@ -232,7 +234,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
|
|||
{
|
||||
final Property result;
|
||||
Map<String, Replacement> typeReplacements = replacements.getOrDefault(type, Collections.emptyMap());
|
||||
if(typeReplacements.containsKey(name))
|
||||
if (typeReplacements.containsKey(name))
|
||||
{
|
||||
Replacement replacement = typeReplacements.get(name);
|
||||
final Property newProperty = super.getProperty(type, replacement.newName);
|
||||
|
|
@ -269,17 +271,14 @@ public class YamlConfigurationLoader implements ConfigurationLoader
|
|||
}
|
||||
};
|
||||
|
||||
if(replacement.deprecated)
|
||||
{
|
||||
logger.warn("{} parameter has been deprecated. It has a new name; For more information, please refer to NEWS.txt", name);
|
||||
}
|
||||
if (replacement.deprecated)
|
||||
deprecationWarnings.add(replacement.oldName);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = super.getProperty(type, name);
|
||||
}
|
||||
|
||||
|
||||
if (result instanceof MissingProperty)
|
||||
{
|
||||
missingProperties.add(result.getName());
|
||||
|
|
@ -326,14 +325,13 @@ public class YamlConfigurationLoader implements ConfigurationLoader
|
|||
public void check() throws ConfigurationException
|
||||
{
|
||||
if (!nullProperties.isEmpty())
|
||||
{
|
||||
throw new ConfigurationException("Invalid yaml. Those properties " + nullProperties + " are not valid", false);
|
||||
}
|
||||
|
||||
if (!missingProperties.isEmpty())
|
||||
{
|
||||
throw new ConfigurationException("Invalid yaml. Please remove properties " + missingProperties + " from your cassandra.yaml", false);
|
||||
}
|
||||
|
||||
if (!deprecationWarnings.isEmpty())
|
||||
logger.warn("{} parameters have been deprecated. They have new names; For more information, please refer to NEWS.txt", deprecationWarnings);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue