You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by na...@apache.org on 2024/05/08 12:14:31 UTC
(ignite-extensions) branch master updated: IGNITE-22178 Fixed codestyle (#266)
This is an automated email from the ASF dual-hosted git repository.
namelchev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git
The following commit(s) were added to refs/heads/master by this push:
new 4c23d612 IGNITE-22178 Fixed codestyle (#266)
4c23d612 is described below
commit 4c23d612873561448a1d7c258a119bc69ffaa1a2
Author: Aleksandr Nikolaev <56...@users.noreply.github.com>
AuthorDate: Wed May 8 15:14:24 2024 +0300
IGNITE-22178 Fixed codestyle (#266)
---
modules/aop-ext/pom.xml | 4 +-
.../util/gridify/GridifyArgumentBuilder.java | 12 +-
.../test/gridify/ExternalNonSpringAopSelfTest.java | 6 +-
modules/apache-license-gen/pom.xml | 4 +-
modules/azure-ext/pom.xml | 4 +-
modules/camel-ext/pom.xml | 4 +-
.../stream/camel/IgniteCamelStreamerTest.java | 28 ++---
.../cdc/kafka/CdcKafkaReplicationAppsTest.java | 4 +-
.../ignite/cdc/kafka/CdcKafkaReplicationTest.java | 6 +-
modules/cloud-ext/pom.xml | 4 +-
.../ipfinder/cloud/TcpDiscoveryCloudIpFinder.java | 20 ++--
.../cloud/TcpDiscoveryCloudIpFinderSelfTest.java | 10 +-
modules/flink-ext/pom.xml | 4 +-
.../ignite/source/flink/TaskRemoteFilter.java | 4 +-
modules/flume-ext/pom.xml | 4 +-
.../org/apache/ignite/stream/flume/IgniteSink.java | 12 +-
.../apache/ignite/stream/flume/IgniteSinkTest.java | 8 +-
.../ignite/stream/flume/TestEventTransformer.java | 10 +-
modules/gce-ext/pom.xml | 4 +-
.../gce/TcpDiscoveryGoogleStorageIpFinder.java | 18 +--
.../core/src/test/config/examples.properties | 2 +-
.../examples/datagrid/SpatialQueryExample.java | 4 +-
.../core/src/test/config/examples.properties | 2 +-
.../core/src/test/config/examples.properties | 2 +-
modules/hibernate-ext/hibernate/pom.xml | 4 +-
.../HibernateL2CacheConfigurationSelfTest.java | 8 +-
.../cache/hibernate/HibernateL2CacheSelfTest.java | 4 +-
modules/jms11-ext/pom.xml | 4 +-
.../apache/ignite/stream/jms11/JmsStreamer.java | 40 +++----
.../ignite/stream/jms11/IgniteJmsStreamerTest.java | 16 +--
.../ignite/stream/jms11/TestTransformers.java | 12 +-
.../stream/kafka/connect/IgniteSourceTask.java | 4 +-
.../stream/kafka/KafkaIgniteStreamerSelfTest.java | 6 +-
.../kafka/connect/IgniteSinkConnectorTest.java | 6 +-
.../kafka/connect/IgniteSourceConnectorTest.java | 2 +-
modules/mesos-ext/pom.xml | 4 +-
.../org/apache/ignite/mesos/IgniteScheduler.java | 30 ++---
.../ignite/mesos/resource/IgniteProvider.java | 12 +-
.../ignite/mesos/resource/ResourceHandler.java | 4 +-
.../ignite/mesos/IgniteSchedulerSelfTest.java | 26 ++---
.../CatboostClassificationModelParserExample.java | 4 +-
.../inference/h2o/H2OMojoModelParserExample.java | 6 +-
.../xgboost/XGBoostModelParserExample.java | 4 +-
.../encoding/TargetEncoderExample.java | 8 +-
.../testsuites/IgniteExamplesMLTestSuite.java | 4 +-
.../ml/catboost/CatboostClassificationModel.java | 13 ++-
.../ml/catboost/CatboostRegressionModel.java | 6 +-
.../ml/sparkmodelparser/SparkModelParser.java | 20 ++--
.../ignite/ml/clustering/gmm/GmmPartitionData.java | 6 +-
.../ignite/ml/clustering/gmm/GmmTrainer.java | 30 ++---
.../OnMajorityPredictionsAggregator.java | 6 +-
.../impl/cache/CacheBasedDatasetBuilder.java | 4 +-
.../ml/dataset/impl/cache/util/ComputeUtils.java | 4 +-
.../environment/deploy/DeployingContextImpl.java | 12 +-
.../ignite/ml/inference/json/JacksonHelper.java | 8 +-
.../knn/classification/KNNClassificationModel.java | 12 +-
.../main/java/org/apache/ignite/ml/math/Blas.java | 10 +-
.../java/org/apache/ignite/ml/math/Tracer.java | 4 +-
.../math/primitives/vector/impl/SparseVector.java | 4 +-
.../compound/CompoundNaiveBayesModel.java | 6 +-
.../compound/CompoundNaiveBayesTrainer.java | 6 +-
.../discrete/DiscreteNaiveBayesTrainer.java | 20 ++--
.../gaussian/GaussianNaiveBayesTrainer.java | 60 +++++-----
.../ml/preprocessing/encoding/EncoderTrainer.java | 8 +-
.../onehotencoder/OneHotEncoderPreprocessor.java | 6 +-
.../selection/paramgrid/ParameterSetGenerator.java | 4 +-
.../apache/ignite/ml/tree/DecisionTreeTrainer.java | 4 +-
.../util/SimpleStepFunctionCompressor.java | 8 +-
.../RandomForestClassifierTrainer.java | 4 +-
.../gmm/NewComponentStatisticsAggregatorTest.java | 18 +--
.../impl/cache/CacheBasedDatasetBuilderTest.java | 12 +-
.../ignite/ml/math/distances/DistanceTest.java | 12 +-
.../discrete/DiscreteNaiveBayesModelTest.java | 4 +-
.../preprocessing/encoding/EncoderTrainerTest.java | 4 +-
.../ml/xgboost/parser/XGBoostModelParserTest.java | 4 +-
modules/mqtt-ext/pom.xml | 4 +-
modules/osgi-ext/osgi-karaf/pom.xml | 4 +-
modules/osgi-ext/osgi/pom.xml | 4 +-
.../classloaders/BundleDelegatingClassLoader.java | 8 +-
.../osgi/activators/BasicIgniteTestActivator.java | 6 +-
.../PerformanceStatisticsReportBuilder.java | 12 +-
.../PerformanceStatisticsReportSelfTest.java | 4 +-
modules/pub-sub-ext/pom.xml | 2 +-
.../ignite/stream/pubsub/PubSubStreamer.java | 14 +--
.../ignite/stream/pubsub/MockPubSubServer.java | 22 ++--
.../stream/pubsub/PubSubStreamerSelfTest.java | 34 +++---
.../stream/rocketmq/RocketMQStreamerTest.java | 18 +--
.../ignite/stream/rocketmq/TestRocketMQServer.java | 10 +-
.../examples/spark/JavaIgniteCatalogExample.java | 12 +-
.../ignite/examples/spark/SharedRDDExample.java | 12 +-
modules/spark-ext/spark/pom.xml | 4 +-
.../spring-boot-autoconfigure/pom.xml | 4 +-
modules/spring-cache-ext/pom.xml | 4 +-
.../GridSpringCacheManagerMultiJvmSelfTest.java | 4 +-
.../ignite/cache/spring/SpringCacheTest.java | 18 +--
modules/spring-data-ext/spring-data/pom.xml | 4 +-
.../repository/config/DynamicQueryConfig.java | 22 ++--
.../repository/query/IgniteQueryGenerator.java | 8 +-
.../repository/query/IgniteRepositoryQuery.java | 126 ++++++++++-----------
.../springdata/repository/query/QueryUtils.java | 8 +-
.../springdata/repository/query/StringQuery.java | 46 ++++----
.../support/IgniteRepositoryFactory.java | 8 +-
.../springdata/IgniteSpringDataCrudSelfTest.java | 20 ++--
.../IgniteIndexedSessionRepositoryTest.java | 4 +-
modules/spring-tx-ext/spring-tx/pom.xml | 4 +-
modules/ssh-ext/pom.xml | 4 +-
.../util/nodestart/StartNodeCallableImpl.java | 6 +-
modules/storm-ext/pom.xml | 4 +-
.../stream/storm/StormIgniteStreamerSelfTest.java | 12 +-
modules/topology-validator-ext/pom.xml | 4 +-
modules/twitter-ext/pom.xml | 4 +-
modules/yarn-ext/pom.xml | 4 +-
.../org/apache/ignite/yarn/ApplicationMaster.java | 6 +-
.../org/apache/ignite/yarn/ClusterProperties.java | 16 +--
.../org/apache/ignite/yarn/IgniteYarnClient.java | 14 +--
.../apache/ignite/yarn/utils/IgniteYarnUtils.java | 14 +--
modules/zeromq-ext/pom.xml | 4 +-
.../ignite/stream/zeromq/IgniteZeroMqStreamer.java | 14 +--
.../stream/zeromq/IgniteZeroMqStreamerTest.java | 4 +-
.../ipfinder/zk/TcpDiscoveryZookeeperIpFinder.java | 12 +-
120 files changed, 667 insertions(+), 612 deletions(-)
diff --git a/modules/aop-ext/pom.xml b/modules/aop-ext/pom.xml
index 5fb1e387..b201c3ed 100644
--- a/modules/aop-ext/pom.xml
+++ b/modules/aop-ext/pom.xml
@@ -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>
diff --git a/modules/aop-ext/src/main/java/org/apache/ignite/internal/util/gridify/GridifyArgumentBuilder.java b/modules/aop-ext/src/main/java/org/apache/ignite/internal/util/gridify/GridifyArgumentBuilder.java
index 7c35d129..c7a48040 100644
--- a/modules/aop-ext/src/main/java/org/apache/ignite/internal/util/gridify/GridifyArgumentBuilder.java
+++ b/modules/aop-ext/src/main/java/org/apache/ignite/internal/util/gridify/GridifyArgumentBuilder.java
@@ -142,12 +142,12 @@ public final class GridifyArgumentBuilder {
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;
}
@@ -180,12 +180,12 @@ public final class GridifyArgumentBuilder {
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;
}
diff --git a/modules/aop-ext/src/test/java/org/test/gridify/ExternalNonSpringAopSelfTest.java b/modules/aop-ext/src/test/java/org/test/gridify/ExternalNonSpringAopSelfTest.java
index 41ba08de..b51ae908 100644
--- a/modules/aop-ext/src/test/java/org/test/gridify/ExternalNonSpringAopSelfTest.java
+++ b/modules/aop-ext/src/test/java/org/test/gridify/ExternalNonSpringAopSelfTest.java
@@ -443,7 +443,7 @@ public class ExternalNonSpringAopSelfTest extends GridCommonAbstractTest {
info("Start Gridify test with Default AOP Task and exception in Deployment Mode : " + depMode);
- boolean isException = false;
+ boolean ex = false;
try {
startGrid();
@@ -455,7 +455,7 @@ public class ExternalNonSpringAopSelfTest extends GridCommonAbstractTest {
catch (ExternalGridifyException e) {
info("@Gridify method gridifyDefaultException(0) returns exception: " + e);
- isException = true;
+ ex = true;
}
catch (Exception e) {
e.printStackTrace();
@@ -467,7 +467,7 @@ public class ExternalNonSpringAopSelfTest extends GridCommonAbstractTest {
stopGrid();
}
- if (!isException)
+ if (!ex)
fail("@Gridify method gridifyDefaultException(0) does not return any exception.");
}
diff --git a/modules/apache-license-gen/pom.xml b/modules/apache-license-gen/pom.xml
index 09a07451..2b342194 100644
--- a/modules/apache-license-gen/pom.xml
+++ b/modules/apache-license-gen/pom.xml
@@ -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>
diff --git a/modules/azure-ext/pom.xml b/modules/azure-ext/pom.xml
index 6e3fc436..c5b056ba 100644
--- a/modules/azure-ext/pom.xml
+++ b/modules/azure-ext/pom.xml
@@ -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>
diff --git a/modules/camel-ext/pom.xml b/modules/camel-ext/pom.xml
index 46423320..fd452701 100644
--- a/modules/camel-ext/pom.xml
+++ b/modules/camel-ext/pom.xml
@@ -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>
diff --git a/modules/camel-ext/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTest.java b/modules/camel-ext/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTest.java
index 425cb436..06e581e5 100644
--- a/modules/camel-ext/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTest.java
+++ b/modules/camel-ext/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTest.java
@@ -107,12 +107,12 @@ public class IgniteCamelStreamerTest extends GridCommonAbstractTest {
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();
}
@@ -207,11 +207,11 @@ public class IgniteCamelStreamerTest extends GridCommonAbstractTest {
@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();
}
@@ -240,11 +240,11 @@ public class IgniteCamelStreamerTest extends GridCommonAbstractTest {
@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}}");
@@ -253,9 +253,9 @@ public class IgniteCamelStreamerTest extends GridCommonAbstractTest {
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.
@@ -290,11 +290,11 @@ public class IgniteCamelStreamerTest extends GridCommonAbstractTest {
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);
}
}
diff --git a/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/kafka/CdcKafkaReplicationAppsTest.java b/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/kafka/CdcKafkaReplicationAppsTest.java
index 27d900d1..bfa491a1 100644
--- a/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/kafka/CdcKafkaReplicationAppsTest.java
+++ b/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/kafka/CdcKafkaReplicationAppsTest.java
@@ -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";
diff --git a/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/kafka/CdcKafkaReplicationTest.java b/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/kafka/CdcKafkaReplicationTest.java
index 685c50b1..9b43dc07 100644
--- a/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/kafka/CdcKafkaReplicationTest.java
+++ b/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/kafka/CdcKafkaReplicationTest.java
@@ -249,11 +249,11 @@ public class CdcKafkaReplicationTest extends AbstractReplicationTest {
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();
}
diff --git a/modules/cloud-ext/pom.xml b/modules/cloud-ext/pom.xml
index 69b160bb..749a3da6 100644
--- a/modules/cloud-ext/pom.xml
+++ b/modules/cloud-ext/pom.xml
@@ -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>
diff --git a/modules/cloud-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java b/modules/cloud-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
index 57e8c50d..f0409afc 100644
--- a/modules/cloud-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
+++ b/modules/cloud-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
@@ -182,7 +182,7 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
@Override public Collection<InetSocketAddress> getRegisteredAddresses() throws IgniteSpiException {
initComputeService();
- Collection<InetSocketAddress> addresses = new LinkedList<>();
+ Collection<InetSocketAddress> addrs = new LinkedList<>();
try {
Set<NodeMetadata> nodes;
@@ -201,17 +201,17 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
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} */
@@ -357,17 +357,17 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
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();
diff --git a/modules/cloud-ext/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java b/modules/cloud-ext/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
index 47b93c18..fb1d7279 100644
--- a/modules/cloud-ext/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
+++ b/modules/cloud-ext/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
@@ -102,18 +102,18 @@ public class TcpDiscoveryCloudIpFinderSelfTest extends
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();
}
}
diff --git a/modules/flink-ext/pom.xml b/modules/flink-ext/pom.xml
index 72ec87d0..d13b9632 100644
--- a/modules/flink-ext/pom.xml
+++ b/modules/flink-ext/pom.xml
@@ -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>
diff --git a/modules/flink-ext/src/main/java/org/apache/ignite/source/flink/TaskRemoteFilter.java b/modules/flink-ext/src/main/java/org/apache/ignite/source/flink/TaskRemoteFilter.java
index 4c89d254..c913248d 100644
--- a/modules/flink-ext/src/main/java/org/apache/ignite/source/flink/TaskRemoteFilter.java
+++ b/modules/flink-ext/src/main/java/org/apache/ignite/source/flink/TaskRemoteFilter.java
@@ -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));
}
}
diff --git a/modules/flume-ext/pom.xml b/modules/flume-ext/pom.xml
index 57aac0ff..7cca47c8 100644
--- a/modules/flume-ext/pom.xml
+++ b/modules/flume-ext/pom.xml
@@ -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>
diff --git a/modules/flume-ext/src/main/java/org/apache/ignite/stream/flume/IgniteSink.java b/modules/flume-ext/src/main/java/org/apache/ignite/stream/flume/IgniteSink.java
index 54482e52..77b8bfcf 100644
--- a/modules/flume-ext/src/main/java/org/apache/ignite/stream/flume/IgniteSink.java
+++ b/modules/flume-ext/src/main/java/org/apache/ignite/stream/flume/IgniteSink.java
@@ -140,21 +140,21 @@ public class IgniteSink extends AbstractSink implements Configurable {
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()) {
@@ -191,6 +191,6 @@ public class IgniteSink extends AbstractSink implements Configurable {
transaction.close();
}
- return eventCount == 0 ? Status.BACKOFF : Status.READY;
+ return evtCnt == 0 ? Status.BACKOFF : Status.READY;
}
}
diff --git a/modules/flume-ext/src/test/java/org/apache/ignite/stream/flume/IgniteSinkTest.java b/modules/flume-ext/src/test/java/org/apache/ignite/stream/flume/IgniteSinkTest.java
index fa8645d3..3798829d 100644
--- a/modules/flume-ext/src/test/java/org/apache/ignite/stream/flume/IgniteSinkTest.java
+++ b/modules/flume-ext/src/test/java/org/apache/ignite/stream/flume/IgniteSinkTest.java
@@ -57,14 +57,14 @@ public class IgniteSinkTest extends GridCommonAbstractTest {
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);
diff --git a/modules/flume-ext/src/test/java/org/apache/ignite/stream/flume/TestEventTransformer.java b/modules/flume-ext/src/test/java/org/apache/ignite/stream/flume/TestEventTransformer.java
index c15efbf4..e6ee8b3e 100644
--- a/modules/flume-ext/src/test/java/org/apache/ignite/stream/flume/TestEventTransformer.java
+++ b/modules/flume-ext/src/test/java/org/apache/ignite/stream/flume/TestEventTransformer.java
@@ -37,10 +37,10 @@ public class TestEventTransformer implements EventTransformer<Event, String, Int
private Map<String, Integer> transform(Event event) {
final Map<String, Integer> map = new HashMap<>();
- String eventStr = new String(event.getBody());
+ String evtStr = new String(event.getBody());
- if (!eventStr.isEmpty()) {
- String[] tokens = eventStr.split(":"); // Expects column-delimited one line.
+ if (!evtStr.isEmpty()) {
+ String[] tokens = evtStr.split(":"); // Expects column-delimited one line.
map.put(tokens[0].trim(), Integer.valueOf(tokens[1].trim()));
}
@@ -57,8 +57,8 @@ public class TestEventTransformer implements EventTransformer<Event, String, Int
@Nullable @Override public Map<String, Integer> transform(List<Event> events) {
final Map<String, Integer> map = new HashMap<>();
- for (Event event : events) {
- map.putAll(transform(event));
+ for (Event evt : events) {
+ map.putAll(transform(evt));
}
return map;
diff --git a/modules/gce-ext/pom.xml b/modules/gce-ext/pom.xml
index a84bc3a0..3f826750 100644
--- a/modules/gce-ext/pom.xml
+++ b/modules/gce-ext/pom.xml
@@ -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>
diff --git a/modules/gce-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/gce/TcpDiscoveryGoogleStorageIpFinder.java b/modules/gce-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/gce/TcpDiscoveryGoogleStorageIpFinder.java
index 084783aa..343f43dc 100644
--- a/modules/gce-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/gce/TcpDiscoveryGoogleStorageIpFinder.java
+++ b/modules/gce-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/gce/TcpDiscoveryGoogleStorageIpFinder.java
@@ -126,8 +126,8 @@ public class TcpDiscoveryGoogleStorageIpFinder extends TcpDiscoveryIpFinderAdapt
if (objects == null || objects.getItems() == null)
break;
- for (StorageObject object : objects.getItems())
- addrs.add(addrFromString(object.getName()));
+ for (StorageObject obj : objects.getItems())
+ addrs.add(addrFromString(obj.getName()));
listObjects.setPageToken(objects.getNextPageToken());
}
@@ -149,19 +149,19 @@ public class TcpDiscoveryGoogleStorageIpFinder extends TcpDiscoveryIpFinderAdapt
for (InetSocketAddress addr : addrs) {
String key = keyFromAddr(addr);
- StorageObject object = new StorageObject();
+ StorageObject obj = new StorageObject();
- object.setBucket(bucketName);
- object.setName(key);
+ obj.setBucket(bucketName);
+ obj.setName(key);
InputStreamContent content = new InputStreamContent("application/octet-stream", OBJECT_CONTENT);
content.setLength(OBJECT_CONTENT.available());
try {
- Storage.Objects.Insert insertObject = storage.objects().insert(bucketName, object, content);
+ Storage.Objects.Insert insertObj = storage.objects().insert(bucketName, obj, content);
- insertObject.execute();
+ insertObj.execute();
}
catch (Exception e) {
throw new IgniteSpiException("Failed to put entry [bucketName=" + bucketName +
@@ -180,9 +180,9 @@ public class TcpDiscoveryGoogleStorageIpFinder extends TcpDiscoveryIpFinderAdapt
String key = keyFromAddr(addr);
try {
- Storage.Objects.Delete deleteObject = storage.objects().delete(bucketName, key);
+ Storage.Objects.Delete deleteObj = storage.objects().delete(bucketName, key);
- deleteObject.execute();
+ deleteObj.execute();
}
catch (Exception e) {
throw new IgniteSpiException("Failed to delete entry [bucketName=" + bucketName +
diff --git a/modules/geospatial-ext/examples/modules/core/src/test/config/examples.properties b/modules/geospatial-ext/examples/modules/core/src/test/config/examples.properties
index b1b8bc16..fb023d2c 100644
--- a/modules/geospatial-ext/examples/modules/core/src/test/config/examples.properties
+++ b/modules/geospatial-ext/examples/modules/core/src/test/config/examples.properties
@@ -22,4 +22,4 @@ ScalarCacheExample=examples/config/example-ignite.xml
ScalarCacheQueryExample=examples/config/example-ignite.xml
ScalarCountGraphTrianglesExample=examples/config/example-ignite.xml
ScalarPopularNumbersRealTimeExample=examples/config/example-ignite.xml
-DataRegionEexample=examples/config/example-data-regions.xml
\ No newline at end of file
+DataRegionEexample=examples/config/example-data-regions.xml
diff --git a/modules/geospatial-ext/examples/src/main/java/org/apache/ignite/examples/datagrid/SpatialQueryExample.java b/modules/geospatial-ext/examples/src/main/java/org/apache/ignite/examples/datagrid/SpatialQueryExample.java
index 8f7ce094..5a03f3a8 100644
--- a/modules/geospatial-ext/examples/src/main/java/org/apache/ignite/examples/datagrid/SpatialQueryExample.java
+++ b/modules/geospatial-ext/examples/src/main/java/org/apache/ignite/examples/datagrid/SpatialQueryExample.java
@@ -70,7 +70,7 @@ public class SpatialQueryExample {
}
// Query to fetch the points that fit into a specific polygon.
- SqlQuery<Integer, MapPoint> query = new SqlQuery<>(MapPoint.class, "coords && ?");
+ SqlQuery<Integer, MapPoint> qry = new SqlQuery<>(MapPoint.class, "coords && ?");
// Selecting points that fit into a specific polygon.
for (int i = 0; i < 10; i++) {
@@ -80,7 +80,7 @@ public class SpatialQueryExample {
rnd.nextInt(10000) + " 0, 0 0))");
// Executing the query.
- Collection<Cache.Entry<Integer, MapPoint>> entries = cache.query(query.setArgs(cond)).getAll();
+ Collection<Cache.Entry<Integer, MapPoint>> entries = cache.query(qry.setArgs(cond)).getAll();
// Printing number of points that fit into the area defined by the polygon.
System.out.println("Fetched points [cond=" + cond + ", cnt=" + entries.size() + ']');
diff --git a/modules/geospatial-ext/geospatial/modules/core/src/test/config/examples.properties b/modules/geospatial-ext/geospatial/modules/core/src/test/config/examples.properties
index b1b8bc16..fb023d2c 100644
--- a/modules/geospatial-ext/geospatial/modules/core/src/test/config/examples.properties
+++ b/modules/geospatial-ext/geospatial/modules/core/src/test/config/examples.properties
@@ -22,4 +22,4 @@ ScalarCacheExample=examples/config/example-ignite.xml
ScalarCacheQueryExample=examples/config/example-ignite.xml
ScalarCountGraphTrianglesExample=examples/config/example-ignite.xml
ScalarPopularNumbersRealTimeExample=examples/config/example-ignite.xml
-DataRegionEexample=examples/config/example-data-regions.xml
\ No newline at end of file
+DataRegionEexample=examples/config/example-data-regions.xml
diff --git a/modules/hibernate-ext/examples/modules/core/src/test/config/examples.properties b/modules/hibernate-ext/examples/modules/core/src/test/config/examples.properties
index b1b8bc16..fb023d2c 100644
--- a/modules/hibernate-ext/examples/modules/core/src/test/config/examples.properties
+++ b/modules/hibernate-ext/examples/modules/core/src/test/config/examples.properties
@@ -22,4 +22,4 @@ ScalarCacheExample=examples/config/example-ignite.xml
ScalarCacheQueryExample=examples/config/example-ignite.xml
ScalarCountGraphTrianglesExample=examples/config/example-ignite.xml
ScalarPopularNumbersRealTimeExample=examples/config/example-ignite.xml
-DataRegionEexample=examples/config/example-data-regions.xml
\ No newline at end of file
+DataRegionEexample=examples/config/example-data-regions.xml
diff --git a/modules/hibernate-ext/hibernate/pom.xml b/modules/hibernate-ext/hibernate/pom.xml
index a11399ba..23fa31cd 100644
--- a/modules/hibernate-ext/hibernate/pom.xml
+++ b/modules/hibernate-ext/hibernate/pom.xml
@@ -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>
diff --git a/modules/hibernate-ext/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheConfigurationSelfTest.java b/modules/hibernate-ext/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheConfigurationSelfTest.java
index 60eb1315..714c874d 100644
--- a/modules/hibernate-ext/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheConfigurationSelfTest.java
+++ b/modules/hibernate-ext/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheConfigurationSelfTest.java
@@ -265,10 +265,10 @@ public class HibernateL2CacheConfigurationSelfTest extends GridCommonAbstractTes
/** */
private <T> List<T> getResultsList(Session ses, Class<T> entityClass) {
CriteriaBuilder builder = ses.getCriteriaBuilder();
- CriteriaQuery<T> query = builder.createQuery(entityClass);
- Root<T> root = query.from(entityClass);
- query.select(root);
- return ses.createQuery(query).getResultList();
+ CriteriaQuery<T> qry = builder.createQuery(entityClass);
+ Root<T> root = qry.from(entityClass);
+ qry.select(root);
+ return ses.createQuery(qry).getResultList();
}
/**
diff --git a/modules/hibernate-ext/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java b/modules/hibernate-ext/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java
index b2b0752e..9a11117d 100644
--- a/modules/hibernate-ext/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java
+++ b/modules/hibernate-ext/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java
@@ -1921,8 +1921,8 @@ public class HibernateL2CacheSelfTest extends GridCommonAbstractTest {
MetadataSources metadataSources = new MetadataSources(srvcRegistry);
- for (Class entityClass : getAnnotatedClasses())
- metadataSources.addAnnotatedClass(entityClass);
+ for (Class entityCls : getAnnotatedClasses())
+ metadataSources.addAnnotatedClass(entityCls);
Metadata metadata = metadataSources.buildMetadata();
diff --git a/modules/jms11-ext/pom.xml b/modules/jms11-ext/pom.xml
index 46c2f0af..31adb0cb 100644
--- a/modules/jms11-ext/pom.xml
+++ b/modules/jms11-ext/pom.xml
@@ -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>
diff --git a/modules/jms11-ext/src/main/java/org/apache/ignite/stream/jms11/JmsStreamer.java b/modules/jms11-ext/src/main/java/org/apache/ignite/stream/jms11/JmsStreamer.java
index 8343363a..b9e09871 100644
--- a/modules/jms11-ext/src/main/java/org/apache/ignite/stream/jms11/JmsStreamer.java
+++ b/modules/jms11-ext/src/main/java/org/apache/ignite/stream/jms11/JmsStreamer.java
@@ -240,17 +240,17 @@ public class JmsStreamer<T extends Message, K, V> extends StreamAdapter<T, K, V>
scheduler = Executors.newScheduledThreadPool(1);
scheduler.schedule(new Runnable() {
@Override public void run() {
- for (Session session : sessions) {
+ for (Session ses : sessions) {
try {
- session.commit();
+ ses.commit();
if (log.isDebugEnabled()) {
- log.debug("Committing session from time-based batch completion [session=" +
- session + "]");
+ log.debug("Committing session from time-based batch completion [ses=" +
+ ses + "]");
}
}
catch (JMSException ignored) {
log.warning("Error while committing session: from batch time-based completion " +
- "[session=" + session + "]");
+ "[ses=" + ses + "]");
}
}
for (IgniteJmsMessageListener ml : listeners) {
@@ -440,39 +440,39 @@ public class JmsStreamer<T extends Message, K, V> extends StreamAdapter<T, K, V>
/** */
private void initializeJmsObjectsForTopic() throws JMSException {
- Session session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
+ Session ses = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
Topic topic = (Topic)destination;
if (destination == null)
- topic = session.createTopic(destinationName);
+ topic = ses.createTopic(destinationName);
- MessageConsumer consumer = durableSubscription ? session.createDurableSubscriber(topic, durableSubscriptionName) :
- session.createConsumer(topic);
+ MessageConsumer consumer = durableSubscription ? ses.createDurableSubscriber(topic, durableSubscriptionName) :
+ ses.createConsumer(topic);
- IgniteJmsMessageListener messageListener = new IgniteJmsMessageListener(session, true);
- consumer.setMessageListener(messageListener);
+ IgniteJmsMessageListener msgListener = new IgniteJmsMessageListener(ses, true);
+ consumer.setMessageListener(msgListener);
consumers.add(consumer);
- sessions.add(session);
- listeners.add(messageListener);
+ sessions.add(ses);
+ listeners.add(msgListener);
}
/** */
private void initializeJmsObjectsForQueue() throws JMSException {
for (int i = 0; i < threads; i++) {
- Session session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
+ Session ses = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
if (destination == null)
- destination = session.createQueue(destinationName);
+ destination = ses.createQueue(destinationName);
- MessageConsumer consumer = session.createConsumer(destination);
+ MessageConsumer consumer = ses.createConsumer(destination);
- IgniteJmsMessageListener messageListener = new IgniteJmsMessageListener(session, false);
- consumer.setMessageListener(messageListener);
+ IgniteJmsMessageListener msgListener = new IgniteJmsMessageListener(ses, false);
+ consumer.setMessageListener(msgListener);
consumers.add(consumer);
- sessions.add(session);
- listeners.add(messageListener);
+ sessions.add(ses);
+ listeners.add(msgListener);
}
}
diff --git a/modules/jms11-ext/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java b/modules/jms11-ext/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
index 71b9fde6..e720ef78 100644
--- a/modules/jms11-ext/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
+++ b/modules/jms11-ext/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
@@ -641,22 +641,22 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
set.add(to);
}
- int messagesSent;
+ int msgsSent;
if (singleMsg) {
mp.send(ses.createObjectMessage(set));
- messagesSent = 1;
+ msgsSent = 1;
}
else {
for (TestTransformers.TestObject to : set)
mp.send(ses.createObjectMessage(to));
- messagesSent = set.size();
+ msgsSent = set.size();
}
if (dest instanceof Queue) {
try {
- assertEquals(messagesSent, broker.getBroker().getDestinationMap().get(dest)
+ assertEquals(msgsSent, broker.getBroker().getDestinationMap().get(dest)
.getDestinationStatistics().getMessages().getCount());
}
catch (Exception e) {
@@ -677,7 +677,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
for (String key : TEST_DATA.keySet())
set.add(key + "," + TEST_DATA.get(key));
- int messagesSent;
+ int msgsSent;
if (singleMsg) {
StringBuilder sb = new StringBuilder();
@@ -687,19 +687,19 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
sb.deleteCharAt(sb.length() - 1);
mp.send(ses.createTextMessage(sb.toString()));
- messagesSent = 1;
+ msgsSent = 1;
}
else {
for (String s : set)
mp.send(ses.createTextMessage(s));
- messagesSent = set.size();
+ msgsSent = set.size();
}
if (dest instanceof Queue) {
try {
- assertEquals(messagesSent, broker.getBroker().getDestinationMap().get(dest)
+ assertEquals(msgsSent, broker.getBroker().getDestinationMap().get(dest)
.getDestinationStatistics().getMessages().getCount());
}
catch (Exception e) {
diff --git a/modules/jms11-ext/src/test/java/org/apache/ignite/stream/jms11/TestTransformers.java b/modules/jms11-ext/src/test/java/org/apache/ignite/stream/jms11/TestTransformers.java
index 9f1e08a0..4bf8c4eb 100644
--- a/modules/jms11-ext/src/test/java/org/apache/ignite/stream/jms11/TestTransformers.java
+++ b/modules/jms11-ext/src/test/java/org/apache/ignite/stream/jms11/TestTransformers.java
@@ -69,9 +69,9 @@ public class TestTransformers {
return new MessageTransformer<ObjectMessage, String, String>() {
@SuppressWarnings("unchecked")
@Override public Map<String, String> apply(ObjectMessage message) {
- Object object;
+ Object obj;
try {
- object = message.getObject();
+ obj = message.getObject();
}
catch (JMSException e) {
e.printStackTrace();
@@ -79,13 +79,13 @@ public class TestTransformers {
}
final Map<String, String> answer = new HashMap<>();
- if (object instanceof Collection) {
- for (TestObject to : (Collection<TestObject>)object)
+ if (obj instanceof Collection) {
+ for (TestObject to : (Collection<TestObject>)obj)
answer.put(to.getKey(), to.getValue());
}
- else if (object instanceof TestObject) {
- TestObject to = (TestObject)object;
+ else if (obj instanceof TestObject) {
+ TestObject to = (TestObject)obj;
answer.put(to.getKey(), to.getValue());
}
return answer;
diff --git a/modules/kafka-ext/src/main/java/org/apache/ignite/stream/kafka/connect/IgniteSourceTask.java b/modules/kafka-ext/src/main/java/org/apache/ignite/stream/kafka/connect/IgniteSourceTask.java
index 6e3d43ba..a46a58ff 100644
--- a/modules/kafka-ext/src/main/java/org/apache/ignite/stream/kafka/connect/IgniteSourceTask.java
+++ b/modules/kafka-ext/src/main/java/org/apache/ignite/stream/kafka/connect/IgniteSourceTask.java
@@ -277,9 +277,9 @@ public class IgniteSourceTask extends SourceTask {
/** {@inheritDoc} */
@Override public boolean apply(CacheEvent evt) {
- Affinity<Object> affinity = ignite.affinity(cacheName);
+ Affinity<Object> aff = ignite.affinity(cacheName);
- if (affinity.isPrimary(ignite.cluster().localNode(), evt.key())) {
+ if (aff.isPrimary(ignite.cluster().localNode(), evt.key())) {
// Process this event. Ignored on backups.
if (filter != null && filter.apply(evt))
return false;
diff --git a/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java b/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
index ef4256e8..d6a71353 100644
--- a/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
+++ b/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
@@ -130,7 +130,7 @@ public class KafkaIgniteStreamerSelfTest extends GridCommonAbstractTest {
Collections.shuffle(subnet);
- List<ProducerRecord<String, String>> messages = new ArrayList<>(CNT);
+ List<ProducerRecord<String, String>> msgs = new ArrayList<>(CNT);
Map<String, String> keyValMap = new HashMap<>();
@@ -141,12 +141,12 @@ public class KafkaIgniteStreamerSelfTest extends GridCommonAbstractTest {
String msg = runtime + VALUE_URL + ip;
- messages.add(new ProducerRecord<>(topic, ip, msg));
+ msgs.add(new ProducerRecord<>(topic, ip, msg));
keyValMap.put(ip, msg);
}
- embeddedBroker.sendMessages(messages);
+ embeddedBroker.sendMessages(msgs);
return keyValMap;
}
diff --git a/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/connect/IgniteSinkConnectorTest.java b/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/connect/IgniteSinkConnectorTest.java
index 430da505..69231960 100644
--- a/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/connect/IgniteSinkConnectorTest.java
+++ b/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/connect/IgniteSinkConnectorTest.java
@@ -226,7 +226,7 @@ public class IgniteSinkConnectorTest extends GridCommonAbstractTest {
* @return Map of key value messages.
*/
private Map<String, String> produceStream(String topic, boolean keyless) {
- List<ProducerRecord<String, String>> messages = new ArrayList<>(EVENT_CNT);
+ List<ProducerRecord<String, String>> msgs = new ArrayList<>(EVENT_CNT);
Map<String, String> keyValMap = new HashMap<>();
@@ -239,7 +239,7 @@ public class IgniteSinkConnectorTest extends GridCommonAbstractTest {
String msg = topic + ":" + String.valueOf(evt) + "_" + runtime;
- messages.add(new ProducerRecord<>(topic, key, msg));
+ msgs.add(new ProducerRecord<>(topic, key, msg));
if (!keyless)
keyValMap.put(key, msg);
@@ -247,7 +247,7 @@ public class IgniteSinkConnectorTest extends GridCommonAbstractTest {
keyValMap.put(topic + ":" + String.valueOf(evt), String.valueOf(runtime));
}
- kafkaBroker.sendMessages(messages);
+ kafkaBroker.sendMessages(msgs);
return keyValMap;
}
diff --git a/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/connect/IgniteSourceConnectorTest.java b/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/connect/IgniteSourceConnectorTest.java
index afd9e348..858c369a 100644
--- a/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/connect/IgniteSourceConnectorTest.java
+++ b/modules/kafka-ext/src/test/java/org/apache/ignite/stream/kafka/connect/IgniteSourceConnectorTest.java
@@ -338,7 +338,7 @@ public class IgniteSourceConnectorTest extends GridCommonAbstractTest {
* @return Worker configurations.
* @throws IOException If failed.
*/
- private Map<String, String> makeWorkerProps(){
+ private Map<String, String> makeWorkerProps() {
Map<String, String> props = new HashMap<>();
props.put("internal.key.converter.schemas.enable", "false");
diff --git a/modules/mesos-ext/pom.xml b/modules/mesos-ext/pom.xml
index 5b996975..cad52c74 100644
--- a/modules/mesos-ext/pom.xml
+++ b/modules/mesos-ext/pom.xml
@@ -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>
diff --git a/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java b/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
index 3a58f652..c65309d7 100644
--- a/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
+++ b/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
@@ -240,24 +240,24 @@ public class IgniteScheduler implements Scheduler {
return null;
// Collect resource on slave.
- for (Protos.Resource resource : offer.getResourcesList()) {
- if (resource.getName().equals(CPU)) {
- if (resource.getType().equals(Protos.Value.Type.SCALAR))
- cpus = resource.getScalar().getValue();
+ for (Protos.Resource rsrc : offer.getResourcesList()) {
+ if (rsrc.getName().equals(CPU)) {
+ if (rsrc.getType().equals(Protos.Value.Type.SCALAR))
+ cpus = rsrc.getScalar().getValue();
else
- log.log(Level.FINE, "Cpus resource was not a scalar: {0}" + resource.getType());
+ log.log(Level.FINE, "Cpus resource was not a scalar: {0}" + rsrc.getType());
}
- else if (resource.getName().equals(MEM)) {
- if (resource.getType().equals(Protos.Value.Type.SCALAR))
- mem = resource.getScalar().getValue();
+ else if (rsrc.getName().equals(MEM)) {
+ if (rsrc.getType().equals(Protos.Value.Type.SCALAR))
+ mem = rsrc.getScalar().getValue();
else
- log.log(Level.FINE, "Mem resource was not a scalar: {0}", resource.getType());
+ log.log(Level.FINE, "Mem resource was not a scalar: {0}", rsrc.getType());
}
- else if (resource.getName().equals(DISK))
- if (resource.getType().equals(Protos.Value.Type.SCALAR))
- disk = resource.getScalar().getValue();
+ else if (rsrc.getName().equals(DISK))
+ if (rsrc.getType().equals(Protos.Value.Type.SCALAR))
+ disk = rsrc.getScalar().getValue();
else
- log.log(Level.FINE, "Disk resource was not a scalar: {0}", resource.getType());
+ log.log(Level.FINE, "Disk resource was not a scalar: {0}", rsrc.getType());
}
// Check that slave satisfies min requirements.
@@ -315,7 +315,7 @@ public class IgniteScheduler implements Scheduler {
if (failedTask != null) {
List<Protos.Request> requests = new ArrayList<>();
- Protos.Request request = Protos.Request.newBuilder()
+ Protos.Request req = Protos.Request.newBuilder()
.addResources(Protos.Resource.newBuilder()
.setType(Protos.Value.Type.SCALAR)
.setName(MEM)
@@ -326,7 +326,7 @@ public class IgniteScheduler implements Scheduler {
.setScalar(Protos.Value.Scalar.newBuilder().setValue(failedTask.cpuCores())))
.build();
- requests.add(request);
+ requests.add(req);
schedulerDriver.requestResources(requests);
}
diff --git a/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/resource/IgniteProvider.java b/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/resource/IgniteProvider.java
index bd6d471a..4d3f0865 100644
--- a/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/resource/IgniteProvider.java
+++ b/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/resource/IgniteProvider.java
@@ -119,13 +119,13 @@ public class IgniteProvider {
* @throws IOException If failed.
*/
private String findMirror() throws IOException {
- String response = getHttpContents(new URL(APACHE_MIRROR_URL));
+ String res = getHttpContents(new URL(APACHE_MIRROR_URL));
- if (response == null)
+ if (res == null)
throw new RuntimeException("Failed to retrieve mirrors");
ObjectMapper mapper = new ObjectMapper();
- JsonNode mirrorUrl = mapper.readTree(response).get("preferred");
+ JsonNode mirrorUrl = mapper.readTree(res).get("preferred");
if (mirrorUrl == null)
throw new RuntimeException("Failed to find the preferred mirror");
@@ -140,12 +140,12 @@ public class IgniteProvider {
* @throws IOException If failed.
*/
private String findLatestVersion() throws IOException {
- String response = getHttpContents(new URL(IGNITE_LATEST_VERSION_URL));
+ String res = getHttpContents(new URL(IGNITE_LATEST_VERSION_URL));
- if (response == null)
+ if (res == null)
throw new RuntimeException("Failed to identify the latest version. Specify it with " + IGNITE_VERSION);
- Matcher m = VERSION_PATTERN.matcher(response);
+ Matcher m = VERSION_PATTERN.matcher(res);
if (m.find())
return m.group();
else
diff --git a/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/resource/ResourceHandler.java b/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/resource/ResourceHandler.java
index 51de26b9..8dd31944 100644
--- a/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/resource/ResourceHandler.java
+++ b/modules/mesos-ext/src/main/java/org/apache/ignite/mesos/resource/ResourceHandler.java
@@ -79,9 +79,9 @@ public class ResourceHandler extends AbstractHandler {
String fileName = path[path.length - 1];
- String servicePath = url.substring(0, url.length() - fileName.length());
+ String srvcPath = url.substring(0, url.length() - fileName.length());
- switch (servicePath) {
+ switch (srvcPath) {
case IGNITE_PREFIX:
handleRequest(response, "application/zip-archive", igniteDir + "/" + fileName);
diff --git a/modules/mesos-ext/src/test/java/org/apache/ignite/mesos/IgniteSchedulerSelfTest.java b/modules/mesos-ext/src/test/java/org/apache/ignite/mesos/IgniteSchedulerSelfTest.java
index b362beed..175a7cea 100644
--- a/modules/mesos-ext/src/test/java/org/apache/ignite/mesos/IgniteSchedulerSelfTest.java
+++ b/modules/mesos-ext/src/test/java/org/apache/ignite/mesos/IgniteSchedulerSelfTest.java
@@ -320,26 +320,26 @@ public class IgniteSchedulerSelfTest {
*/
@Test
public void testIgniteFramework() throws Exception {
- final String mesosUserValue = "userAAAAA";
- final String mesosRoleValue = "role1";
+ final String mesosUserVal = "userAAAAA";
+ final String mesosRoleVal = "role1";
IgniteFramework igniteFramework = new IgniteFramework() {
@Override protected String getUser() {
- return mesosUserValue;
+ return mesosUserVal;
}
@Override protected String getRole() {
- return mesosRoleValue;
+ return mesosRoleVal;
}
};
Protos.FrameworkInfo info = igniteFramework.getFrameworkInfo();
- String actualUserValue = info.getUser();
- String actualRoleValue = info.getRole();
+ String actualUserVal = info.getUser();
+ String actualRoleVal = info.getRole();
- assertEquals(actualUserValue, mesosUserValue);
- assertEquals(actualRoleValue, mesosRoleValue);
+ assertEquals(actualUserVal, mesosUserVal);
+ assertEquals(actualRoleVal, mesosRoleVal);
}
/**
@@ -350,8 +350,8 @@ public class IgniteSchedulerSelfTest {
List<String> failedRoleValues = Arrays.asList("", ".", "..", "-testRole",
"test/Role", "test\\Role", "test Role", null);
- for (String failedRoleValue : failedRoleValues)
- assertFalse(IgniteFramework.isRoleValid(failedRoleValue));
+ for (String failedRoleVal : failedRoleValues)
+ assertFalse(IgniteFramework.isRoleValid(failedRoleVal));
}
/**
@@ -359,9 +359,9 @@ public class IgniteSchedulerSelfTest {
* @return Value.
*/
private Double resources(List<Protos.Resource> resources, String resourceType) {
- for (Protos.Resource resource : resources) {
- if (resource.getName().equals(resourceType))
- return resource.getScalar().getValue();
+ for (Protos.Resource rsrc : resources) {
+ if (rsrc.getName().equals(resourceType))
+ return rsrc.getScalar().getValue();
}
return null;
diff --git a/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/catboost/CatboostClassificationModelParserExample.java b/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/catboost/CatboostClassificationModelParserExample.java
index 4bd46dbd..493a91da 100644
--- a/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/catboost/CatboostClassificationModelParserExample.java
+++ b/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/catboost/CatboostClassificationModelParserExample.java
@@ -86,8 +86,8 @@ public class CatboostClassificationModelParserExample {
try (Model<NamedVector, Future<Double>> mdl = mdlBuilder.build(reader, parser);
Scanner testDataScanner = new Scanner(testData);
Scanner testExpResultsScanner = new Scanner(testExpRes)) {
- String header = testDataScanner.nextLine();
- String[] columns = header.split(",");
+ String hdr = testDataScanner.nextLine();
+ String[] columns = hdr.split(",");
while (testDataScanner.hasNextLine()) {
String testDataStr = testDataScanner.nextLine();
diff --git a/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/h2o/H2OMojoModelParserExample.java b/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/h2o/H2OMojoModelParserExample.java
index 613c1e43..f0631ddf 100644
--- a/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/h2o/H2OMojoModelParserExample.java
+++ b/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/h2o/H2OMojoModelParserExample.java
@@ -81,13 +81,13 @@ public class H2OMojoModelParserExample {
HashMap<String, Double> testObj = new HashMap<>();
- for (String keyValueString : testDataStr.split(" ")) {
- String[] keyVal = keyValueString.split(":");
+ for (String keyValStr : testDataStr.split(" ")) {
+ String[] keyVal = keyValStr.split(":");
if (keyVal.length == 2)
testObj.put("C" + (1 + Integer.parseInt(keyVal[0])), Double.parseDouble(keyVal[1]));
else
- actual = keyValueString;
+ actual = keyValStr;
}
double prediction = mdl.predict(VectorUtils.of(testObj)).get();
diff --git a/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/xgboost/XGBoostModelParserExample.java b/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/xgboost/XGBoostModelParserExample.java
index 28974bb8..9c695849 100644
--- a/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/xgboost/XGBoostModelParserExample.java
+++ b/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/inference/xgboost/XGBoostModelParserExample.java
@@ -91,8 +91,8 @@ public class XGBoostModelParserExample {
HashMap<String, Double> testObj = new HashMap<>();
- for (String keyValueString : testDataStr.split(" ")) {
- String[] keyVal = keyValueString.split(":");
+ for (String keyValStr : testDataStr.split(" ")) {
+ String[] keyVal = keyValStr.split(":");
if (keyVal.length == 2)
testObj.put("f" + keyVal[0], Double.parseDouble(keyVal[1]));
diff --git a/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/preprocessing/encoding/TargetEncoderExample.java b/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/preprocessing/encoding/TargetEncoderExample.java
index 9768c8b7..73864ba9 100644
--- a/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/preprocessing/encoding/TargetEncoderExample.java
+++ b/modules/ml-ext/examples/src/main/java/org/apache/ignite/examples/ml/preprocessing/encoding/TargetEncoderExample.java
@@ -70,10 +70,10 @@ public class TargetEncoderExample {
Set<Integer> featuresIndexies = new HashSet<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9));
Set<Integer> targetEncodedfeaturesIndexies = new HashSet<>(Arrays.asList(1, 5, 6));
- Integer targetIndex = 0;
+ Integer targetIdx = 0;
final Vectorizer<Integer, Object[], Integer, Object> vectorizer =
- new ObjectArrayVectorizer<Integer>(featuresIndexies.toArray(new Integer[0])).labeled(targetIndex);
+ new ObjectArrayVectorizer<Integer>(featuresIndexies.toArray(new Integer[0])).labeled(targetIdx);
Preprocessor<Integer, Object[]> strEncoderPreprocessor = new EncoderTrainer<Integer, Object[]>()
.withEncoderType(EncoderType.STRING_ENCODER)
@@ -84,7 +84,7 @@ public class TargetEncoderExample {
vectorizer
);
- Preprocessor<Integer, Object[]> targetEncoderProcessor = new EncoderTrainer<Integer, Object[]>()
+ Preprocessor<Integer, Object[]> targetEncoderProc = new EncoderTrainer<Integer, Object[]>()
.withEncoderType(EncoderType.TARGET_ENCODER)
.labeled(0)
.withEncodedFeatures(targetEncodedfeaturesIndexies)
@@ -100,7 +100,7 @@ public class TargetEncoderExample {
.withEncoderType(EncoderType.LABEL_ENCODER)
.fit(ignite,
dataCache,
- targetEncoderProcessor
+ targetEncoderProc
);
GDBTrainer trainer = new GDBBinaryClassifierOnTreesTrainer(0.5, 500, 4, 0.)
diff --git a/modules/ml-ext/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesMLTestSuite.java b/modules/ml-ext/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesMLTestSuite.java
index 5b04a1a6..a32903e1 100644
--- a/modules/ml-ext/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesMLTestSuite.java
+++ b/modules/ml-ext/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesMLTestSuite.java
@@ -137,8 +137,8 @@ public class IgniteExamplesMLTestSuite {
dirs.add(new File(resources.nextElement().getFile()));
List<Class> classes = new ArrayList<>();
- for (File directory : dirs)
- classes.addAll(findClasses(directory, pkgName, clsNamePtrn));
+ for (File dir : dirs)
+ classes.addAll(findClasses(dir, pkgName, clsNamePtrn));
return classes;
}
diff --git a/modules/ml-ext/ml/catboost-model-parser/src/main/java/org/apache/ignite/ml/catboost/CatboostClassificationModel.java b/modules/ml-ext/ml/catboost-model-parser/src/main/java/org/apache/ignite/ml/catboost/CatboostClassificationModel.java
index 214d3710..9f9400d8 100644
--- a/modules/ml-ext/ml/catboost-model-parser/src/main/java/org/apache/ignite/ml/catboost/CatboostClassificationModel.java
+++ b/modules/ml-ext/ml/catboost-model-parser/src/main/java/org/apache/ignite/ml/catboost/CatboostClassificationModel.java
@@ -46,16 +46,21 @@ public class CatboostClassificationModel implements Model<NamedVector, Double> {
/** {@inheritDoc} */
@Override public Double predict(NamedVector input) {
float[] floatInput = new float[input.size()];
- int index = 0;
+ int idx = 0;
for (String key : model.getFeatureNames()) {
- floatInput[index] = (float)input.get(key);
- index++;
+ floatInput[idx] = (float)input.get(key);
+ idx++;
}
try {
double predict = model.predict(floatInput, model.getFeatureNames())
.get(0, 0);
- // use formula based on https://github.com/catboost/benchmarks/blob/61d62512f751325a14dd885bb71f8c2dabf7e24b/quality_benchmarks/catboost_experiment.py#L77
+
+ /***
+ * use formula based on
+ * https://github.com/
+ * catboost/benchmarks/blob/61d62512f751325a14dd885bb71f8c2dabf7e24b/quality_benchmarks/catboost_experiment.py#L77
+ */
return Math.pow(1 + Math.exp(-predict), -1);
}
catch (CatBoostError e) {
diff --git a/modules/ml-ext/ml/catboost-model-parser/src/main/java/org/apache/ignite/ml/catboost/CatboostRegressionModel.java b/modules/ml-ext/ml/catboost-model-parser/src/main/java/org/apache/ignite/ml/catboost/CatboostRegressionModel.java
index aec99263..d3d65deb 100644
--- a/modules/ml-ext/ml/catboost-model-parser/src/main/java/org/apache/ignite/ml/catboost/CatboostRegressionModel.java
+++ b/modules/ml-ext/ml/catboost-model-parser/src/main/java/org/apache/ignite/ml/catboost/CatboostRegressionModel.java
@@ -46,10 +46,10 @@ public class CatboostRegressionModel implements Model<NamedVector, Double> {
/** {@inheritDoc} */
@Override public Double predict(NamedVector input) {
float[] floatInput = new float[input.size()];
- int index = 0;
+ int idx = 0;
for (String key: model.getFeatureNames()) {
- floatInput[index] = (float)input.get(key);
- index++;
+ floatInput[idx] = (float)input.get(key);
+ idx++;
}
try {
diff --git a/modules/ml-ext/ml/spark-model-parser/src/main/java/org/apache/ignite/ml/sparkmodelparser/SparkModelParser.java b/modules/ml-ext/ml/spark-model-parser/src/main/java/org/apache/ignite/ml/sparkmodelparser/SparkModelParser.java
index 203cfd53..9eda0532 100644
--- a/modules/ml-ext/ml/spark-model-parser/src/main/java/org/apache/ignite/ml/sparkmodelparser/SparkModelParser.java
+++ b/modules/ml-ext/ml/spark-model-parser/src/main/java/org/apache/ignite/ml/sparkmodelparser/SparkModelParser.java
@@ -481,8 +481,8 @@ public class SparkModelParser {
final SimpleGroup g = (SimpleGroup)recordReader.read();
final int treeID = g.getInteger(0, 0);
- final SimpleGroup nodeDataGroup = (SimpleGroup)g.getGroup(1, 0);
- NodeData nodeData = extractNodeDataFromParquetRow(nodeDataGroup);
+ final SimpleGroup nodeDataGrp = (SimpleGroup)g.getGroup(1, 0);
+ NodeData nodeData = extractNodeDataFromParquetRow(nodeDataGrp);
if (nodesByTreeId.containsKey(treeID)) {
Map<Integer, NodeData> nodesByNodeId = nodesByTreeId.get(treeID);
@@ -545,9 +545,9 @@ public class SparkModelParser {
for (int i = 0; i < rows; i++) {
final SimpleGroup g = (SimpleGroup)recordReader.read();
final int treeID = g.getInteger(0, 0);
- final SimpleGroup nodeDataGroup = (SimpleGroup)g.getGroup(1, 0);
+ final SimpleGroup nodeDataGrp = (SimpleGroup)g.getGroup(1, 0);
- NodeData nodeData = extractNodeDataFromParquetRow(nodeDataGroup);
+ NodeData nodeData = extractNodeDataFromParquetRow(nodeDataGrp);
if (nodesByTreeId.containsKey(treeID)) {
Map<Integer, NodeData> nodesByNodeId = nodesByTreeId.get(treeID);
@@ -783,14 +783,14 @@ public class SparkModelParser {
*/
private static Vector readSVMCoefficients(SimpleGroup g) {
Vector coefficients;
- Group coeffGroup = g.getGroup(0, 0).getGroup(3, 0);
+ Group coeffGrp = g.getGroup(0, 0).getGroup(3, 0);
- final int amountOfCoefficients = coeffGroup.getFieldRepetitionCount(0);
+ final int amountOfCoefficients = coeffGrp.getFieldRepetitionCount(0);
coefficients = new DenseVector(amountOfCoefficients);
for (int j = 0; j < amountOfCoefficients; j++) {
- double coefficient = coeffGroup.getGroup(0, j).getDouble(0, 0);
+ double coefficient = coeffGrp.getGroup(0, j).getDouble(0, 0);
coefficients.set(j, coefficient);
}
return coefficients;
@@ -813,14 +813,14 @@ public class SparkModelParser {
*/
private static Vector readLinRegCoefficients(SimpleGroup g) {
Vector coefficients;
- Group coeffGroup = g.getGroup(1, 0).getGroup(3, 0);
+ Group coeffGrp = g.getGroup(1, 0).getGroup(3, 0);
- final int amountOfCoefficients = coeffGroup.getFieldRepetitionCount(0);
+ final int amountOfCoefficients = coeffGrp.getFieldRepetitionCount(0);
coefficients = new DenseVector(amountOfCoefficients);
for (int j = 0; j < amountOfCoefficients; j++) {
- double coefficient = coeffGroup.getGroup(0, j).getDouble(0, 0);
+ double coefficient = coeffGrp.getGroup(0, j).getDouble(0, 0);
coefficients.set(j, coefficient);
}
return coefficients;
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/clustering/gmm/GmmPartitionData.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/clustering/gmm/GmmPartitionData.java
index 29fa1ffa..87bca589 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/clustering/gmm/GmmPartitionData.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/clustering/gmm/GmmPartitionData.java
@@ -139,9 +139,9 @@ class GmmPartitionData implements AutoCloseable {
@Override public GmmPartitionData build(LearningEnvironment env, Iterator<UpstreamEntry<K, V>> upstreamData,
long upstreamDataSize, EmptyContext ctx) {
- int rowsCount = Math.toIntExact(upstreamDataSize);
- List<LabeledVector<Double>> xs = new ArrayList<>(rowsCount);
- double[][] pcxi = new double[rowsCount][countOfComponents];
+ int rowsCnt = Math.toIntExact(upstreamDataSize);
+ List<LabeledVector<Double>> xs = new ArrayList<>(rowsCnt);
+ double[][] pcxi = new double[rowsCnt][countOfComponents];
while (upstreamData.hasNext()) {
UpstreamEntry<K, V> entry = upstreamData.next();
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/clustering/gmm/GmmTrainer.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/clustering/gmm/GmmTrainer.java
index 3e47b81d..39dfcf6a 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/clustering/gmm/GmmTrainer.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/clustering/gmm/GmmTrainer.java
@@ -261,19 +261,19 @@ public class GmmTrainer extends SingleLabelDatasetTrainer<GmmModel> {
*/
private Optional<GmmModel> fit(Dataset<EmptyContext, GmmPartitionData> dataset) {
return init(dataset).map(model -> {
- GmmModel currentModel = model;
+ GmmModel curModel = model;
do {
- UpdateResult updateResult = updateModel(dataset, currentModel);
- currentModel = updateResult.model;
+ UpdateResult updateResult = updateModel(dataset, curModel);
+ curModel = updateResult.model;
- double minCompProb = currentModel.componentsProbs().minElement().get();
+ double minCompProb = curModel.componentsProbs().minElement().get();
if (countOfComponents >= maxCountOfClusters || minCompProb < minClusterProbability)
break;
double maxXProb = updateResult.maxProbInDataset;
NewComponentStatisticsAggregator newMeanAdder = NewComponentStatisticsAggregator.computeNewMean(dataset,
- maxXProb, maxLikelihoodDivergence, currentModel);
+ maxXProb, maxLikelihoodDivergence, curModel);
Vector newMean = newMeanAdder.mean();
if (newMeanAdder.rowCountForNewCluster() < minElementsForNewCluster)
@@ -281,21 +281,21 @@ public class GmmTrainer extends SingleLabelDatasetTrainer<GmmModel> {
countOfComponents += 1;
Vector[] newMeans = new Vector[countOfComponents];
- for (int i = 0; i < currentModel.countOfComponents(); i++)
- newMeans[i] = currentModel.distributions().get(i).mean();
+ for (int i = 0; i < curModel.countOfComponents(); i++)
+ newMeans[i] = curModel.distributions().get(i).mean();
newMeans[countOfComponents - 1] = newMean;
initialMeans = newMeans;
Optional<GmmModel> newModelOpt = init(dataset);
if (newModelOpt.isPresent())
- currentModel = newModelOpt.get();
+ curModel = newModelOpt.get();
else
break;
}
while (true);
- return filterModel(currentModel);
+ return filterModel(curModel);
});
}
@@ -379,7 +379,7 @@ public class GmmTrainer extends SingleLabelDatasetTrainer<GmmModel> {
*/
@NotNull private UpdateResult updateModel(Dataset<EmptyContext, GmmPartitionData> dataset, GmmModel model) {
boolean isConverged = false;
- int countOfIterations = 0;
+ int cntOfIterations = 0;
double maxProbInDataset = Double.NEGATIVE_INFINITY;
while (!isConverged) {
MeanWithClusterProbAggregator.AggregatedStats stats = MeanWithClusterProbAggregator.aggreateStats(dataset, countOfComponents);
@@ -394,8 +394,8 @@ public class GmmTrainer extends SingleLabelDatasetTrainer<GmmModel> {
List<MultivariateGaussianDistribution> components = buildComponents(newMeans, newCovs);
GmmModel newModel = new GmmModel(clusterProbs, components);
- countOfIterations += 1;
- isConverged = isConverged(model, newModel) || countOfIterations > maxCountOfIterations;
+ cntOfIterations += 1;
+ isConverged = isConverged(model, newModel) || cntOfIterations > maxCountOfIterations;
model = newModel;
maxProbInDataset = GmmPartitionData.updatePcxiAndComputeLikelihood(dataset, clusterProbs, components);
}
@@ -441,18 +441,18 @@ public class GmmTrainer extends SingleLabelDatasetTrainer<GmmModel> {
dataset.compute(data -> GmmPartitionData.estimateLikelihoodClusters(data, initialMeans));
- List<Matrix> initialCovs = CovarianceMatricesAggregator.computeCovariances(
+ List<Matrix> initCovs = CovarianceMatricesAggregator.computeCovariances(
dataset,
VectorUtils.fill(1. / countOfComponents, countOfComponents),
initialMeans
);
- if (initialCovs.isEmpty())
+ if (initCovs.isEmpty())
return Optional.empty();
List<MultivariateGaussianDistribution> distributions = new ArrayList<>();
for (int i = 0; i < countOfComponents; i++)
- distributions.add(new MultivariateGaussianDistribution(initialMeans[i], initialCovs.get(i)));
+ distributions.add(new MultivariateGaussianDistribution(initialMeans[i], initCovs.get(i)));
return Optional.of(new GmmModel(
VectorUtils.of(DoubleStream.generate(() -> 1. / countOfComponents).limit(countOfComponents).toArray()),
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/composition/predictionsaggregator/OnMajorityPredictionsAggregator.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/composition/predictionsaggregator/OnMajorityPredictionsAggregator.java
index 995faad2..d6f5dcf9 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/composition/predictionsaggregator/OnMajorityPredictionsAggregator.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/composition/predictionsaggregator/OnMajorityPredictionsAggregator.java
@@ -32,9 +32,9 @@ public final class OnMajorityPredictionsAggregator implements PredictionsAggrega
Map<Double, Integer> cntrsByCls = new HashMap<>();
- for (Double predictedValue : estimations) {
- Integer cntrVal = cntrsByCls.getOrDefault(predictedValue, 0) + 1;
- cntrsByCls.put(predictedValue, cntrVal);
+ for (Double predictedVal : estimations) {
+ Integer cntrVal = cntrsByCls.getOrDefault(predictedVal, 0) + 1;
+ cntrsByCls.put(predictedVal, cntrVal);
}
return cntrsByCls.entrySet().stream()
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDatasetBuilder.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDatasetBuilder.java
index c3d4135f..f323231b 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDatasetBuilder.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDatasetBuilder.java
@@ -140,13 +140,13 @@ public class CacheBasedDatasetBuilder<K, V> implements DatasetBuilder<K, V> {
// Retrieves affinity function of the upstream Ignite Cache.
CacheConfiguration<K, V> upstreamCacheConfiguration = upstreamCache.getConfiguration(CacheConfiguration.class);
- AffinityFunction upstreamCacheAffinity = upstreamCacheConfiguration.getAffinity();
+ AffinityFunction upstreamAff = upstreamCacheConfiguration.getAffinity();
// Creates dataset cache configuration with affinity function that mimics to affinity function of the upstream
// cache.
CacheConfiguration<Integer, C> datasetCacheConfiguration = new CacheConfiguration<>();
datasetCacheConfiguration.setName(String.format(DATASET_CACHE_TEMPLATE, upstreamCache.getName(), datasetId));
- datasetCacheConfiguration.setAffinity(new DatasetAffinityFunctionWrapper(upstreamCacheAffinity));
+ datasetCacheConfiguration.setAffinity(new DatasetAffinityFunctionWrapper(upstreamAff));
IgniteCache<Integer, C> datasetCache = ignite.createCache(datasetCacheConfiguration);
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/util/ComputeUtils.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/util/ComputeUtils.java
index 5b50c942..9873a6dd 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/util/ComputeUtils.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/util/ComputeUtils.java
@@ -92,8 +92,8 @@ public final class ComputeUtils {
String primaryCache = cacheNames.iterator().next();
- Affinity<?> affinity = ignite.affinity(primaryCache);
- int partitions = affinity.partitions();
+ Affinity<?> aff = ignite.affinity(primaryCache);
+ int partitions = aff.partitions();
BitSet completionFlags = new BitSet(partitions);
Collection<R> results = new ArrayList<>();
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/environment/deploy/DeployingContextImpl.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/environment/deploy/DeployingContextImpl.java
index b68bd84d..cc99035b 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/environment/deploy/DeployingContextImpl.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/environment/deploy/DeployingContextImpl.java
@@ -55,17 +55,17 @@ public class DeployingContextImpl implements DeployingContext, Serializable {
if (preprocessorCls != null)
logger.warn("Reinitialize deploying context [class=" + jobObj.getClass().getName() + "]");
- Object objectToDeploy = jobObj;
- while (objectToDeploy instanceof DeployableObject) {
- List<Object> deps = ((DeployableObject)objectToDeploy).getDependencies();
+ Object objToDeploy = jobObj;
+ while (objToDeploy instanceof DeployableObject) {
+ List<Object> deps = ((DeployableObject)objToDeploy).getDependencies();
if (deps.isEmpty())
break;
else
- objectToDeploy = deps.get(0);
+ objToDeploy = deps.get(0);
}
- assert objectToDeploy != null;
- preprocessorCls = objectToDeploy.getClass();
+ assert objToDeploy != null;
+ preprocessorCls = objToDeploy.getClass();
clientClsLdr = preprocessorCls.getClassLoader();
}
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/inference/json/JacksonHelper.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/inference/json/JacksonHelper.java
index 9763921f..b3b60b92 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/inference/json/JacksonHelper.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/inference/json/JacksonHelper.java
@@ -29,13 +29,13 @@ public class JacksonHelper {
/** */
public static void readAndValidateBasicJsonModelProperties(Path path, ObjectMapper mapper, String className) throws IOException {
Map jsonAsMap = mapper.readValue(new File(path.toAbsolutePath().toString()), LinkedHashMap.class);
- String formatVersion = jsonAsMap.get("formatVersion").toString();
+ String formatVer = jsonAsMap.get("formatVer").toString();
Long timestamp = (Long)jsonAsMap.get("timestamp");
String uid = jsonAsMap.get("uid").toString();
- String modelClass = jsonAsMap.get("modelClass").toString();
+ String modelCls = jsonAsMap.get("modelCls").toString();
- if (!modelClass.equals(className)) {
- throw new IllegalArgumentException("You are trying to load " + modelClass + " model to " + className);
+ if (!modelCls.equals(className)) {
+ throw new IllegalArgumentException("You are trying to load " + modelCls + " model to " + className);
}
}
}
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationModel.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationModel.java
index 014c2ec7..18ce1a1d 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationModel.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationModel.java
@@ -66,9 +66,9 @@ public class KNNClassificationModel extends KNNModel<Double> {
* @return Label with max votes for it.
*/
private Double election(List<LabeledVector<Double>> neighbours, Vector pnt) {
- Collection<GroupedNeighbours> groups = groupByLabel(neighbours);
+ Collection<GroupedNeighbours> grps = groupByLabel(neighbours);
- return election(groups, pnt);
+ return election(grps, pnt);
}
/**
@@ -119,21 +119,21 @@ public class KNNClassificationModel extends KNNModel<Double> {
* @return Collection of grouped neighbours (each group contains neighbours with the same label).
*/
private Collection<GroupedNeighbours> groupByLabel(List<LabeledVector<Double>> neighbours) {
- Map<Double, GroupedNeighbours> groups = new HashMap<>();
+ Map<Double, GroupedNeighbours> grps = new HashMap<>();
for (LabeledVector<Double> neighbour : neighbours) {
double lb = neighbour.label();
- GroupedNeighbours groupedNeighbours = groups.get(lb);
+ GroupedNeighbours groupedNeighbours = grps.get(lb);
if (groupedNeighbours == null) {
groupedNeighbours = new GroupedNeighbours(lb);
- groups.put(lb, groupedNeighbours);
+ grps.put(lb, groupedNeighbours);
}
groupedNeighbours.addNeighbour(neighbour.features());
}
- return Collections.unmodifiableCollection(groups.values());
+ return Collections.unmodifiableCollection(grps.values());
}
/**
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/Blas.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/Blas.java
index d29483d6..1dfdba9c 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/Blas.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/Blas.java
@@ -163,15 +163,15 @@ public class Blas implements Serializable {
double av;
double[] uData = u.getStorage().data();
- for (Integer nonDefaultInd : v.indexes()) {
- startInd += (nonDefaultInd - prevNonDfltInd) * (nonDefaultInd + prevNonDfltInd + 1) / 2;
- av = alpha * v.get(nonDefaultInd);
+ for (Integer nonDflt : v.indexes()) {
+ startInd += (nonDflt - prevNonDfltInd) * (nonDflt + prevNonDfltInd + 1) / 2;
+ av = alpha * v.get(nonDflt);
for (Integer i : v.indexes())
- if (i <= nonDefaultInd)
+ if (i <= nonDflt)
uData[startInd + i] += av * v.getX(i);
- prevNonDfltInd = nonDefaultInd;
+ prevNonDfltInd = nonDflt;
}
}
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/Tracer.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/Tracer.java
index 387c7d85..291a18af 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/Tracer.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/Tracer.java
@@ -402,8 +402,8 @@ public class Tracer {
if (isLabeled) {
Set<Double> lbls = values.stream().map(LabeledVector::label).collect(Collectors.toSet());
Random rnd = new Random(0);
- for (Double label : lbls)
- labelsMapping.put(label.intValue(), new Color(rnd.nextInt()));
+ for (Double lbl : lbls)
+ labelsMapping.put(lbl.intValue(), new Color(rnd.nextInt()));
}
showVectorsHtml(name, values, xIdx,
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/primitives/vector/impl/SparseVector.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/primitives/vector/impl/SparseVector.java
index fab7cd44..627c3bfe 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/primitives/vector/impl/SparseVector.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/math/primitives/vector/impl/SparseVector.java
@@ -90,8 +90,8 @@ public class SparseVector extends AbstractVector implements StorageConstants {
@Override public boolean tryAdvance(Consumer<? super Double> act) {
Set<Integer> indexes = storage().indexes();
- for (Integer index : indexes)
- act.accept(storageGet(index));
+ for (Integer idx : indexes)
+ act.accept(storageGet(idx));
return true;
}
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/compound/CompoundNaiveBayesModel.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/compound/CompoundNaiveBayesModel.java
index 005f64f6..65121436 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/compound/CompoundNaiveBayesModel.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/compound/CompoundNaiveBayesModel.java
@@ -182,12 +182,12 @@ public class CompoundNaiveBayesModel implements IgniteModel<Vector, Double>, Exp
int newSize = vector.size() - featureIdsToSkip.size();
double[] newFeaturesValues = new double[newSize];
- int index = 0;
+ int idx = 0;
for (int j = 0; j < vector.size(); j++) {
if (featureIdsToSkip.contains(j)) continue;
- newFeaturesValues[index] = vector.get(j);
- ++index;
+ newFeaturesValues[idx] = vector.get(j);
+ ++idx;
}
return VectorUtils.of(newFeaturesValues);
}
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/compound/CompoundNaiveBayesTrainer.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/compound/CompoundNaiveBayesTrainer.java
index 21689636..458b2926 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/compound/CompoundNaiveBayesTrainer.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/compound/CompoundNaiveBayesTrainer.java
@@ -153,12 +153,12 @@ public class CompoundNaiveBayesTrainer extends SingleLabelDatasetTrainer<Compoun
int newSize = size - featureIdsToSkip.size();
double[] newFeaturesValues = new double[newSize];
- int index = 0;
+ int idx = 0;
for (int j = 0; j < size; j++) {
if (featureIdsToSkip.contains(j)) continue;
- newFeaturesValues[index] = featureValues.get(j);
- ++index;
+ newFeaturesValues[idx] = featureValues.get(j);
+ ++idx;
}
return new LabeledVector<>(VectorUtils.of(newFeaturesValues), featureValues.label());
};
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/discrete/DiscreteNaiveBayesTrainer.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/discrete/DiscreteNaiveBayesTrainer.java
index a1d4c928..46c3b1f7 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/discrete/DiscreteNaiveBayesTrainer.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/discrete/DiscreteNaiveBayesTrainer.java
@@ -134,15 +134,15 @@ public class DiscreteNaiveBayesTrainer extends SingleLabelDatasetTrainer<Discret
int featureCnt = sumsHolder.valuesInBucketPerLbl.get(sortedLabels.get(0)).length;
double[][][] probabilities = new double[lbCnt][featureCnt][];
- double[] classProbabilities = new double[lbCnt];
+ double[] clsProbabilities = new double[lbCnt];
double[] labels = new double[lbCnt];
long datasetSize = sumsHolder.featureCountersPerLbl.values().stream().mapToInt(i -> i).sum();
int lbl = 0;
- for (Double label : sortedLabels) {
- int cnt = sumsHolder.featureCountersPerLbl.get(label);
- long[][] sum = sumsHolder.valuesInBucketPerLbl.get(label);
+ for (Double srtLbl : sortedLabels) {
+ int cnt = sumsHolder.featureCountersPerLbl.get(srtLbl);
+ long[][] sum = sumsHolder.valuesInBucketPerLbl.get(srtLbl);
for (int i = 0; i < featureCnt; i++) {
@@ -154,18 +154,18 @@ public class DiscreteNaiveBayesTrainer extends SingleLabelDatasetTrainer<Discret
}
if (equiprobableClasses)
- classProbabilities[lbl] = 1. / lbCnt;
+ clsProbabilities[lbl] = 1. / lbCnt;
else if (priorProbabilities != null) {
- assert classProbabilities.length == priorProbabilities.length;
- classProbabilities[lbl] = priorProbabilities[lbl];
+ assert clsProbabilities.length == priorProbabilities.length;
+ clsProbabilities[lbl] = priorProbabilities[lbl];
}
else
- classProbabilities[lbl] = (double)cnt / datasetSize;
+ clsProbabilities[lbl] = (double)cnt / datasetSize;
- labels[lbl] = label;
+ labels[lbl] = srtLbl;
++lbl;
}
- return new DiscreteNaiveBayesModel(probabilities, classProbabilities, labels, bucketThresholds, sumsHolder);
+ return new DiscreteNaiveBayesModel(probabilities, clsProbabilities, labels, bucketThresholds, sumsHolder);
}
catch (Exception e) {
throw new RuntimeException(e);
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/gaussian/GaussianNaiveBayesTrainer.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/gaussian/GaussianNaiveBayesTrainer.java
index 0875736e..794d1c20 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/gaussian/GaussianNaiveBayesTrainer.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/naivebayes/gaussian/GaussianNaiveBayesTrainer.java
@@ -74,27 +74,27 @@ public class GaussianNaiveBayesTrainer extends SingleLabelDatasetTrainer<Gaussia
LabeledVector lv = extractor.apply(entity.getKey(), entity.getValue());
Vector features = lv.features();
- Double label = (Double)lv.label();
+ Double lbl = (Double)lv.label();
double[] toMeans;
double[] sqSum;
- if (!res.featureSumsPerLbl.containsKey(label)) {
+ if (!res.featureSumsPerLbl.containsKey(lbl)) {
toMeans = new double[features.size()];
Arrays.fill(toMeans, 0.);
- res.featureSumsPerLbl.put(label, toMeans);
+ res.featureSumsPerLbl.put(lbl, toMeans);
}
- if (!res.featureSquaredSumsPerLbl.containsKey(label)) {
+ if (!res.featureSquaredSumsPerLbl.containsKey(lbl)) {
sqSum = new double[features.size()];
- res.featureSquaredSumsPerLbl.put(label, sqSum);
+ res.featureSquaredSumsPerLbl.put(lbl, sqSum);
}
- if (!res.featureCountersPerLbl.containsKey(label))
- res.featureCountersPerLbl.put(label, 0);
+ if (!res.featureCountersPerLbl.containsKey(lbl))
+ res.featureCountersPerLbl.put(lbl, 0);
- res.featureCountersPerLbl.put(label, res.featureCountersPerLbl.get(label) + 1);
+ res.featureCountersPerLbl.put(lbl, res.featureCountersPerLbl.get(lbl) + 1);
- toMeans = res.featureSumsPerLbl.get(label);
- sqSum = res.featureSquaredSumsPerLbl.get(label);
+ toMeans = res.featureSumsPerLbl.get(lbl);
+ sqSum = res.featureSquaredSumsPerLbl.get(lbl);
for (int j = 0; j < features.size(); j++) {
double x = features.get(j);
toMeans[j] += x;
@@ -118,42 +118,42 @@ public class GaussianNaiveBayesTrainer extends SingleLabelDatasetTrainer<Gaussia
sortedLabels.sort(Double::compareTo);
assert !sortedLabels.isEmpty() : "The dataset should contain at least one feature";
- int labelCount = sortedLabels.size();
- int featureCount = sumsHolder.featureSumsPerLbl.get(sortedLabels.get(0)).length;
+ int lblCnt = sortedLabels.size();
+ int featureCnt = sumsHolder.featureSumsPerLbl.get(sortedLabels.get(0)).length;
- double[][] means = new double[labelCount][featureCount];
- double[][] variances = new double[labelCount][featureCount];
- double[] classProbabilities = new double[labelCount];
- double[] labels = new double[labelCount];
+ double[][] means = new double[lblCnt][featureCnt];
+ double[][] variances = new double[lblCnt][featureCnt];
+ double[] clsProbabilities = new double[lblCnt];
+ double[] labels = new double[lblCnt];
long datasetSize = sumsHolder.featureCountersPerLbl.values().stream().mapToInt(i -> i).sum();
int lbl = 0;
- for (Double label : sortedLabels) {
- int count = sumsHolder.featureCountersPerLbl.get(label);
- double[] sum = sumsHolder.featureSumsPerLbl.get(label);
- double[] sqSum = sumsHolder.featureSquaredSumsPerLbl.get(label);
-
- for (int i = 0; i < featureCount; i++) {
- means[lbl][i] = sum[i] / count;
- variances[lbl][i] = (sqSum[i] - sum[i] * sum[i] / count) / count;
+ for (Double srtLbl : sortedLabels) {
+ int cnt = sumsHolder.featureCountersPerLbl.get(srtLbl);
+ double[] sum = sumsHolder.featureSumsPerLbl.get(srtLbl);
+ double[] sqSum = sumsHolder.featureSquaredSumsPerLbl.get(srtLbl);
+
+ for (int i = 0; i < featureCnt; i++) {
+ means[lbl][i] = sum[i] / cnt;
+ variances[lbl][i] = (sqSum[i] - sum[i] * sum[i] / cnt) / cnt;
}
if (equiprobableClasses)
- classProbabilities[lbl] = 1. / labelCount;
+ clsProbabilities[lbl] = 1. / lblCnt;
else if (priorProbabilities != null) {
- assert classProbabilities.length == priorProbabilities.length;
- classProbabilities[lbl] = priorProbabilities[lbl];
+ assert clsProbabilities.length == priorProbabilities.length;
+ clsProbabilities[lbl] = priorProbabilities[lbl];
}
else
- classProbabilities[lbl] = (double)count / datasetSize;
+ clsProbabilities[lbl] = (double)cnt / datasetSize;
- labels[lbl] = label;
+ labels[lbl] = srtLbl;
++lbl;
}
- return new GaussianNaiveBayesModel(means, variances, classProbabilities, labels, sumsHolder);
+ return new GaussianNaiveBayesModel(means, variances, clsProbabilities, labels, sumsHolder);
}
catch (Exception e) {
throw new RuntimeException(e);
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/preprocessing/encoding/EncoderTrainer.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/preprocessing/encoding/EncoderTrainer.java
index 5d01ac48..43c919d6 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/preprocessing/encoding/EncoderTrainer.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/preprocessing/encoding/EncoderTrainer.java
@@ -469,7 +469,7 @@ public class EncoderTrainer<K, V> implements PreprocessingTrainer<K, V> {
assert targetCounters.length == row.size() : "Base preprocessor must return exactly "
+ targetCounters.length + " features";
- double targetValue = row.features().get(targetLabelIndex);
+ double targetVal = row.features().get(targetLabelIndex);
for (int i = 0; i < targetCounters.length; i++) {
if (handledIndices.contains(i)) {
@@ -491,7 +491,7 @@ public class EncoderTrainer<K, V> implements PreprocessingTrainer<K, V> {
TargetCounter targetCounter = targetCounters[i];
targetCounter.setTargetCount(targetCounter.getTargetCount() + 1);
- targetCounter.setTargetSum(targetCounter.getTargetSum() + targetValue);
+ targetCounter.setTargetSum(targetCounter.getTargetSum() + targetVal);
Map<String, Long> categoryCounts = targetCounter.getCategoryCounts();
@@ -504,10 +504,10 @@ public class EncoderTrainer<K, V> implements PreprocessingTrainer<K, V> {
Map<String, Double> categoryTargetSum = targetCounter.getCategoryTargetSum();
if (categoryTargetSum.containsKey(strVal)) {
- categoryTargetSum.put(strVal, categoryTargetSum.get(strVal) + targetValue);
+ categoryTargetSum.put(strVal, categoryTargetSum.get(strVal) + targetVal);
}
else {
- categoryTargetSum.put(strVal, targetValue);
+ categoryTargetSum.put(strVal, targetVal);
}
}
}
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/preprocessing/encoding/onehotencoder/OneHotEncoderPreprocessor.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/preprocessing/encoding/onehotencoder/OneHotEncoderPreprocessor.java
index b1f8f34d..fabada37 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/preprocessing/encoding/onehotencoder/OneHotEncoderPreprocessor.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/preprocessing/encoding/onehotencoder/OneHotEncoderPreprocessor.java
@@ -122,9 +122,9 @@ public final class OneHotEncoderPreprocessor<K, V> extends EncoderPreprocessor<K
*/
private int getAdditionalSize(Map<String, Integer>[] encodingValues) {
int newSize = 0;
- for (Map<String, Integer> encodingValue : encodingValues) {
- if (encodingValue != null)
- newSize += encodingValue.size(); // - 1 if we don't keep NULL values and it has NULL values
+ for (Map<String, Integer> encodingVal : encodingValues) {
+ if (encodingVal != null)
+ newSize += encodingVal.size(); // - 1 if we don't keep NULL values and it has NULL values
}
return newSize;
}
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/selection/paramgrid/ParameterSetGenerator.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/selection/paramgrid/ParameterSetGenerator.java
index a2f76534..1998be59 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/selection/paramgrid/ParameterSetGenerator.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/selection/paramgrid/ParameterSetGenerator.java
@@ -83,8 +83,8 @@ public class ParameterSetGenerator {
Double[] valuesOfCurrDimension = map.get(dimensionNum);
- for (Double specificValue : valuesOfCurrDimension) {
- nextPnt[dimensionNum] = specificValue;
+ for (Double specificVal : valuesOfCurrDimension) {
+ nextPnt[dimensionNum] = specificVal;
traverseTree(map, nextPnt, dimensionNum);
}
}
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/DecisionTreeTrainer.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/DecisionTreeTrainer.java
index 0692ec62..d567eaef 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/DecisionTreeTrainer.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/DecisionTreeTrainer.java
@@ -224,13 +224,13 @@ public abstract class DecisionTreeTrainer<T extends ImpurityMeasure<T>> extends
for (int col = 0; col < criterionFunctions.length; col++) {
StepFunction<T> criterionFunctionForCol = criterionFunctions[col];
- double[] arguments = criterionFunctionForCol.getX();
+ double[] args = criterionFunctionForCol.getX();
T[] values = criterionFunctionForCol.getY();
for (int leftSize = 1; leftSize < values.length - 1; leftSize++) {
if ((values[0].impurity() - values[leftSize].impurity()) > minImpurityDecrease
&& (res == null || values[leftSize].compareTo(res.val) < 0))
- res = new SplitPoint<>(values[leftSize], col, calculateThreshold(arguments, leftSize));
+ res = new SplitPoint<>(values[leftSize], col, calculateThreshold(args, leftSize));
}
}
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/impurity/util/SimpleStepFunctionCompressor.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/impurity/util/SimpleStepFunctionCompressor.java
index 24185710..39fe986b 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/impurity/util/SimpleStepFunctionCompressor.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/impurity/util/SimpleStepFunctionCompressor.java
@@ -63,14 +63,14 @@ public class SimpleStepFunctionCompressor<T extends ImpurityMeasure<T>> implemen
/** {@inheritDoc} */
@Override public StepFunction<T> compress(StepFunction<T> function) {
- double[] arguments = function.getX();
+ double[] args = function.getX();
T[] values = function.getY();
- if (arguments.length >= minSizeToBeCompressed) {
+ if (args.length >= minSizeToBeCompressed) {
List<StepFunctionPoint> points = new ArrayList<>();
- for (int i = 0; i < arguments.length; i++)
- points.add(new StepFunctionPoint(arguments[i], values[i]));
+ for (int i = 0; i < args.length; i++)
+ points.add(new StepFunctionPoint(args[i], values[i]));
points = compress(points);
diff --git a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/randomforest/RandomForestClassifierTrainer.java b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/randomforest/RandomForestClassifierTrainer.java
index ab8db2e5..9679906c 100644
--- a/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/randomforest/RandomForestClassifierTrainer.java
+++ b/modules/ml-ext/ml/src/main/java/org/apache/ignite/ml/tree/randomforest/RandomForestClassifierTrainer.java
@@ -90,8 +90,8 @@ public class RandomForestClassifierTrainer
return false;
int i = 0;
- for (Double label : uniqLabels)
- lblMapping.put(label, i++);
+ for (Double lbl : uniqLabels)
+ lblMapping.put(lbl, i++);
return super.init(dataset);
}
diff --git a/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/clustering/gmm/NewComponentStatisticsAggregatorTest.java b/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/clustering/gmm/NewComponentStatisticsAggregatorTest.java
index 83a4f17a..54e60d69 100644
--- a/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/clustering/gmm/NewComponentStatisticsAggregatorTest.java
+++ b/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/clustering/gmm/NewComponentStatisticsAggregatorTest.java
@@ -74,12 +74,12 @@ public class NewComponentStatisticsAggregatorTest {
@Test
public void testAdd() {
NewComponentStatisticsAggregator agg = new NewComponentStatisticsAggregator();
- int rowCount = 10;
- for (int i = 0; i < rowCount; i++)
+ int rowCnt = 10;
+ for (int i = 0; i < rowCnt; i++)
agg.add(VectorUtils.of(0, 1, 2), i % 2 == 0);
- assertEquals(rowCount / 2, agg.rowCountForNewCluster());
- assertEquals(rowCount, agg.totalRowCount());
+ assertEquals(rowCnt / 2, agg.rowCountForNewCluster());
+ assertEquals(rowCnt, agg.totalRowCount());
assertArrayEquals(new double[] {0, 1, 2}, agg.mean().asArray(), 1e-4);
}
@@ -88,16 +88,16 @@ public class NewComponentStatisticsAggregatorTest {
public void testPlus() {
NewComponentStatisticsAggregator agg1 = new NewComponentStatisticsAggregator();
NewComponentStatisticsAggregator agg2 = new NewComponentStatisticsAggregator();
- int rowCount = 10;
- for (int i = 0; i < rowCount; i++)
+ int rowCnt = 10;
+ for (int i = 0; i < rowCnt; i++)
agg1.add(VectorUtils.of(0, 1, 2), i % 2 == 0);
- for (int i = 0; i < rowCount; i++)
+ for (int i = 0; i < rowCnt; i++)
agg2.add(VectorUtils.of(2, 1, 0), i % 2 == 1);
NewComponentStatisticsAggregator sum = agg1.plus(agg2);
- assertEquals(rowCount, sum.rowCountForNewCluster());
- assertEquals(rowCount * 2, sum.totalRowCount());
+ assertEquals(rowCnt, sum.rowCountForNewCluster());
+ assertEquals(rowCnt * 2, sum.totalRowCount());
assertArrayEquals(new double[] {1, 1, 1}, sum.mean().asArray(), 1e-4);
}
diff --git a/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDatasetBuilderTest.java b/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDatasetBuilderTest.java
index 55c9a160..e5c600c5 100644
--- a/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDatasetBuilderTest.java
+++ b/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDatasetBuilderTest.java
@@ -71,17 +71,17 @@ public class CacheBasedDatasetBuilderTest extends GridCommonAbstractTest {
TestUtils.testEnvBuilder().buildForTrainer()
);
- Affinity<Integer> upstreamAffinity = ignite.affinity(upstreamCache.getName());
- Affinity<Integer> datasetAffinity = ignite.affinity(dataset.getDatasetCache().getName());
+ Affinity<Integer> upstreamAff = ignite.affinity(upstreamCache.getName());
+ Affinity<Integer> datasetAff = ignite.affinity(dataset.getDatasetCache().getName());
- int upstreamPartitions = upstreamAffinity.partitions();
- int datasetPartitions = datasetAffinity.partitions();
+ int upstreamPartitions = upstreamAff.partitions();
+ int datasetPartitions = datasetAff.partitions();
assertEquals(upstreamPartitions, datasetPartitions);
for (int part = 0; part < upstreamPartitions; part++) {
- Collection<ClusterNode> upstreamPartNodes = upstreamAffinity.mapPartitionToPrimaryAndBackups(part);
- Collection<ClusterNode> datasetPartNodes = datasetAffinity.mapPartitionToPrimaryAndBackups(part);
+ Collection<ClusterNode> upstreamPartNodes = upstreamAff.mapPartitionToPrimaryAndBackups(part);
+ Collection<ClusterNode> datasetPartNodes = datasetAff.mapPartitionToPrimaryAndBackups(part);
assertEqualsCollections(upstreamPartNodes, datasetPartNodes);
}
diff --git a/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/math/distances/DistanceTest.java b/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/math/distances/DistanceTest.java
index 40949c49..fcd35086 100644
--- a/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/math/distances/DistanceTest.java
+++ b/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/math/distances/DistanceTest.java
@@ -68,9 +68,9 @@ public class DistanceTest {
public void distanceFromPointToItselfIsZero() {
DISTANCE_MEASURES.forEach(distance -> {
Vector vector = randomVector(3);
- String errorMessage = errorMessage(distance, vector, vector);
+ String errMsg = errorMessage(distance, vector, vector);
- assertEquals(errorMessage, 0d, distance.compute(vector, vector), PRECISION);
+ assertEquals(errMsg, 0d, distance.compute(vector, vector), PRECISION);
});
}
@@ -80,9 +80,9 @@ public class DistanceTest {
DISTANCE_MEASURES.forEach(distance -> {
Vector vector1 = randomVector(3);
Vector vector2 = randomVector(3);
- String errorMessage = errorMessage(distance, vector1, vector2);
+ String errMsg = errorMessage(distance, vector1, vector2);
- assertEquals(errorMessage,
+ assertEquals(errMsg,
distance.compute(vector1, vector2), distance.compute(vector2, vector1), PRECISION);
});
}
@@ -93,9 +93,9 @@ public class DistanceTest {
DISTANCE_MEASURES.forEach(distance -> {
Vector vector1 = randomVector(3);
Vector vector2 = randomVector(3);
- String errorMessage = errorMessage(distance, vector1, vector2);
+ String errMsg = errorMessage(distance, vector1, vector2);
- assertTrue(errorMessage, distance.compute(vector1, vector2) > 0);
+ assertTrue(errMsg, distance.compute(vector1, vector2) > 0);
});
}
diff --git a/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/naivebayes/discrete/DiscreteNaiveBayesModelTest.java b/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/naivebayes/discrete/DiscreteNaiveBayesModelTest.java
index 7d6d4940..d863e132 100644
--- a/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/naivebayes/discrete/DiscreteNaiveBayesModelTest.java
+++ b/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/naivebayes/discrete/DiscreteNaiveBayesModelTest.java
@@ -34,9 +34,9 @@ public class DiscreteNaiveBayesModelTest {
{{0, 1}, {1. / 7, 2. / 7, 4. / 7}, {4. / 7, 3. / 7}, {2. / 7, 3. / 7, 2. / 7}, {4. / 7, 3. / 7}}
};
- double[] classProbabilities = new double[] {6. / 13, 7. / 13};
+ double[] clsProbabilities = new double[] {6. / 13, 7. / 13};
double[][] thresholds = new double[][] {{.5}, {.2, .7}, {.5}, {.5, 1.5}, {.5}};
- DiscreteNaiveBayesModel mdl = new DiscreteNaiveBayesModel(probabilities, classProbabilities,
+ DiscreteNaiveBayesModel mdl = new DiscreteNaiveBayesModel(probabilities, clsProbabilities,
new double[] {first, second}, thresholds, new DiscreteNaiveBayesSumsHolder());
Vector observation = VectorUtils.of(2, 0, 1, 2, 0);
diff --git a/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/preprocessing/encoding/EncoderTrainerTest.java b/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/preprocessing/encoding/EncoderTrainerTest.java
index faae5602..79f4286b 100644
--- a/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/preprocessing/encoding/EncoderTrainerTest.java
+++ b/modules/ml-ext/ml/src/test/java/org/apache/ignite/ml/preprocessing/encoding/EncoderTrainerTest.java
@@ -239,10 +239,10 @@ public class EncoderTrainerTest extends TrainerTest {
DatasetBuilder<Integer, Object[]> datasetBuilder = new LocalDatasetBuilder<>(data, parts);
- EncoderTrainer<Integer, Object[]> labelEncoderTrainer = new EncoderTrainer<Integer, Object[]>()
+ EncoderTrainer<Integer, Object[]> lblEncTrainer = new EncoderTrainer<Integer, Object[]>()
.withEncoderType(EncoderType.LABEL_ENCODER);
- EncoderPreprocessor<Integer, Object[]> preprocessor = labelEncoderTrainer.fit(
+ EncoderPreprocessor<Integer, Object[]> preprocessor = lblEncTrainer.fit(
TestUtils.testEnvBuilder(),
datasetBuilder,
vectorizer
diff --git a/modules/ml-ext/ml/xgboost-model-parser/src/test/java/org/apache/ignite/ml/xgboost/parser/XGBoostModelParserTest.java b/modules/ml-ext/ml/xgboost-model-parser/src/test/java/org/apache/ignite/ml/xgboost/parser/XGBoostModelParserTest.java
index cdae686b..db667753 100644
--- a/modules/ml-ext/ml/xgboost-model-parser/src/test/java/org/apache/ignite/ml/xgboost/parser/XGBoostModelParserTest.java
+++ b/modules/ml-ext/ml/xgboost-model-parser/src/test/java/org/apache/ignite/ml/xgboost/parser/XGBoostModelParserTest.java
@@ -67,8 +67,8 @@ public class XGBoostModelParserTest {
HashMap<String, Double> testObj = new HashMap<>();
- for (String keyValueString : testDataStr.split(" ")) {
- String[] keyVal = keyValueString.split(":");
+ for (String keyValStr : testDataStr.split(" ")) {
+ String[] keyVal = keyValStr.split(":");
if (keyVal.length == 2)
testObj.put("f" + keyVal[0], Double.parseDouble(keyVal[1]));
diff --git a/modules/mqtt-ext/pom.xml b/modules/mqtt-ext/pom.xml
index 8de15e4d..7577e9f1 100644
--- a/modules/mqtt-ext/pom.xml
+++ b/modules/mqtt-ext/pom.xml
@@ -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>
diff --git a/modules/osgi-ext/osgi-karaf/pom.xml b/modules/osgi-ext/osgi-karaf/pom.xml
index 6aa8fb68..46da530b 100644
--- a/modules/osgi-ext/osgi-karaf/pom.xml
+++ b/modules/osgi-ext/osgi-karaf/pom.xml
@@ -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>
diff --git a/modules/osgi-ext/osgi/pom.xml b/modules/osgi-ext/osgi/pom.xml
index 420b056b..ea6a982f 100644
--- a/modules/osgi-ext/osgi/pom.xml
+++ b/modules/osgi-ext/osgi/pom.xml
@@ -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>
diff --git a/modules/osgi-ext/osgi/src/main/java/org/apache/ignite/osgi/classloaders/BundleDelegatingClassLoader.java b/modules/osgi-ext/osgi/src/main/java/org/apache/ignite/osgi/classloaders/BundleDelegatingClassLoader.java
index 36f18566..3558ea7f 100644
--- a/modules/osgi-ext/osgi/src/main/java/org/apache/ignite/osgi/classloaders/BundleDelegatingClassLoader.java
+++ b/modules/osgi-ext/osgi/src/main/java/org/apache/ignite/osgi/classloaders/BundleDelegatingClassLoader.java
@@ -63,12 +63,12 @@ public class BundleDelegatingClassLoader extends ClassLoader {
/** {@inheritDoc} */
@Override protected URL findResource(String name) {
- URL resource = bundle.getResource(name);
+ URL rsrc = bundle.getResource(name);
- if (resource == null && clsLdr != null)
- resource = clsLdr.getResource(name);
+ if (rsrc == null && clsLdr != null)
+ rsrc = clsLdr.getResource(name);
- return resource;
+ return rsrc;
}
/** {@inheritDoc} */
diff --git a/modules/osgi-ext/osgi/src/test/java/org/apache/ignite/osgi/activators/BasicIgniteTestActivator.java b/modules/osgi-ext/osgi/src/test/java/org/apache/ignite/osgi/activators/BasicIgniteTestActivator.java
index b43a2f61..37d0e1ae 100644
--- a/modules/osgi-ext/osgi/src/test/java/org/apache/ignite/osgi/activators/BasicIgniteTestActivator.java
+++ b/modules/osgi-ext/osgi/src/test/java/org/apache/ignite/osgi/activators/BasicIgniteTestActivator.java
@@ -35,11 +35,11 @@ public class BasicIgniteTestActivator extends IgniteAbstractOsgiContextActivator
* @return Ignite config.
*/
@Override public IgniteConfiguration igniteConfiguration() {
- IgniteConfiguration config = new IgniteConfiguration();
+ IgniteConfiguration cfg = new IgniteConfiguration();
- config.setIgniteInstanceName("testGrid");
+ cfg.setIgniteInstanceName("testGrid");
- return config;
+ return cfg;
}
/**
diff --git a/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportBuilder.java b/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportBuilder.java
index 2296bdcc..1560ed52 100644
--- a/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportBuilder.java
+++ b/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportBuilder.java
@@ -125,8 +125,8 @@ public class PerformanceStatisticsReportBuilder {
ObjectNode dataJson = MAPPER.createObjectNode();
- for (IgnitePerformanceStatisticsHandler handler : handlers)
- handler.results().forEach(dataJson::set);
+ for (IgnitePerformanceStatisticsHandler hnd : handlers)
+ hnd.results().forEach(dataJson::set);
writeJsonToFile(resDir + "/data/data.json", dataJson);
@@ -210,14 +210,14 @@ public class PerformanceStatisticsReportBuilder {
ZipEntry entry;
while ((entry = zip.getNextEntry()) != null) {
- File entryDestination = new File(resDir, entry.getName());
+ File entryDest = new File(resDir, entry.getName());
if (entry.isDirectory())
- entryDestination.mkdirs();
+ entryDest.mkdirs();
else {
- entryDestination.getParentFile().mkdirs();
+ entryDest.getParentFile().mkdirs();
- try (OutputStream out = new FileOutputStream(entryDestination)) {
+ try (OutputStream out = new FileOutputStream(entryDest)) {
IOUtils.copy(zip, out);
}
}
diff --git a/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java b/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java
index d2143418..770c7239 100644
--- a/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java
+++ b/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java
@@ -126,11 +126,11 @@ public class PerformanceStatisticsReportSelfTest {
File report = reportDir[0];
- File index = new File(report.getAbsolutePath() + File.separatorChar + "index.html");
+ File idx = new File(report.getAbsolutePath() + File.separatorChar + "index.html");
File dataDir = new File(report.getAbsolutePath() + File.separatorChar + "data");
File dataJs = new File(dataDir.getAbsolutePath() + File.separatorChar + "data.json.js");
- assertTrue(index.exists());
+ assertTrue(idx.exists());
assertTrue(dataDir.exists());
assertTrue(dataJs.exists());
}
diff --git a/modules/pub-sub-ext/pom.xml b/modules/pub-sub-ext/pom.xml
index 7591a862..1f3e594f 100644
--- a/modules/pub-sub-ext/pom.xml
+++ b/modules/pub-sub-ext/pom.xml
@@ -91,4 +91,4 @@
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
diff --git a/modules/pub-sub-ext/src/main/java/org/apache/ignite/stream/pubsub/PubSubStreamer.java b/modules/pub-sub-ext/src/main/java/org/apache/ignite/stream/pubsub/PubSubStreamer.java
index b626b411..cc8edf53 100644
--- a/modules/pub-sub-ext/src/main/java/org/apache/ignite/stream/pubsub/PubSubStreamer.java
+++ b/modules/pub-sub-ext/src/main/java/org/apache/ignite/stream/pubsub/PubSubStreamer.java
@@ -227,27 +227,27 @@ public class PubSubStreamer<K, V> extends StreamAdapter<PubsubMessage, K, V> {
@Override public Void call() throws Exception {
try {
while (!stopped) {
- PullRequest pullRequest =
+ PullRequest pullReq =
PullRequest.newBuilder()
.setMaxMessages(maxMessages)
.setReturnImmediately(returnImmediately) // return immediately if messages are not available
.setSubscription(subscriptionName)
.build();
- PullResponse pullResponse = subscriberStub.pullCallable().call(pullRequest);
+ PullResponse pullRes = subscriberStub.pullCallable().call(pullReq);
List<String> ackIds = new ArrayList<>();
- for (ReceivedMessage message : pullResponse.getReceivedMessagesList()) {
- addMessage(message.getMessage());
- ackIds.add(message.getAckId());
+ for (ReceivedMessage msg : pullRes.getReceivedMessagesList()) {
+ addMessage(msg.getMessage());
+ ackIds.add(msg.getAckId());
}
- AcknowledgeRequest acknowledgeRequest = AcknowledgeRequest.newBuilder()
+ AcknowledgeRequest acknowledgeReq = AcknowledgeRequest.newBuilder()
.setSubscription(subscriptionName)
.addAllAckIds(ackIds)
.build();
- subscriberStub.acknowledgeCallable().call(acknowledgeRequest);
+ subscriberStub.acknowledgeCallable().call(acknowledgeReq);
}
}
finally {
diff --git a/modules/pub-sub-ext/src/test/java/org/apache/ignite/stream/pubsub/MockPubSubServer.java b/modules/pub-sub-ext/src/test/java/org/apache/ignite/stream/pubsub/MockPubSubServer.java
index 8026a29d..d024913d 100644
--- a/modules/pub-sub-ext/src/test/java/org/apache/ignite/stream/pubsub/MockPubSubServer.java
+++ b/modules/pub-sub-ext/src/test/java/org/apache/ignite/stream/pubsub/MockPubSubServer.java
@@ -115,10 +115,10 @@ class MockPubSubServer {
private ClientCall<AcknowledgeRequest, Empty> acknowledgeCall() {
ClientCall<AcknowledgeRequest, Empty> clientCall = Mockito.mock(ClientCall.class);
doAnswer(iom -> {
- Object[] arguments = iom.getArguments();
- ClientCall.Listener<Empty> listener = (ClientCall.Listener<Empty>)arguments[0];
+ Object[] args = iom.getArguments();
+ ClientCall.Listener<Empty> listener = (ClientCall.Listener<Empty>)args[0];
listener.onMessage(Empty.getDefaultInstance());
- Metadata metadata = (Metadata)arguments[1];
+ Metadata metadata = (Metadata)args[1];
listener.onClose(Status.OK, metadata);
return null;
}
@@ -132,9 +132,9 @@ class MockPubSubServer {
doAnswer(
iom -> {
- Object[] arguments = iom.getArguments();
- ClientCall.Listener<PullResponse> listener = (ClientCall.Listener<PullResponse>)arguments[0];
- Metadata metadata = (Metadata)arguments[1];
+ Object[] args = iom.getArguments();
+ ClientCall.Listener<PullResponse> listener = (ClientCall.Listener<PullResponse>)args[0];
+ Metadata metadata = (Metadata)args[1];
pullMessages(listener, metadata);
return null;
}
@@ -144,7 +144,7 @@ class MockPubSubServer {
/** */
private void pullMessages(ClientCall.Listener<PullResponse> listener, Metadata metadata) {
- PullResponse.Builder pullResponse = PullResponse.newBuilder();
+ PullResponse.Builder pullRes = PullResponse.newBuilder();
try {
for (int i = 0; i < MESSAGES_PER_REQUEST; i++) {
@@ -153,14 +153,14 @@ class MockPubSubServer {
if (msg == null)
break;
- pullResponse.addReceivedMessages(ReceivedMessage.newBuilder().mergeMessage(msg).build());
+ pullRes.addReceivedMessages(ReceivedMessage.newBuilder().mergeMessage(msg).build());
}
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
- listener.onMessage(pullResponse.build());
+ listener.onMessage(pullRes.build());
listener.onClose(Status.OK, metadata);
}
@@ -180,8 +180,8 @@ class MockPubSubServer {
when(publisher.publish(any(PubsubMessage.class))).thenAnswer(
(iom) -> {
- PubsubMessage pubsubMessage = (PubsubMessage)iom.getArguments()[0];
- blockingQueue.add(pubsubMessage);
+ PubsubMessage pubsubMsg = (PubsubMessage)iom.getArguments()[0];
+ blockingQueue.add(pubsubMsg);
return ApiFutures.immediateFuture(UUID.randomUUID().toString());
}
);
diff --git a/modules/pub-sub-ext/src/test/java/org/apache/ignite/stream/pubsub/PubSubStreamerSelfTest.java b/modules/pub-sub-ext/src/test/java/org/apache/ignite/stream/pubsub/PubSubStreamerSelfTest.java
index e0361bee..4608e5f1 100644
--- a/modules/pub-sub-ext/src/test/java/org/apache/ignite/stream/pubsub/PubSubStreamerSelfTest.java
+++ b/modules/pub-sub-ext/src/test/java/org/apache/ignite/stream/pubsub/PubSubStreamerSelfTest.java
@@ -234,7 +234,7 @@ public class PubSubStreamerSelfTest {
Collections.shuffle(subnet);
- List<PubsubMessage> messages = new ArrayList<>();
+ List<PubsubMessage> pubMsg = new ArrayList<>();
Map<String, String> keyValMap = new HashMap<>();
@@ -245,18 +245,18 @@ public class PubSubStreamerSelfTest {
String msg = runtime + VALUE_URL + ip;
- JsonObject jsonObject = new JsonObject();
- jsonObject.addProperty(JSON_KEY, ip);
- jsonObject.addProperty(JSON_VALUE, msg);
+ JsonObject jsonObj = new JsonObject();
+ jsonObj.addProperty(JSON_KEY, ip);
+ jsonObj.addProperty(JSON_VALUE, msg);
- ByteString byteString = ByteString.copyFrom(jsonObject.toString(), Charset.defaultCharset());
+ ByteString byteStr = ByteString.copyFrom(jsonObj.toString(), Charset.defaultCharset());
- PubsubMessage pubsubMessage = PubsubMessage.newBuilder()
- .setData(byteString)
+ PubsubMessage pubsubMsg = PubsubMessage.newBuilder()
+ .setData(byteStr)
.build();
- messages.add(pubsubMessage);
- String messageId = mockPubSubServer.getPublisher(TOPIC_NAME).publish(pubsubMessage).get();
+ pubMsg.add(pubsubMsg);
+ String msgId = mockPubSubServer.getPublisher(TOPIC_NAME).publish(pubsubMsg).get();
keyValMap.put(ip, msg);
}
@@ -272,8 +272,8 @@ public class PubSubStreamerSelfTest {
@Override public Map.Entry<String, String> extract(PubsubMessage msg) {
String dataStr = msg.getData().toStringUtf8();
JsonElement jsonElement = new JsonParser().parse(dataStr).getAsJsonObject();
- JsonObject jsonObject = jsonElement.getAsJsonObject();
- return new GridMapEntry<>(jsonObject.get(JSON_KEY).getAsString(), jsonObject.get(JSON_VALUE).getAsString());
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ return new GridMapEntry<>(jsonObj.get(JSON_KEY).getAsString(), jsonObj.get(JSON_VALUE).getAsString());
}
};
}
@@ -286,16 +286,16 @@ public class PubSubStreamerSelfTest {
@Override public Map<String, String> extract(PubsubMessage msg) {
String dataStr = msg.getData().toStringUtf8();
JsonElement jsonElement = new JsonParser().parse(dataStr).getAsJsonObject();
- JsonArray jsonArray = jsonElement.getAsJsonArray();
+ JsonArray jsonArr = jsonElement.getAsJsonArray();
final Map<String, String> answer = new HashMap<>();
- for (int i = 0; i < jsonArray.size(); i++) {
- JsonObject jsonObject = jsonArray.get(i).getAsJsonObject();
- String key = jsonObject.get(JSON_KEY).getAsString();
- String value = jsonObject.get(JSON_VALUE).getAsString();
+ for (int i = 0; i < jsonArr.size(); i++) {
+ JsonObject jsonObj = jsonArr.get(i).getAsJsonObject();
+ String key = jsonObj.get(JSON_KEY).getAsString();
+ String val = jsonObj.get(JSON_VALUE).getAsString();
- answer.put(key, value);
+ answer.put(key, val);
}
return answer;
diff --git a/modules/rocketmq-ext/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTest.java b/modules/rocketmq-ext/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTest.java
index 534f8d4d..4a9b86ee 100644
--- a/modules/rocketmq-ext/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTest.java
+++ b/modules/rocketmq-ext/src/test/java/org/apache/ignite/stream/rocketmq/RocketMQStreamerTest.java
@@ -194,22 +194,22 @@ public class RocketMQStreamerTest extends GridCommonAbstractTest {
* @throws IgniteInterruptedCheckedException If fails.
*/
private void initTopic(String topic, String nsAddr) throws Exception {
- DefaultMQAdminExt defaultMQAdminExt = new DefaultMQAdminExt();
- defaultMQAdminExt.setNamesrvAddr(nsAddr);
+ DefaultMQAdminExt dfltMQAdminExt = new DefaultMQAdminExt();
+ dfltMQAdminExt.setNamesrvAddr(nsAddr);
try {
- defaultMQAdminExt.start();
+ dfltMQAdminExt.start();
- TopicConfig topicConfig = new TopicConfig();
- topicConfig.setTopicName(topic);
- topicConfig.setReadQueueNums(4);
- topicConfig.setWriteQueueNums(4);
+ TopicConfig topicCfg = new TopicConfig();
+ topicCfg.setTopicName(topic);
+ topicCfg.setReadQueueNums(4);
+ topicCfg.setWriteQueueNums(4);
- defaultMQAdminExt.createAndUpdateTopicConfig(testRocketMQServer.getBrokerAddr(), topicConfig);
+ dfltMQAdminExt.createAndUpdateTopicConfig(testRocketMQServer.getBrokerAddr(), topicCfg);
U.sleep(100);
}
finally {
- defaultMQAdminExt.shutdown();
+ dfltMQAdminExt.shutdown();
}
}
}
diff --git a/modules/rocketmq-ext/src/test/java/org/apache/ignite/stream/rocketmq/TestRocketMQServer.java b/modules/rocketmq-ext/src/test/java/org/apache/ignite/stream/rocketmq/TestRocketMQServer.java
index beece8ef..39a8add9 100644
--- a/modules/rocketmq-ext/src/test/java/org/apache/ignite/stream/rocketmq/TestRocketMQServer.java
+++ b/modules/rocketmq-ext/src/test/java/org/apache/ignite/stream/rocketmq/TestRocketMQServer.java
@@ -83,13 +83,13 @@ class TestRocketMQServer {
* @throws Exception If fails.
*/
private void startNameServer() throws Exception {
- NamesrvConfig namesrvConfig = new NamesrvConfig();
- NettyServerConfig nameServerNettyServerConfig = new NettyServerConfig();
+ NamesrvConfig nameSrvCfg = new NamesrvConfig();
+ NettyServerConfig nameServerNettyServerCfg = new NettyServerConfig();
- namesrvConfig.setKvConfigPath(System.getProperty("java.io.tmpdir") + separator + "namesrv" + separator + "kvConfig.json");
- nameServerNettyServerConfig.setListenPort(NAME_SERVER_PORT);
+ nameSrvCfg.setKvConfigPath(System.getProperty("java.io.tmpdir") + separator + "namesrv" + separator + "kvConfig.json");
+ nameServerNettyServerCfg.setListenPort(NAME_SERVER_PORT);
- nameSrv = new NamesrvController(namesrvConfig, nameServerNettyServerConfig);
+ nameSrv = new NamesrvController(nameSrvCfg, nameServerNettyServerCfg);
nameSrv.initialize();
nameSrv.start();
diff --git a/modules/spark-ext/examples/src/main/java/org/apache/ignite/examples/spark/JavaIgniteCatalogExample.java b/modules/spark-ext/examples/src/main/java/org/apache/ignite/examples/spark/JavaIgniteCatalogExample.java
index e04ea0a6..1867eafe 100644
--- a/modules/spark-ext/examples/src/main/java/org/apache/ignite/examples/spark/JavaIgniteCatalogExample.java
+++ b/modules/spark-ext/examples/src/main/java/org/apache/ignite/examples/spark/JavaIgniteCatalogExample.java
@@ -51,7 +51,7 @@ public class JavaIgniteCatalogExample {
setupServerAndData();
//Creating Ignite-specific implementation of Spark session.
- IgniteSparkSession igniteSession = IgniteSparkSession.builder()
+ IgniteSparkSession igniteSes = IgniteSparkSession.builder()
.appName("Spark Ignite catalog example")
.master("local")
.config("spark.executor.instances", "2")
@@ -65,22 +65,22 @@ public class JavaIgniteCatalogExample {
System.out.println("List of available tables:");
//Showing existing tables.
- igniteSession.catalog().listTables().show();
+ igniteSes.catalog().listTables().show();
System.out.println("PERSON table description:");
//Showing `person` schema.
- igniteSession.catalog().listColumns("person").show();
+ igniteSes.catalog().listColumns("person").show();
System.out.println("CITY table description:");
//Showing `city` schema.
- igniteSession.catalog().listColumns("city").show();
+ igniteSes.catalog().listColumns("city").show();
println("Querying all persons from city with ID=2.");
//Selecting data through Spark SQL engine.
- Dataset<Row> df = igniteSession.sql("SELECT * FROM person WHERE CITY_ID = 2");
+ Dataset<Row> df = igniteSes.sql("SELECT * FROM person WHERE CITY_ID = 2");
System.out.println("Result schema:");
@@ -93,7 +93,7 @@ public class JavaIgniteCatalogExample {
System.out.println("Querying all persons living in Denver.");
//Selecting data through Spark SQL engine.
- Dataset<Row> df2 = igniteSession.sql("SELECT * FROM person p JOIN city c ON c.ID = p.CITY_ID WHERE c.NAME = 'Denver'");
+ Dataset<Row> df2 = igniteSes.sql("SELECT * FROM person p JOIN city c ON c.ID = p.CITY_ID WHERE c.NAME = 'Denver'");
System.out.println("Result schema:");
diff --git a/modules/spark-ext/examples/src/main/java/org/apache/ignite/examples/spark/SharedRDDExample.java b/modules/spark-ext/examples/src/main/java/org/apache/ignite/examples/spark/SharedRDDExample.java
index d7db573a..6b0af0bd 100644
--- a/modules/spark-ext/examples/src/main/java/org/apache/ignite/examples/spark/SharedRDDExample.java
+++ b/modules/spark-ext/examples/src/main/java/org/apache/ignite/examples/spark/SharedRDDExample.java
@@ -56,18 +56,18 @@ public class SharedRDDExample {
.set("spark.executor.instances", "2");
// Spark context.
- JavaSparkContext sparkContext = new JavaSparkContext(sparkConf);
+ JavaSparkContext sparkCtx = new JavaSparkContext(sparkConf);
// Adjust the logger to exclude the logs of no interest.
Configurator.setRootLevel(Level.ERROR);
Configurator.setLevel("org.apache.ignite", Level.INFO);
// Creates Ignite context with specific configuration and runs Ignite in the embedded mode.
- JavaIgniteContext<Integer, Integer> igniteContext = new JavaIgniteContext<Integer, Integer>(
- sparkContext, "config/spark/example-shared-rdd.xml", false);
+ JavaIgniteContext<Integer, Integer> igniteCtx = new JavaIgniteContext<Integer, Integer>(
+ sparkCtx, "config/spark/example-shared-rdd.xml", false);
// Create a Java Ignite RDD of Type (Int,Int) Integer Pair.
- JavaIgniteRDD<Integer, Integer> sharedRDD = igniteContext.<Integer, Integer>fromCache("sharedRDD");
+ JavaIgniteRDD<Integer, Integer> sharedRDD = igniteCtx.<Integer, Integer>fromCache("sharedRDD");
// Define data to be stored in the Ignite RDD (cache).
List<Integer> data = new ArrayList<>(20);
@@ -77,7 +77,7 @@ public class SharedRDDExample {
}
// Preparing a Java RDD.
- JavaRDD<Integer> javaRDD = sparkContext.<Integer>parallelize(data);
+ JavaRDD<Integer> javaRDD = sparkCtx.<Integer>parallelize(data);
// Fill the Ignite RDD in with Int pairs. Here Pairs are represented as Scala Tuple2.
sharedRDD.savePairs(javaRDD.<Integer, Integer>mapToPair(new PairFunction<Integer, Integer, Integer>() {
@@ -121,6 +121,6 @@ public class SharedRDDExample {
df.show();
// Close IgniteContext on all the workers.
- igniteContext.close(true);
+ igniteCtx.close(true);
}
}
diff --git a/modules/spark-ext/spark/pom.xml b/modules/spark-ext/spark/pom.xml
index 26fe59b0..cca080f9 100644
--- a/modules/spark-ext/spark/pom.xml
+++ b/modules/spark-ext/spark/pom.xml
@@ -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>
diff --git a/modules/spring-boot-autoconfigure-ext/spring-boot-autoconfigure/pom.xml b/modules/spring-boot-autoconfigure-ext/spring-boot-autoconfigure/pom.xml
index 58b670cc..29c26065 100644
--- a/modules/spring-boot-autoconfigure-ext/spring-boot-autoconfigure/pom.xml
+++ b/modules/spring-boot-autoconfigure-ext/spring-boot-autoconfigure/pom.xml
@@ -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>
diff --git a/modules/spring-cache-ext/pom.xml b/modules/spring-cache-ext/pom.xml
index 5130764c..47091fc4 100644
--- a/modules/spring-cache-ext/pom.xml
+++ b/modules/spring-cache-ext/pom.xml
@@ -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>
diff --git a/modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerMultiJvmSelfTest.java b/modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerMultiJvmSelfTest.java
index 2bc78ce7..3eb08546 100644
--- a/modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerMultiJvmSelfTest.java
+++ b/modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerMultiJvmSelfTest.java
@@ -117,8 +117,8 @@ public class GridSpringCacheManagerMultiJvmSelfTest extends GridCommonAbstractTe
int totalCalledCnt = 0;
- for (IgniteInternalFuture<Integer> future : futures)
- totalCalledCnt += future.get();
+ for (IgniteInternalFuture<Integer> fut : futures)
+ totalCalledCnt += fut.get();
IgniteCache<Object, Object> cache = loc.cache("dynamicCache");
diff --git a/modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/SpringCacheTest.java b/modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/SpringCacheTest.java
index 3e4c228d..ba71c2e9 100644
--- a/modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/SpringCacheTest.java
+++ b/modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/SpringCacheTest.java
@@ -91,10 +91,10 @@ public class SpringCacheTest extends GridCommonAbstractTest {
@Test
public void testGetByKey() throws Exception {
String key = "key";
- String value = "value";
+ String val = "value";
- springCache.put(key, value);
- assertEquals(value, springCache.get(key).get());
+ springCache.put(key, val);
+ assertEquals(val, springCache.get(key).get());
assertNull(springCache.get("wrongKey"));
}
@@ -105,10 +105,10 @@ public class SpringCacheTest extends GridCommonAbstractTest {
@Test
public void testGetByKeyType() throws Exception {
String key = "key";
- String value = "value";
+ String val = "value";
- springCache.put(key, value);
- assertEquals(value, springCache.get(key, String.class));
+ springCache.put(key, val);
+ assertEquals(val, springCache.get(key, String.class));
try {
springCache.get(key, Integer.class);
@@ -127,10 +127,10 @@ public class SpringCacheTest extends GridCommonAbstractTest {
String key = "key";
assertNull(springCache.get(key));
- String value = "value";
- springCache.put(key, value);
+ String val = "value";
+ springCache.put(key, val);
- assertEquals(value, springCache.get(key).get());
+ assertEquals(val, springCache.get(key).get());
}
/**
diff --git a/modules/spring-data-ext/spring-data/pom.xml b/modules/spring-data-ext/spring-data/pom.xml
index 178847cf..c98ebfa8 100644
--- a/modules/spring-data-ext/spring-data/pom.xml
+++ b/modules/spring-data-ext/spring-data/pom.xml
@@ -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>
diff --git a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/config/DynamicQueryConfig.java b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/config/DynamicQueryConfig.java
index f5640807..f7e3e225 100644
--- a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/config/DynamicQueryConfig.java
+++ b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/config/DynamicQueryConfig.java
@@ -72,19 +72,19 @@ public class DynamicQueryConfig {
* @return the dynamic query config
*/
public static DynamicQueryConfig fromQueryAnnotation(Query queryConfiguration) {
- DynamicQueryConfig config = new DynamicQueryConfig();
+ DynamicQueryConfig cfg = new DynamicQueryConfig();
if (queryConfiguration != null) {
- config.value = queryConfiguration.value();
- config.collocated = queryConfiguration.collocated();
- config.timeout = queryConfiguration.timeout();
- config.enforceJoinOrder = queryConfiguration.enforceJoinOrder();
- config.distributedJoins = queryConfiguration.distributedJoins();
- config.lazy = queryConfiguration.lazy();
- config.parts = queryConfiguration.parts();
- config.local = queryConfiguration.local();
- config.limit = queryConfiguration.limit();
+ cfg.value = queryConfiguration.value();
+ cfg.collocated = queryConfiguration.collocated();
+ cfg.timeout = queryConfiguration.timeout();
+ cfg.enforceJoinOrder = queryConfiguration.enforceJoinOrder();
+ cfg.distributedJoins = queryConfiguration.distributedJoins();
+ cfg.lazy = queryConfiguration.lazy();
+ cfg.parts = queryConfiguration.parts();
+ cfg.local = queryConfiguration.local();
+ cfg.limit = queryConfiguration.limit();
}
- return config;
+ return cfg;
}
/**
diff --git a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/IgniteQueryGenerator.java b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/IgniteQueryGenerator.java
index 3bcfbb7d..572bef31 100644
--- a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/IgniteQueryGenerator.java
+++ b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/IgniteQueryGenerator.java
@@ -53,7 +53,7 @@ public class IgniteQueryGenerator {
parts = new PartTree(mtd.getName(), metadata.getIdType());
}
- boolean isCountOrFieldQuery = parts.isCountProjection();
+ boolean isCntOrFieldQry = parts.isCountProjection();
StringBuilder sql = new StringBuilder();
@@ -61,7 +61,7 @@ public class IgniteQueryGenerator {
sql.append("DELETE ");
// For the DML queries aside from SELECT *, they should run over SqlFieldQuery
- isCountOrFieldQuery = true;
+ isCntOrFieldQry = true;
}
else {
sql.append("SELECT ");
@@ -69,7 +69,7 @@ public class IgniteQueryGenerator {
if (parts.isDistinct())
throw new UnsupportedOperationException("DISTINCT clause in not supported.");
- if (isCountOrFieldQuery)
+ if (isCntOrFieldQry)
sql.append("COUNT(1) ");
else
sql.append("* ");
@@ -105,7 +105,7 @@ public class IgniteQueryGenerator {
return new IgniteQuery(
sql.toString(),
- isCountOrFieldQuery,
+ isCntOrFieldQry,
false,
true,
isParametersDependent(parts),
diff --git a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/IgniteRepositoryQuery.java b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/IgniteRepositoryQuery.java
index 02faf36d..0d6ff89d 100644
--- a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/IgniteRepositoryQuery.java
+++ b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/IgniteRepositoryQuery.java
@@ -311,38 +311,38 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
}
/**
- * {@inheritDoc} @param values the values
+ * {@inheritDoc} @param val the val
*
* @return the object
*/
- @Override public Object execute(Object[] values) {
- Object[] parameters = values;
+ @Override public Object execute(Object[] val) {
+ Object[] parameters = val;
- // config via Query annotation (dynamicQuery = false)
- DynamicQueryConfig config = staticQueryConfiguration;
+ // cfg via Query annotation (dynamicQuery = false)
+ DynamicQueryConfig cfg = staticQueryConfiguration;
// or condition to allow query tunning
- if (config == null || dynamicQueryConfigurationIndex != -1) {
- DynamicQueryConfig newConfig = (DynamicQueryConfig)values[dynamicQueryConfigurationIndex];
+ if (cfg == null || dynamicQueryConfigurationIndex != -1) {
+ DynamicQueryConfig newCfg = (DynamicQueryConfig)val[dynamicQueryConfigurationIndex];
parameters = ArrayUtils.removeElement(parameters, dynamicQueryConfigurationIndex);
- if (newConfig != null) {
+ if (newCfg != null) {
// upset query configuration
- config = newConfig;
+ cfg = newCfg;
}
}
- // query configuration is required, via Query annotation or per parameter (within provided values param)
- if (config == null) {
+ // query configuration is required, via Query annotation or per parameter (within provided val param)
+ if (cfg == null) {
throw new IllegalStateException(
"Unable to execute query. When passing dynamicQuery = true via org.apache.ignite.springdata"
- + ".repository.config.Query annotation, you must provide a non null method parameter of type "
+ + ".repository.cfg.Query annotation, you must provide a non null method parameter of type "
+ "DynamicQueryConfig");
}
- IgniteQuery qry = getQuery(config);
+ IgniteQuery qry = getQuery(cfg);
ReturnStrategy returnStgy = getReturnStgy(qry);
- Query iQry = prepareQuery(qry, config, returnStgy, parameters);
+ Query iQry = prepareQuery(qry, cfg, returnStgy, parameters);
QueryCursor qryCursor;
@@ -372,23 +372,23 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
Iterator<T> it = (Iterator<T>)method.getParameters().iterator();
int i = 0;
boolean found = false;
- int index = -1;
+ int idx = -1;
while (it.hasNext()) {
- T parameter = it.next();
+ T param = it.next();
- if (DynamicQueryConfig.class.isAssignableFrom(parameter.getType())) {
+ if (DynamicQueryConfig.class.isAssignableFrom(param.getType())) {
if (found) {
throw new IllegalStateException("Invalid '" + method.getName() + "' repository method signature. "
+ "Only ONE DynamicQueryConfig parameter is allowed");
}
found = true;
- index = i;
+ idx = i;
}
i++;
}
- return index;
+ return idx;
}
/**
@@ -438,21 +438,21 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
if (!(genericReturnType instanceof ParameterizedType))
return false;
- Type[] actualTypeArguments = ((ParameterizedType)genericReturnType).getActualTypeArguments();
+ Type[] actualTypeArgs = ((ParameterizedType)genericReturnType).getActualTypeArguments();
- if (actualTypeArguments.length == 0)
+ if (actualTypeArgs.length == 0)
return false;
- if (actualTypeArguments[0] instanceof ParameterizedType) {
- ParameterizedType type = (ParameterizedType)actualTypeArguments[0];
+ if (actualTypeArgs[0] instanceof ParameterizedType) {
+ ParameterizedType type = (ParameterizedType)actualTypeArgs[0];
Class<?> type1 = (Class)type.getRawType();
return type1.isAssignableFrom(cls);
}
- if (actualTypeArguments[0] instanceof Class) {
- Class typeArg = (Class)actualTypeArguments[0];
+ if (actualTypeArgs[0] instanceof Class) {
+ Class typeArg = (Class)actualTypeArgs[0];
return typeArg.isAssignableFrom(cls);
}
@@ -542,26 +542,26 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
ReturnStrategy returnStgy,
Object[] prmtrs,
QueryCursor qryCursor) {
- final Class<?> returnClass;
+ final Class<?> retCls;
if (hasProjection) {
if (hasDynamicProjection)
- returnClass = (Class<?>)prmtrs[dynamicProjectionIndex];
+ retCls = (Class<?>)prmtrs[dynamicProjectionIndex];
else
- returnClass = returnedDomainClass;
+ retCls = returnedDomainClass;
}
else
- returnClass = returnedDomainClass;
+ retCls = returnedDomainClass;
if (qry.isFieldQuery()) {
// take control over single primite result from queries, i.e. DELETE, SELECT COUNT, UPDATE ...
- boolean singlePrimitiveResult = isPrimitiveOrWrapper(returnClass);
+ boolean singlePrimitiveResult = isPrimitiveOrWrapper(retCls);
FieldsQueryCursor<?> fieldQryCur = (FieldsQueryCursor<?>)qryCursor;
Function<List<?>, ?> cWrapperTransformFunction = null;
- if (type.equals(returnClass))
+ if (type.equals(retCls))
cWrapperTransformFunction = row -> rowToEntity(row, fieldQryCur);
else {
if (hasProjection || singlePrimitiveResult) {
@@ -570,7 +570,7 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
else {
// Map row -> projection class
cWrapperTransformFunction = row -> factory
- .createProjection(returnClass, rowToMap(row, fieldQryCur));
+ .createProjection(retCls, rowToMap(row, fieldQryCur));
}
}
else
@@ -608,8 +608,8 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
else {
Function<Cache.Entry<?, ?>, ?> cWrapperTransformFunction;
- if (hasProjection && !type.equals(returnClass))
- cWrapperTransformFunction = row -> factory.createProjection(returnClass, row.getValue());
+ if (hasProjection && !type.equals(retCls))
+ cWrapperTransformFunction = row -> factory.createProjection(retCls, row.getValue());
else
cWrapperTransformFunction = Cache.Entry::getValue;
@@ -672,10 +672,10 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
HashMap<String, Integer> methodParams = new HashMap<>();
// create an evaluation context for custom query
- EvaluationContext queryEvalContext = queryMethodEvaluationContextProvider
+ EvaluationContext qryEvalCtx = queryMethodEvaluationContextProvider
.getEvaluationContext(queryMethodParams, values);
- // By default queryEvalContext:
+ // By default qryEvalCtx:
// - make accesible query method parameters by index:
// @Query("select u from User u where u.age = ?#{[0]}")
// List<User> findUsersByAge(int age);
@@ -699,7 +699,7 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
if (p.isExpression()) {
// Evaluate SpEl expressions (synthetic parameter value) , example ?#{#customer.firstname}
- newValues[i] = expressionParser.parseExpression(p.getExpression()).getValue(queryEvalContext);
+ newValues[i] = expressionParser.parseExpression(p.getExpression()).getValue(qryEvalCtx);
}
else {
// Extract parameter value by name or position respectively from invoking values
@@ -721,9 +721,9 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
private Query prepareQuery(IgniteQuery qry, DynamicQueryConfig config, ReturnStrategy returnStgy, Object[] values) {
Object[] parameters = values;
- String queryString = qry.qryStr();
+ String qryStr = qry.qryStr();
- Query query;
+ Query gry;
checkRequiredPageable(returnStgy, values);
@@ -731,8 +731,8 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
boolean isParamDependent;
if (!qry.isAutogenerated()) {
- StringQuery squery = new ExpressionBasedStringQuery(queryString, metadata, expressionParser);
- queryString = squery.getQueryString();
+ StringQuery squery = new ExpressionBasedStringQuery(qryStr, metadata, expressionParser);
+ qryStr = squery.getQueryString();
parameters = extractBindableValues(parameters, getQueryMethod().getParameters(),
squery.getParameterBindings());
@@ -748,15 +748,15 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
switch (qry.options()) {
case SORTING:
- queryString = IgniteQueryGenerator
- .addSorting(new StringBuilder(queryString), (Sort)values[values.length - 1])
+ qryStr = IgniteQueryGenerator
+ .addSorting(new StringBuilder(qryStr), (Sort)values[values.length - 1])
.toString();
if (qry.isAutogenerated())
parameters = Arrays.copyOfRange(parameters, 0, values.length - 1);
break;
case PAGINATION:
- queryString = IgniteQueryGenerator
- .addPaging(new StringBuilder(queryString), (Pageable)values[values.length - 1])
+ qryStr = IgniteQueryGenerator
+ .addPaging(new StringBuilder(qryStr), (Pageable)values[values.length - 1])
.toString();
if (qry.isAutogenerated())
parameters = Arrays.copyOfRange(parameters, 0, values.length - 1);
@@ -766,17 +766,17 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
if (isParamDependent) {
T2<String, Object[]> parseRes = ParameterBindingParser.INSTANCE.processParameterDependentClauses(
- queryString,
+ qryStr,
parameters
);
- queryString = parseRes.get1();
+ qryStr = parseRes.get1();
parameters = parseRes.get2();
}
if (qry.isFieldQuery()) {
- SqlFieldsQuery sqlFieldsQry = new SqlFieldsQuery(queryString);
+ SqlFieldsQuery sqlFieldsQry = new SqlFieldsQuery(qryStr);
sqlFieldsQry.setArgs(parameters);
sqlFieldsQry.setCollocated(config.collocated());
@@ -790,10 +790,10 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
sqlFieldsQry.setTimeout(config.timeout(), TimeUnit.MILLISECONDS);
- query = sqlFieldsQry;
+ gry = sqlFieldsQry;
}
else {
- SqlQuery sqlQry = new SqlQuery(type, queryString);
+ SqlQuery sqlQry = new SqlQuery(type, qryStr);
sqlQry.setArgs(parameters);
sqlQry.setDistributedJoins(config.distributedJoins());
@@ -804,7 +804,7 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
sqlQry.setTimeout(config.timeout(), TimeUnit.MILLISECONDS);
- query = sqlQry;
+ gry = sqlQry;
}
}
else {
@@ -816,34 +816,34 @@ public class IgniteRepositoryQuery implements RepositoryQuery {
break;
}
- // check if queryString contains SpEL template expressions and evaluate them if any
- if (queryString.contains("#{")) {
- EvaluationContext queryEvalContext = queryMethodEvaluationContextProvider
+ // check if qryStr contains SpEL template expressions and evaluate them if any
+ if (qryStr.contains("#{")) {
+ EvaluationContext qryEvalCtx = queryMethodEvaluationContextProvider
.getEvaluationContext(getQueryMethod().getParameters(),
values);
- Object eval = expressionParser.parseExpression(queryString, ParserContext.TEMPLATE_EXPRESSION)
- .getValue(queryEvalContext);
+ Object eval = expressionParser.parseExpression(qryStr, ParserContext.TEMPLATE_EXPRESSION)
+ .getValue(qryEvalCtx);
if (!(eval instanceof String)) {
throw new IllegalStateException(
"TextQuery with SpEL expressions must produce a String response, but found " + eval.getClass()
.getName()
- + ". Please, check your expression: " + queryString);
+ + ". Please, check your expression: " + qryStr);
}
- queryString = (String)eval;
+ qryStr = (String)eval;
}
- TextQuery textQuery = new TextQuery(type, queryString, config.limit());
+ TextQuery textQry = new TextQuery(type, qryStr, config.limit());
- textQuery.setLocal(config.local());
+ textQry.setLocal(config.local());
if (pageSize > -1)
- textQuery.setPageSize(pageSize);
+ textQry.setPageSize(pageSize);
- query = textQuery;
+ gry = textQry;
}
- return query;
+ return gry;
}
/**
diff --git a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/QueryUtils.java b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/QueryUtils.java
index 1457b5a1..e1b28614 100644
--- a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/QueryUtils.java
+++ b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/QueryUtils.java
@@ -271,7 +271,7 @@ public abstract class QueryUtils {
Assert.hasText(originalQry, "OriginalQuery must not be null or empty!");
Matcher matcher = COUNT_MATCH.matcher(originalQry);
- String countQuery;
+ String cntQry;
if (cntProjection == null) {
String variable = matcher.matches() ? matcher.group(VARIABLE_NAME_GROUP_INDEX) : null;
@@ -279,12 +279,12 @@ public abstract class QueryUtils {
&& !variable.startsWith("count(") && !variable.contains(",");
String replacement = useVariable ? SIMPLE_COUNT_VALUE : COMPLEX_COUNT_VALUE;
- countQuery = matcher.replaceFirst(String.format(COUNT_REPLACEMENT_TEMPLATE, replacement));
+ cntQry = matcher.replaceFirst(String.format(COUNT_REPLACEMENT_TEMPLATE, replacement));
}
else
- countQuery = matcher.replaceFirst(String.format(COUNT_REPLACEMENT_TEMPLATE, cntProjection));
+ cntQry = matcher.replaceFirst(String.format(COUNT_REPLACEMENT_TEMPLATE, cntProjection));
- return countQuery.replaceFirst(ORDER_BY_PART, "");
+ return cntQry.replaceFirst(ORDER_BY_PART, "");
}
/**
diff --git a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/StringQuery.java b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/StringQuery.java
index b83ad81a..20ba53e3 100644
--- a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/StringQuery.java
+++ b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/query/StringQuery.java
@@ -85,12 +85,12 @@ class StringQuery implements DeclaredQuery {
bindings = new ArrayList<>();
containsPageableInSpel = query.contains("#pageable");
- Metadata queryMeta = new Metadata();
+ Metadata qryMeta = new Metadata();
this.query = ParameterBindingParser.INSTANCE
.parseParameterBindingsOfQueryIntoBindingsAndReturnCleanedQuery(query, bindings,
- queryMeta);
+ qryMeta);
- usesJdbcStyleParameters = queryMeta.usesJdbcStyleParameters;
+ usesJdbcStyleParameters = qryMeta.usesJdbcStyleParameters;
alias = QueryUtils.detectAlias(query);
hasConstructorExpression = QueryUtils.hasConstructorExpression(query);
}
@@ -396,29 +396,29 @@ class StringQuery implements DeclaredQuery {
* position of the greatest discovered index parameter in order to
* not mix-up with the actual parameter indices.
*/
- int expressionParameterIndex = parametersShouldBeAccessedByIndex ? greatestParameterIndex : 0;
+ int expressionParamIdx = parametersShouldBeAccessedByIndex ? greatestParameterIndex : 0;
- BiFunction<Integer, String, String> indexToParameterName = parametersShouldBeAccessedByIndex
+ BiFunction<Integer, String, String> idxToParamName = parametersShouldBeAccessedByIndex
? (index, expression) -> String.valueOf(
- index + expressionParameterIndex + 1)
+ index + expressionParamIdx + 1)
: (index, expression) ->
EXPRESSION_PARAMETER_PREFIX + (index
+ 1);
String fixedPrefix = parametersShouldBeAccessedByIndex ? "?" : ":";
- BiFunction<String, String, String> parameterNameToReplacement = (prefix, name) -> fixedPrefix + name;
+ BiFunction<String, String, String> paramNameToReplacement = (prefix, name) -> fixedPrefix + name;
- return SpelQueryContext.of(indexToParameterName, parameterNameToReplacement).parse(queryWithSpel);
+ return SpelQueryContext.of(idxToParamName, paramNameToReplacement).parse(queryWithSpel);
}
/** */
private static String replaceFirst(String text, String substring, String replacement) {
- int index = text.indexOf(substring);
- if (index < 0)
+ int idx = text.indexOf(substring);
+ if (idx < 0)
return text;
- return text.substring(0, index) + replacement + text.substring(index + substring.length());
+ return text.substring(0, idx) + replacement + text.substring(idx + substring.length());
}
/** */
@@ -431,18 +431,18 @@ class StringQuery implements DeclaredQuery {
/** */
private static int tryFindGreatestParameterIndexIn(String query) {
- Matcher parameterIndexMatcher = PARAMETER_BINDING_BY_INDEX.matcher(query);
+ Matcher paramIdxMatcher = PARAMETER_BINDING_BY_INDEX.matcher(query);
- int greatestParameterIndex = -1;
- while (parameterIndexMatcher.find()) {
+ int greatestParamIdx = -1;
+ while (paramIdxMatcher.find()) {
- String parameterIndexString = parameterIndexMatcher.group(1);
- Integer parameterIndex = getParameterIndex(parameterIndexString);
- if (parameterIndex != null)
- greatestParameterIndex = Math.max(greatestParameterIndex, parameterIndex);
+ String paramIdxStr = paramIdxMatcher.group(1);
+ Integer paramIdx = getParameterIndex(paramIdxStr);
+ if (paramIdx != null)
+ greatestParamIdx = Math.max(greatestParamIdx, paramIdx);
}
- return greatestParameterIndex;
+ return greatestParamIdx;
}
/** */
@@ -901,15 +901,15 @@ class StringQuery implements DeclaredQuery {
int start = 0;
for (int i = 0; i < query.length(); i++) {
- char currentChar = query.charAt(i);
+ char curChar = query.charAt(i);
- if (QUOTING_CHARACTERS.contains(currentChar)) {
+ if (QUOTING_CHARACTERS.contains(curChar)) {
if (inQuotation == null) {
- inQuotation = currentChar;
+ inQuotation = curChar;
start = i;
}
- else if (currentChar == inQuotation) {
+ else if (curChar == inQuotation) {
inQuotation = null;
quotedRanges.add(Range.from(Bound.inclusive(start)).to(Bound.inclusive(i)));
diff --git a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactory.java b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactory.java
index 7af32b90..bbe7efa5 100644
--- a/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactory.java
+++ b/modules/spring-data-ext/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactory.java
@@ -136,10 +136,10 @@ public class IgniteRepositoryFactory extends RepositoryFactorySupport {
String qryStr = annotation.value();
- boolean annotatedIgniteQuery = !annotation.dynamicQuery() && (StringUtils.hasText(qryStr) || annotation
+ boolean annotatedIgniteQry = !annotation.dynamicQuery() && (StringUtils.hasText(qryStr) || annotation
.textQuery());
- IgniteQuery query = annotatedIgniteQuery
+ IgniteQuery qry = annotatedIgniteQry
? new IgniteQuery(
qryStr,
!annotation.textQuery() && (isFieldQuery(qryStr) || annotation.forceFieldsQuery()),
@@ -150,8 +150,8 @@ public class IgniteRepositoryFactory extends RepositoryFactorySupport {
: null;
if (key != QueryLookupStrategy.Key.CREATE) {
- return new IgniteRepositoryQuery(metadata, query, mtd, factory, cache,
- annotatedIgniteQuery ? DynamicQueryConfig.fromQueryAnnotation(annotation) : null,
+ return new IgniteRepositoryQuery(metadata, qry, mtd, factory, cache,
+ annotatedIgniteQry ? DynamicQueryConfig.fromQueryAnnotation(annotation) : null,
evaluationContextProvider);
}
}
diff --git a/modules/spring-data-ext/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java b/modules/spring-data-ext/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java
index d21f8783..f6f1c3fd 100644
--- a/modules/spring-data-ext/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java
+++ b/modules/spring-data-ext/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java
@@ -262,10 +262,10 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest {
*/
@Test
public void testDeleteExpressionMultiple() {
- long count = repo.countByFirstName("nonUniquePerson");
- long cnt = repo.deleteByFirstName("nonUniquePerson");
+ long cnt = repo.countByFirstName("nonUniquePerson");
+ long cntDel = repo.deleteByFirstName("nonUniquePerson");
- assertEquals(cnt, count);
+ assertEquals(cntDel, cnt);
}
/**
@@ -275,8 +275,8 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest {
public void testRemoveExpression() {
repo.removeByFirstName("person3f");
- long count = repo.count();
- assertEquals(CACHE_SIZE - 1, count);
+ long cnt = repo.count();
+ assertEquals(CACHE_SIZE - 1, cnt);
}
/**
@@ -286,8 +286,8 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest {
public void testDeleteQuery() {
repo.deleteBySecondNameLowerCase("uniqueLastName");
- long countAfter = repo.count();
- assertEquals(CACHE_SIZE - 1, countAfter);
+ long cnt = repo.count();
+ assertEquals(CACHE_SIZE - 1, cnt);
}
/**
@@ -295,7 +295,7 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest {
*/
@Test
public void testWrongDeleteQuery() {
- long countBefore = repo.countByFirstNameLike("person3f");
+ long cntBefore = repo.countByFirstNameLike("person3f");
try {
repo.deleteWrongByFirstNameQuery("person3f");
@@ -304,8 +304,8 @@ public class IgniteSpringDataCrudSelfTest extends GridCommonAbstractTest {
//expected
}
- long countAfter = repo.countByFirstNameLike("person3f");
- assertEquals(countBefore, countAfter);
+ long cntAfter = repo.countByFirstNameLike("person3f");
+ assertEquals(cntBefore, cntAfter);
}
/**
diff --git a/modules/spring-session-ext/src/test/java/org/apache/ignite/spring/sessions/IgniteIndexedSessionRepositoryTest.java b/modules/spring-session-ext/src/test/java/org/apache/ignite/spring/sessions/IgniteIndexedSessionRepositoryTest.java
index 342d901e..68148dd4 100644
--- a/modules/spring-session-ext/src/test/java/org/apache/ignite/spring/sessions/IgniteIndexedSessionRepositoryTest.java
+++ b/modules/spring-session-ext/src/test/java/org/apache/ignite/spring/sessions/IgniteIndexedSessionRepositoryTest.java
@@ -436,8 +436,8 @@ public class IgniteIndexedSessionRepositoryTest {
ses.setAttribute("attribute1", "value1");
ses.setAttribute("attribute2", "value2");
- for (String attributeName : ses.getAttributeNames())
- ses.removeAttribute(attributeName);
+ for (String attrName : ses.getAttributeNames())
+ ses.removeAttribute(attrName);
assertThat(ses.getAttributeNames()).isEmpty();
}
diff --git a/modules/spring-tx-ext/spring-tx/pom.xml b/modules/spring-tx-ext/spring-tx/pom.xml
index 926a4219..4adf4e3c 100644
--- a/modules/spring-tx-ext/spring-tx/pom.xml
+++ b/modules/spring-tx-ext/spring-tx/pom.xml
@@ -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>
diff --git a/modules/ssh-ext/pom.xml b/modules/ssh-ext/pom.xml
index a8d24c80..e17a70c8 100644
--- a/modules/ssh-ext/pom.xml
+++ b/modules/ssh-ext/pom.xml
@@ -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>
diff --git a/modules/ssh-ext/src/main/java/org/apache/ignite/internal/util/nodestart/StartNodeCallableImpl.java b/modules/ssh-ext/src/main/java/org/apache/ignite/internal/util/nodestart/StartNodeCallableImpl.java
index 57bb2eb0..044b5cce 100644
--- a/modules/ssh-ext/src/main/java/org/apache/ignite/internal/util/nodestart/StartNodeCallableImpl.java
+++ b/modules/ssh-ext/src/main/java/org/apache/ignite/internal/util/nodestart/StartNodeCallableImpl.java
@@ -591,8 +591,8 @@ public class StartNodeCallableImpl implements StartNodeCallable {
* @param loggers Loggers.
*/
private void info(String msg, IgniteLogger... loggers) {
- for (IgniteLogger logger : loggers)
- if (logger != null && logger.isInfoEnabled())
- logger.info(msg);
+ for (IgniteLogger log : loggers)
+ if (log != null && log.isInfoEnabled())
+ log.info(msg);
}
}
diff --git a/modules/storm-ext/pom.xml b/modules/storm-ext/pom.xml
index 99cc9dd1..5d48ef78 100644
--- a/modules/storm-ext/pom.xml
+++ b/modules/storm-ext/pom.xml
@@ -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>
diff --git a/modules/storm-ext/src/test/java/org/apache/ignite/stream/storm/StormIgniteStreamerSelfTest.java b/modules/storm-ext/src/test/java/org/apache/ignite/stream/storm/StormIgniteStreamerSelfTest.java
index b599fcf8..02089bda 100644
--- a/modules/storm-ext/src/test/java/org/apache/ignite/stream/storm/StormIgniteStreamerSelfTest.java
+++ b/modules/storm-ext/src/test/java/org/apache/ignite/stream/storm/StormIgniteStreamerSelfTest.java
@@ -126,7 +126,7 @@ public class StormIgniteStreamerSelfTest extends GridCommonAbstractTest {
builder.setSpout("test-spout", testStormSpout);
builder.setBolt("ignite-bolt", stormStreamer, STORM_EXECUTORS).shuffleGrouping("test-spout");
- StormTopology topology = builder.createTopology();
+ StormTopology top = builder.createTopology();
// Prepares a mock data for the spout.
MockedSources mockedSources = new MockedSources();
@@ -140,16 +140,16 @@ public class StormIgniteStreamerSelfTest extends GridCommonAbstractTest {
IgniteCache<Integer, String> cache = ignite.cache(TEST_CACHE);
- CompleteTopologyParam completeTopologyParam = new CompleteTopologyParam();
+ CompleteTopologyParam completeTopParam = new CompleteTopologyParam();
- completeTopologyParam.setTimeoutMs(10000);
- completeTopologyParam.setMockedSources(mockedSources);
- completeTopologyParam.setStormConf(conf);
+ completeTopParam.setTimeoutMs(10000);
+ completeTopParam.setMockedSources(mockedSources);
+ completeTopParam.setStormConf(conf);
// Checks the cache doesn't contain any entries yet.
assertEquals(0, cache.size(CachePeekMode.PRIMARY));
- Testing.completeTopology(cluster, topology, completeTopologyParam);
+ Testing.completeTopology(cluster, top, completeTopParam);
// Checks events successfully processed in 20 seconds.
assertTrue(latch.await(10, TimeUnit.SECONDS));
diff --git a/modules/topology-validator-ext/pom.xml b/modules/topology-validator-ext/pom.xml
index 7dd80584..fb969a35 100644
--- a/modules/topology-validator-ext/pom.xml
+++ b/modules/topology-validator-ext/pom.xml
@@ -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>
diff --git a/modules/twitter-ext/pom.xml b/modules/twitter-ext/pom.xml
index 56e4b70a..7b27dc79 100644
--- a/modules/twitter-ext/pom.xml
+++ b/modules/twitter-ext/pom.xml
@@ -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>
diff --git a/modules/yarn-ext/pom.xml b/modules/yarn-ext/pom.xml
index 0ccb49d8..55ff4233 100644
--- a/modules/yarn-ext/pom.xml
+++ b/modules/yarn-ext/pom.xml
@@ -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>
diff --git a/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/ApplicationMaster.java b/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/ApplicationMaster.java
index 886f2d75..c810a883 100644
--- a/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/ApplicationMaster.java
+++ b/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/ApplicationMaster.java
@@ -121,11 +121,11 @@ public class ApplicationMaster implements AMRMClientAsync.CallbackHandler {
Map<String, String> env = new HashMap<>(ctx.getEnvironment());
- Map<String, String> systemEnv = System.getenv();
+ Map<String, String> sysEnv = System.getenv();
- for (String key : systemEnv.keySet()) {
+ for (String key : sysEnv.keySet()) {
if (key.matches("^IGNITE_[_0-9A-Z]+$"))
- env.put(key, systemEnv.get(key));
+ env.put(key, sysEnv.get(key));
}
env.put("IGNITE_TCP_DISCOVERY_ADDRESSES", getAddress(c.getNodeId().getHost()));
diff --git a/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/ClusterProperties.java b/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/ClusterProperties.java
index 35f5da22..81406ff6 100644
--- a/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/ClusterProperties.java
+++ b/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/ClusterProperties.java
@@ -454,12 +454,12 @@ public class ClusterProperties {
if (fileProps != null && fileProps.containsKey(name))
return Double.valueOf(fileProps.getProperty(name));
- String property = System.getProperty(name);
+ String prop = System.getProperty(name);
- if (property == null)
- property = System.getenv(name);
+ if (prop == null)
+ prop = System.getenv(name);
- return property == null || property.isEmpty() ? defaultVal : Double.valueOf(property);
+ return prop == null || prop.isEmpty() ? defaultVal : Double.valueOf(prop);
}
/**
@@ -471,12 +471,12 @@ public class ClusterProperties {
if (fileProps != null && fileProps.containsKey(name))
return fileProps.getProperty(name);
- String property = System.getProperty(name);
+ String prop = System.getProperty(name);
- if (property == null)
- property = System.getenv(name);
+ if (prop == null)
+ prop = System.getenv(name);
- return property == null || property.isEmpty() ? defaultVal : property;
+ return prop == null || prop.isEmpty() ? defaultVal : prop;
}
/**
diff --git a/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/IgniteYarnClient.java b/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/IgniteYarnClient.java
index f9753e87..d5e04f06 100644
--- a/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/IgniteYarnClient.java
+++ b/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/IgniteYarnClient.java
@@ -137,16 +137,16 @@ public class IgniteYarnClient {
capability.setVirtualCores(1);
// Finally, set-up ApplicationSubmissionContext for the application
- ApplicationSubmissionContext appContext = app.getApplicationSubmissionContext();
- appContext.setApplicationName("ignition"); // application name
- appContext.setAMContainerSpec(amContainer);
- appContext.setResource(capability);
- appContext.setQueue(props.yarnQueue()); // queue
+ ApplicationSubmissionContext appCtx = app.getApplicationSubmissionContext();
+ appCtx.setApplicationName("ignition"); // application name
+ appCtx.setAMContainerSpec(amContainer);
+ appCtx.setResource(capability);
+ appCtx.setQueue(props.yarnQueue()); // queue
// Submit application
- ApplicationId appId = appContext.getApplicationId();
+ ApplicationId appId = appCtx.getApplicationId();
- yarnClient.submitApplication(appContext);
+ yarnClient.submitApplication(appCtx);
log.log(Level.INFO, "Submitted application. Application id: {0}", appId);
diff --git a/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/utils/IgniteYarnUtils.java b/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/utils/IgniteYarnUtils.java
index 345d032d..1c62f010 100644
--- a/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/utils/IgniteYarnUtils.java
+++ b/modules/yarn-ext/src/main/java/org/apache/ignite/yarn/utils/IgniteYarnUtils.java
@@ -59,19 +59,19 @@ public class IgniteYarnUtils {
*/
public static LocalResource setupFile(Path file, FileSystem fs, LocalResourceType type)
throws Exception {
- LocalResource resource = Records.newRecord(LocalResource.class);
+ LocalResource rsrc = Records.newRecord(LocalResource.class);
file = fs.makeQualified(file);
FileStatus stat = fs.getFileStatus(file);
- resource.setResource(ConverterUtils.getYarnUrlFromPath(file));
- resource.setSize(stat.getLen());
- resource.setTimestamp(stat.getModificationTime());
- resource.setType(type);
- resource.setVisibility(LocalResourceVisibility.APPLICATION);
+ rsrc.setResource(ConverterUtils.getYarnUrlFromPath(file));
+ rsrc.setSize(stat.getLen());
+ rsrc.setTimestamp(stat.getModificationTime());
+ rsrc.setType(type);
+ rsrc.setVisibility(LocalResourceVisibility.APPLICATION);
- return resource;
+ return rsrc;
}
/**
diff --git a/modules/zeromq-ext/pom.xml b/modules/zeromq-ext/pom.xml
index b11cc9c1..68b07471 100644
--- a/modules/zeromq-ext/pom.xml
+++ b/modules/zeromq-ext/pom.xml
@@ -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>
diff --git a/modules/zeromq-ext/src/main/java/org/apache/ignite/stream/zeromq/IgniteZeroMqStreamer.java b/modules/zeromq-ext/src/main/java/org/apache/ignite/stream/zeromq/IgniteZeroMqStreamer.java
index 1a8e15b3..6ed8bd41 100644
--- a/modules/zeromq-ext/src/main/java/org/apache/ignite/stream/zeromq/IgniteZeroMqStreamer.java
+++ b/modules/zeromq-ext/src/main/java/org/apache/ignite/stream/zeromq/IgniteZeroMqStreamer.java
@@ -96,19 +96,19 @@ public class IgniteZeroMqStreamer<K, V> extends StreamAdapter<byte[], K, V> impl
ctx = ZMQ.context(ioThreads);
zeroMqExSrv.execute(() -> {
- ZMQ.Socket socket = ctx.socket(socketType);
- socket.connect(addr);
+ ZMQ.Socket sock = ctx.socket(socketType);
+ sock.connect(addr);
if (ZeroMqTypeSocket.SUB.getType() == socketType)
- socket.subscribe(topic);
+ sock.subscribe(topic);
while (isStarted) {
try {
- byte[] msg = socket.recv(0);
+ byte[] msg = sock.recv(0);
if (ZeroMqTypeSocket.SUB.getType() == socketType) {
- if (socket.hasReceiveMore()) {
- addMessage(socket.recv(0));
+ if (sock.hasReceiveMore()) {
+ addMessage(sock.recv(0));
continue;
}
}
@@ -122,7 +122,7 @@ public class IgniteZeroMqStreamer<K, V> extends StreamAdapter<byte[], K, V> impl
}
}
- socket.close();
+ sock.close();
});
}
diff --git a/modules/zeromq-ext/src/test/java/org/apache/ignite/stream/zeromq/IgniteZeroMqStreamerTest.java b/modules/zeromq-ext/src/test/java/org/apache/ignite/stream/zeromq/IgniteZeroMqStreamerTest.java
index 626ecee4..4c51a541 100644
--- a/modules/zeromq-ext/src/test/java/org/apache/ignite/stream/zeromq/IgniteZeroMqStreamerTest.java
+++ b/modules/zeromq-ext/src/test/java/org/apache/ignite/stream/zeromq/IgniteZeroMqStreamerTest.java
@@ -155,10 +155,10 @@ public class IgniteZeroMqStreamerTest extends GridCommonAbstractTest {
// Last element.
int testId = CACHE_ENTRY_COUNT - 1;
- String cachedValue = cache.get(testId);
+ String cachedVal = cache.get(testId);
// ZeroMQ message successfully put to cache.
- assertTrue(cachedValue != null && cachedValue.endsWith(String.valueOf(testId)));
+ assertTrue(cachedVal != null && cachedVal.endsWith(String.valueOf(testId)));
assertTrue(cache.size() == CACHE_ENTRY_COUNT);
diff --git a/modules/zookeeper-ip-finder-ext/zookeeper-ip-finder/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/TcpDiscoveryZookeeperIpFinder.java b/modules/zookeeper-ip-finder-ext/zookeeper-ip-finder/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/TcpDiscoveryZookeeperIpFinder.java
index 3aef441b..e537dc67 100644
--- a/modules/zookeeper-ip-finder-ext/zookeeper-ip-finder/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/TcpDiscoveryZookeeperIpFinder.java
+++ b/modules/zookeeper-ip-finder-ext/zookeeper-ip-finder/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/TcpDiscoveryZookeeperIpFinder.java
@@ -133,10 +133,10 @@ public class TcpDiscoveryZookeeperIpFinder extends TcpDiscoveryIpFinderAdapter {
if (!initGuard.compareAndSet(false, true))
return;
- String sysPropZkConnString = IgniteSystemProperties.getString(PROP_ZK_CONNECTION_STRING);
+ String sysPropZkConnStr = IgniteSystemProperties.getString(PROP_ZK_CONNECTION_STRING);
- if (sysPropZkConnString != null && !sysPropZkConnString.trim().isEmpty())
- zkConnectionString = sysPropZkConnString;
+ if (sysPropZkConnStr != null && !sysPropZkConnStr.trim().isEmpty())
+ zkConnectionString = sysPropZkConnStr;
if (log.isInfoEnabled())
log.info("Initializing ZooKeeper IP Finder.");
@@ -184,10 +184,10 @@ public class TcpDiscoveryZookeeperIpFinder extends TcpDiscoveryIpFinderAdapter {
if (log.isDebugEnabled())
log.debug("Getting registered addresses from ZooKeeper IP Finder.");
- Collection<ServiceInstance<IgniteInstanceDetails>> serviceInstances;
+ Collection<ServiceInstance<IgniteInstanceDetails>> srvcInstances;
try {
- serviceInstances = discovery.queryForInstances(serviceName);
+ srvcInstances = discovery.queryForInstances(serviceName);
}
catch (Exception e) {
log.warning("Error while getting registered addresses from ZooKeeper IP Finder.", e);
@@ -196,7 +196,7 @@ public class TcpDiscoveryZookeeperIpFinder extends TcpDiscoveryIpFinderAdapter {
Set<InetSocketAddress> answer = new HashSet<>();
- for (ServiceInstance<IgniteInstanceDetails> si : serviceInstances)
+ for (ServiceInstance<IgniteInstanceDetails> si : srvcInstances)
answer.add(new InetSocketAddress(si.getAddress(), si.getPort()));
if (log.isInfoEnabled())