Skip to content

Commit

Permalink
IGNITE-22178 Fixed codestyle (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-it authored May 8, 2024
1 parent d369228 commit 4c23d61
Show file tree
Hide file tree
Showing 120 changed files with 667 additions and 612 deletions.
4 changes: 3 additions & 1 deletion modules/aop-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<!--
POM file.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ public GridifyRangeArgument createTaskArgument(GridifyRangeArgument arg, Collect

assert paramCls != null;

Object paramValue = GridifyUtils.collectionToParameter(paramCls, input);
Object paramVal = GridifyUtils.collectionToParameter(paramCls, input);

if (paramValue == null)
if (paramVal == null)
throw new IgniteCheckedException("Failed to create task argument for type: " + paramCls.getName());

mtdArgs[arg.getParamIndex()] = paramValue;
mtdArgs[arg.getParamIndex()] = paramVal;

return res;
}
Expand Down Expand Up @@ -180,12 +180,12 @@ public GridifyArgument createJobArgument(GridifyRangeArgument arg, Collection<?>

assert paramCls != null;

Object paramValue = GridifyUtils.collectionToParameter(paramCls, input);
Object paramVal = GridifyUtils.collectionToParameter(paramCls, input);

if (paramValue == null)
if (paramVal == null)
throw new IgniteException("Failed to create job argument for type: " + paramCls.getName());

mtdArgs[arg.getParamIndex()] = paramValue;
mtdArgs[arg.getParamIndex()] = paramVal;

return res;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ private void checkDefaultException(DeploymentMode depMode) {

info("Start Gridify test with Default AOP Task and exception in Deployment Mode : " + depMode);

boolean isException = false;
boolean ex = false;

try {
startGrid();
Expand All @@ -455,7 +455,7 @@ private void checkDefaultException(DeploymentMode depMode) {
catch (ExternalGridifyException e) {
info("@Gridify method gridifyDefaultException(0) returns exception: " + e);

isException = true;
ex = true;
}
catch (Exception e) {
e.printStackTrace();
Expand All @@ -467,7 +467,7 @@ private void checkDefaultException(DeploymentMode depMode) {
stopGrid();
}

if (!isException)
if (!ex)
fail("@Gridify method gridifyDefaultException(0) does not return any exception.");
}

Expand Down
4 changes: 3 additions & 1 deletion modules/apache-license-gen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<!--
POM file.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
4 changes: 3 additions & 1 deletion modules/azure-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
limitations under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
4 changes: 3 additions & 1 deletion modules/camel-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<!--
POM file.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ public IgniteCamelStreamerTest() {
url = "http://localhost:" + port + "/ignite";
}

DefaultCamelContext context = new DefaultCamelContext();
DefaultCamelContext ctx = new DefaultCamelContext();
// create Camel streamer
dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME);
streamer = createCamelStreamer(dataStreamer);
streamer.setCamelContext(context);
producerTemplate = new DefaultProducerTemplate(context);
streamer.setCamelContext(ctx);
producerTemplate = new DefaultProducerTemplate(ctx);
producerTemplate.start();
}

Expand Down Expand Up @@ -207,11 +207,11 @@ public void testResponseProcessorIsCalled() throws Exception {
@Test
public void testUserSpecifiedCamelContext() throws Exception {

CamelContext context = streamer.getCamelContext();
CamelContext ctx = streamer.getCamelContext();

final AtomicInteger cnt = new AtomicInteger();
context.setTracing(true);
context.addLifecycleStrategy(new LifecycleStrategySupport() {
ctx.setTracing(true);
ctx.addLifecycleStrategy(new LifecycleStrategySupport() {
@Override public void onEndpointAdd(Endpoint endpoint) {
cnt.incrementAndGet();
}
Expand Down Expand Up @@ -240,11 +240,11 @@ public void testUserSpecifiedCamelContext() throws Exception {
@Test
public void testUserSpecifiedCamelContextWithPropertyPlaceholders() throws Exception {
// Create a CamelContext with a custom property placeholder.
CamelContext context = new DefaultCamelContext();
CamelContext ctx = new DefaultCamelContext();

PropertiesComponent pc = new PropertiesComponent("camel.test.properties");

context.setPropertiesComponent(pc);
ctx.setPropertiesComponent(pc);

// Replace the context path in the test URL with the property placeholder.
url = url.replaceAll("/ignite", "{{test.contextPath}}");
Expand All @@ -253,9 +253,9 @@ public void testUserSpecifiedCamelContextWithPropertyPlaceholders() throws Excep
streamer = createCamelStreamer(dataStreamer);

streamer.setSingleTupleExtractor(singleTupleExtractor());
streamer.setCamelContext(context);
streamer.setCamelContext(ctx);

producerTemplate = new DefaultProducerTemplate(context);
producerTemplate = new DefaultProducerTemplate(ctx);
producerTemplate.start();

// Subscribe to cache PUT events.
Expand Down Expand Up @@ -290,11 +290,11 @@ public void testInvalidEndpointUri() throws Exception {
fail("Streamer started; should have failed.");
}
catch (IgniteException ignored) {
CamelContext context = streamer.getCamelContext();
ServiceStatus status = context.getStatus();
CamelContext ctx = streamer.getCamelContext();
ServiceStatus status = ctx.getStatus();
assertEquals("streamer should be in a stopped state, instead is " + status, status, ServiceStatus.Stopped);
assertEquals("endpoint registry has > 0 elements, size: " + context.getEndpointRegistry().size(),
context.getEndpointRegistry().size(), 0);
assertEquals("endpoint registry has > 0 elements, size: " + ctx.getEndpointRegistry().size(),
ctx.getEndpointRegistry().size(), 0);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ public class CdcKafkaReplicationAppsTest extends CdcKafkaReplicationTest {
if (clientType == ClientType.THIN_CLIENT) {
cfg = "/replication/kafka-to-ignite-client.xml";

String addresses = Arrays.stream(hostAddresses(dest)).map(addr -> "<value>" + addr + "</value>")
String addrs = Arrays.stream(hostAddresses(dest)).map(addr -> "<value>" + addr + "</value>")
.collect(Collectors.joining());

params.put(HOST_ADDRESSES, addresses);
params.put(HOST_ADDRESSES, addrs);
}
else {
cfg = "/replication/kafka-to-ignite.xml";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ static EmbeddedKafkaCluster initKafka(EmbeddedKafkaCluster curKafka) throws Exce
EmbeddedKafkaCluster kafka = curKafka;

if (kafka == null) {
Properties brokerProperties = new Properties();
Properties props = new Properties();

brokerProperties.put("auto.create.topics.enable", "false");
props.put("auto.create.topics.enable", "false");

kafka = new EmbeddedKafkaCluster(1, brokerProperties);
kafka = new EmbeddedKafkaCluster(1, props);

kafka.start();
}
Expand Down
4 changes: 3 additions & 1 deletion modules/cloud-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
limitations under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public TcpDiscoveryCloudIpFinder() {
@Override public Collection<InetSocketAddress> getRegisteredAddresses() throws IgniteSpiException {
initComputeService();

Collection<InetSocketAddress> addresses = new LinkedList<>();
Collection<InetSocketAddress> addrs = new LinkedList<>();

try {
Set<NodeMetadata> nodes;
Expand All @@ -201,17 +201,17 @@ public TcpDiscoveryCloudIpFinder() {
continue;

for (String addr : metadata.getPrivateAddresses())
addresses.add(new InetSocketAddress(addr, 0));
addrs.add(new InetSocketAddress(addr, 0));

for (String addr : metadata.getPublicAddresses())
addresses.add(new InetSocketAddress(addr, 0));
addrs.add(new InetSocketAddress(addr, 0));
}
}
catch (Exception e) {
throw new IgniteSpiException("Failed to get registered addresses for the provider: " + provider, e);
}

return addresses;
return addrs;
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -357,17 +357,17 @@ private void initComputeService() {

ctxBuilder.credentials(identity, credential);

Properties properties = new Properties();
properties.setProperty(Constants.PROPERTY_SO_TIMEOUT, JCLOUD_CONNECTION_TIMEOUT);
properties.setProperty(Constants.PROPERTY_CONNECTION_TIMEOUT, JCLOUD_CONNECTION_TIMEOUT);
Properties props = new Properties();
props.setProperty(Constants.PROPERTY_SO_TIMEOUT, JCLOUD_CONNECTION_TIMEOUT);
props.setProperty(Constants.PROPERTY_CONNECTION_TIMEOUT, JCLOUD_CONNECTION_TIMEOUT);

if (!F.isEmpty(regions))
properties.setProperty(LocationConstants.PROPERTY_REGIONS, keysSetToStr(regions));
props.setProperty(LocationConstants.PROPERTY_REGIONS, keysSetToStr(regions));

if (!F.isEmpty(zones))
properties.setProperty(LocationConstants.PROPERTY_ZONES, keysSetToStr(zones));
props.setProperty(LocationConstants.PROPERTY_ZONES, keysSetToStr(zones));

ctxBuilder.overrides(properties);
ctxBuilder.overrides(props);

computeService = ctxBuilder.buildView(ComputeServiceContext.class).getComputeService();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ private void testCloudProvider(String provider) throws Exception {
else
ipFinder.setCredential(IgniteCloudTestConfiguration.getSecretKey(provider));

Collection<InetSocketAddress> addresses = ipFinder.getRegisteredAddresses();
Collection<InetSocketAddress> addrs = ipFinder.getRegisteredAddresses();

for (InetSocketAddress addr : addresses)
for (InetSocketAddress addr : addrs)
info("Registered instance: " + addr.getAddress().getHostAddress() + ":" + addr.getPort());

ipFinder.unregisterAddresses(addresses);
ipFinder.unregisterAddresses(addrs);

assert addresses.size() == ipFinder.getRegisteredAddresses().size();
assert addrs.size() == ipFinder.getRegisteredAddresses().size();

ipFinder.registerAddresses(ImmutableList.of(
new InetSocketAddress("192.168.0.1", TcpDiscoverySpi.DFLT_PORT)));

assert addresses.size() == ipFinder.getRegisteredAddresses().size();
assert addrs.size() == ipFinder.getRegisteredAddresses().size();
}
}
4 changes: 3 additions & 1 deletion modules/flink-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<!--
POM file.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ public class TaskRemoteFilter implements IgnitePredicate<CacheEvent> {

/** {@inheritDoc} */
@Override public boolean apply(CacheEvent evt) {
Affinity<Object> affinity = ignite.affinity(cacheName);
Affinity<Object> aff = ignite.affinity(cacheName);

// Process this event. Ignored on backups.
return affinity.isPrimary(ignite.cluster().localNode(), evt.key()) &&
return aff.isPrimary(ignite.cluster().localNode(), evt.key()) &&
(filter == null || filter.apply(evt));
}
}
4 changes: 3 additions & 1 deletion modules/flume-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<!--
POM file.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,21 @@ public IgniteSink() {

Transaction transaction = channel.getTransaction();

int eventCount = 0;
int evtCnt = 0;

try {
transaction.begin();

List<Event> batch = new ArrayList<>(batchSize);

for (; eventCount < batchSize; ++eventCount) {
Event event = channel.take();
for (; evtCnt < batchSize; ++evtCnt) {
Event evt = channel.take();

if (event == null) {
if (evt == null) {
break;
}

batch.add(event);
batch.add(evt);
}

if (!batch.isEmpty()) {
Expand Down Expand Up @@ -191,6 +191,6 @@ public IgniteSink() {
transaction.close();
}

return eventCount == 0 ? Status.BACKOFF : Status.READY;
return evtCnt == 0 ? Status.BACKOFF : Status.READY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ public void testSink() throws Exception {

final Ignite grid = startGrid("igniteServerNode", cfg);

Context channelContext = new Context();
Context channelCtx = new Context();

channelContext.put("capacity", String.valueOf(EVENT_CNT));
channelContext.put("transactionCapacity", String.valueOf(EVENT_CNT));
channelCtx.put("capacity", String.valueOf(EVENT_CNT));
channelCtx.put("transactionCapacity", String.valueOf(EVENT_CNT));

Channel memoryChannel = new MemoryChannel();

Configurables.configure(memoryChannel, channelContext);
Configurables.configure(memoryChannel, channelCtx);

final CountDownLatch latch = new CountDownLatch(EVENT_CNT);

Expand Down
Loading

0 comments on commit 4c23d61

Please sign in to comment.