Skip to content

Commit de9925f

Browse files
maedhrozdcapwell
authored andcommitted
fixing post-rebase checkstyle problems
1 parent 297a424 commit de9925f

File tree

12 files changed

+23
-16
lines changed

12 files changed

+23
-16
lines changed

src/java/org/apache/cassandra/journal/Flusher.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import static org.apache.cassandra.concurrent.Interruptible.State.NORMAL;
4646
import static org.apache.cassandra.concurrent.Interruptible.State.SHUTTING_DOWN;
4747
import static org.apache.cassandra.journal.Params.FlushMode.PERIODIC;
48+
import static org.apache.cassandra.utils.LocalizeString.toLowerCaseLocalized;
4849
import static org.apache.cassandra.utils.MonotonicClock.Global.preciseTime;
4950
import static org.apache.cassandra.utils.Simulate.With.GLOBAL_CLOCK;
5051
import static org.apache.cassandra.utils.Simulate.With.LOCK_SUPPORT;
@@ -94,7 +95,7 @@ final class Flusher<K, V>
9495

9596
void start()
9697
{
97-
String flushExecutorName = journal.name + "-disk-flusher-" + params.flushMode().toString().toLowerCase();
98+
String flushExecutorName = journal.name + "-disk-flusher-" + toLowerCaseLocalized(params.flushMode().toString());
9899
flushStartedAt = clock.now();
99100
flushExecutor = executorFactory().infiniteLoop(flushExecutorName, new FlushRunnable(), SAFE, NON_DAEMON, SYNCHRONIZED);
100101
}

src/java/org/apache/cassandra/schema/DistributedSchema.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public TableMetadata getTableMetadata(TableId id)
142142

143143
public TableMetadata getTableMetadata(String keyspace, String cf)
144144
{
145-
var ks = keyspaces.getNullable(keyspace);
145+
KeyspaceMetadata ks = keyspaces.getNullable(keyspace);
146146
return ks == null ? null : ks.tables.getNullable(cf);
147147
}
148148

src/java/org/apache/cassandra/schema/KeyspaceMetadata.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import static com.google.common.collect.Iterables.any;
5454
import static java.lang.String.format;
5555
import static org.apache.cassandra.db.TypeSizes.sizeof;
56+
import static org.apache.cassandra.utils.LocalizeString.toLowerCaseLocalized;
5657

5758
/**
5859
* An immutable representation of keyspace metadata (name, params, tables, types, and functions).
@@ -369,7 +370,7 @@ public String toCqlString(boolean withWarnings, boolean withInternals, boolean i
369370
if (params.fastPath != null)
370371
{
371372
builder.append(" AND fast_path = '")
372-
.append(params.fastPath.toString().toLowerCase())
373+
.append(toLowerCaseLocalized(params.fastPath.toString()))
373374
.append("'");
374375
}
375376

src/java/org/apache/cassandra/service/accord/fastpath/FastPathStrategy.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
import org.apache.cassandra.tcm.serialization.MetadataSerializer;
3737
import org.apache.cassandra.tcm.serialization.Version;
3838

39+
import static org.apache.cassandra.utils.LocalizeString.toLowerCaseLocalized;
40+
import static org.apache.cassandra.utils.LocalizeString.toUpperCaseLocalized;
41+
3942
public interface FastPathStrategy
4043
{
4144
enum Kind
@@ -66,7 +69,7 @@ public static Kind fromByte(byte i)
6669
@Nullable
6770
public static Kind fromString(String s)
6871
{
69-
return LOOKUP.get(s.toUpperCase());
72+
return LOOKUP.get(toUpperCaseLocalized(s));
7073
}
7174

7275
@Nullable
@@ -118,7 +121,7 @@ static FastPathStrategy fromMap(Map<String, String> map)
118121

119122
static FastPathStrategy tableStrategyFromString(String s)
120123
{
121-
s = s.toLowerCase().trim();
124+
s = toLowerCaseLocalized(s).trim();
122125
if (s.equals("keyspace"))
123126
return InheritKeyspaceFastPathStrategy.instance;
124127
if (s.equals("simple"))
@@ -129,7 +132,7 @@ static FastPathStrategy tableStrategyFromString(String s)
129132

130133
static FastPathStrategy keyspaceStrategyFromString(String s)
131134
{
132-
s = s.toLowerCase().trim();
135+
s = toLowerCaseLocalized(s).trim();
133136
if (s.equals("simple"))
134137
return SimpleFastPathStrategy.instance;
135138

src/java/org/apache/cassandra/service/consensus/TransactionalMode.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.apache.cassandra.tcm.ClusterMetadata;
3030

3131
import static com.google.common.base.Preconditions.checkState;
32+
import static org.apache.cassandra.utils.LocalizeString.toLowerCaseLocalized;
3233

3334
/*
3435
* Configure the transactional behavior of a table. Enables accord on a table and defines how it mixes with non-serial writes
@@ -126,7 +127,7 @@ public enum TransactionalMode
126127
this.nonSerialWritesThroughAccord = nonSerialWritesThroughAccord;
127128
this.nonSerialReadsThroughAccord = nonSerialReadsThroughAccord;
128129
this.blockingReadRepairThroughAccord = blockingReadRepairThroughAccord;
129-
this.cqlParam = String.format("transactional_mode = '%s'", this.name().toLowerCase());
130+
this.cqlParam = String.format("transactional_mode = '%s'", toLowerCaseLocalized(this.name()));
130131
checkState(this.name().startsWith("test_") || (nonSerialReadsThroughAccord && nonSerialWritesThroughAccord) || !nonSerialReadsThroughAccord, "Doesn't make sense to do non-SERIAL reads through Accord without also doing non-SERIAL writes through Accord");
131132
}
132133

@@ -229,7 +230,7 @@ public static TransactionalMode fromOrdinal(int ordinal)
229230

230231
public static TransactionalMode fromString(String name)
231232
{
232-
return valueOf(name.toLowerCase());
233+
return valueOf(toLowerCaseLocalized(name));
233234
}
234235

235236
public boolean isTestMode()

src/java/org/apache/cassandra/service/consensus/migration/ConsensusMigrationTarget.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
import org.apache.cassandra.service.consensus.TransactionalMode;
2424

25+
import static org.apache.cassandra.utils.LocalizeString.toLowerCaseLocalized;
26+
2527
public enum ConsensusMigrationTarget
2628
{
2729
paxos(0),
@@ -41,7 +43,7 @@ public boolean isMigratedBy(ConsensusMigrationRepairType repairType)
4143

4244
public static ConsensusMigrationTarget fromString(String targetProtocol)
4345
{
44-
return ConsensusMigrationTarget.valueOf(targetProtocol.toLowerCase());
46+
return ConsensusMigrationTarget.valueOf(toLowerCaseLocalized(targetProtocol));
4547
}
4648

4749
public static ConsensusMigrationTarget fromValue(byte value)

src/java/org/apache/cassandra/service/consensus/migration/TransactionalMigrationFromMode.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
import org.apache.cassandra.service.consensus.TransactionalMode;
2222

23+
import static org.apache.cassandra.utils.LocalizeString.toLowerCaseLocalized;
24+
2325
/**
2426
* This tracks the state of a migration either from Paxos -> Accord, Accord [interop mode a] -> Accord [interop mode b] or Accord -> Paxos.
2527
* The `TransactionalMode` associated with each transition from a system is how interoperability should be achieved during the migration with various performance/safety tradeoffs.
@@ -65,7 +67,7 @@ public static TransactionalMigrationFromMode fromOrdinal(int ordinal)
6567

6668
public static TransactionalMigrationFromMode fromString(String name)
6769
{
68-
return valueOf(name.toLowerCase());
70+
return valueOf(toLowerCaseLocalized(name));
6971
}
7072

7173
public boolean migratingFromAccord()
@@ -95,6 +97,6 @@ public boolean isMigrating()
9597

9698
public String asCqlParam()
9799
{
98-
return String.format("transactional_migration_from = '%s'", this.name().toLowerCase());
100+
return String.format("transactional_migration_from = '%s'", toLowerCaseLocalized(this.name()));
99101
}
100102
}

src/java/org/apache/cassandra/tcm/Processor.java

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import com.codahale.metrics.Meter;
2727

2828
import accord.utils.Invariants;
29-
import com.codahale.metrics.Meter;
3029
import org.apache.cassandra.metrics.TCMMetrics;
3130
import org.apache.cassandra.service.WaitStrategy;
3231
import org.apache.cassandra.tcm.log.Entry;

src/java/org/apache/cassandra/utils/PojoToString.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import static com.google.common.base.Preconditions.checkArgument;
3535
import static org.apache.cassandra.utils.JsonUtils.JSON_OBJECT_MAPPER;
36+
import static org.apache.cassandra.utils.LocalizeString.toUpperCaseLocalized;
3637

3738
/**
3839
* Helper to format POJOs that are easy to convert (primitives, nonnull, and built in collections)
@@ -70,7 +71,7 @@ public boolean isYaml()
7071

7172
public static Format fromString(String formatString)
7273
{
73-
formatString = formatString.toUpperCase();
74+
formatString = toUpperCaseLocalized(formatString);
7475
switch (formatString)
7576
{
7677
case "YAML":

test/distributed/org/apache/cassandra/service/accord/AccordJournalCompactionTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import org.apache.cassandra.journal.TestParams;
4949
import org.apache.cassandra.schema.SchemaConstants;
5050
import org.apache.cassandra.service.StorageService;
51-
import org.apache.cassandra.service.accord.api.AccordAgent;
5251
import org.apache.cassandra.utils.AccordGenerators;
5352

5453
import static accord.api.Journal.FieldUpdates;

test/unit/org/apache/cassandra/locator/AssureSufficientLiveNodesTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import org.apache.cassandra.CassandraTestBase.PrepareServerNoRegister;
4242
import org.apache.cassandra.CassandraTestBase.UseMurmur3Partitioner;
4343
import org.apache.cassandra.SchemaLoader;
44-
import org.apache.cassandra.config.DatabaseDescriptor;
4544
import org.apache.cassandra.db.Keyspace;
4645
import org.apache.cassandra.dht.Murmur3Partitioner;
4746
import org.apache.cassandra.dht.Token;

test/unit/org/apache/cassandra/service/accord/AccordConfigurationServiceTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import org.apache.cassandra.schema.TableId;
6363
import org.apache.cassandra.schema.TableMetadata;
6464
import org.apache.cassandra.schema.Tables;
65-
import org.apache.cassandra.service.accord.api.AccordAgent;
6665
import org.apache.cassandra.service.accord.journal.AccordTopologyUpdate;
6766
import org.apache.cassandra.tcm.ClusterMetadata;
6867
import org.apache.cassandra.tcm.ValidatingClusterMetadataService;

0 commit comments

Comments
 (0)