Merge branch 'master' into ignite-10809-dg
# Conflicts:
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/WalStateManager.java
diff --git a/bin/include/parseargs.sh b/bin/include/parseargs.sh
index 3ab255e..1efb48e 100755
--- a/bin/include/parseargs.sh
+++ b/bin/include/parseargs.sh
@@ -51,3 +51,13 @@
esac
shift
done
+
+#
+# Set 'file.encoding' to UTF-8 default if not specified otherwise
+#
+case "${JVM_OPTS}" in
+ *-Dfile.encoding=*)
+ ;;
+ *)
+ JVM_OPTS="${JVM_OPTS} -Dfile.encoding=UTF-8";;
+esac
diff --git a/modules/cassandra/store/pom.xml b/modules/cassandra/store/pom.xml
index f90951f..364adaf 100644
--- a/modules/cassandra/store/pom.xml
+++ b/modules/cassandra/store/pom.xml
@@ -36,8 +36,8 @@
<properties>
<commons-beanutils.version>1.9.2</commons-beanutils.version>
- <cassandra-driver.version>3.0.0</cassandra-driver.version>
- <cassandra-all.version>3.3</cassandra-all.version>
+ <cassandra-driver.version>3.2.0</cassandra-driver.version>
+ <cassandra-all.version>3.11.3</cassandra-all.version>
<netty.version>4.1.27.Final</netty.version>
<metrics-core.version>3.0.2</metrics-core.version>
</properties>
diff --git a/modules/cassandra/store/src/test/java/org/apache/ignite/tests/utils/CassandraHelper.java b/modules/cassandra/store/src/test/java/org/apache/ignite/tests/utils/CassandraHelper.java
index 2f9c6de..74e9783 100644
--- a/modules/cassandra/store/src/test/java/org/apache/ignite/tests/utils/CassandraHelper.java
+++ b/modules/cassandra/store/src/test/java/org/apache/ignite/tests/utils/CassandraHelper.java
@@ -326,7 +326,9 @@
}
}
- /** */
+ /**
+ * Note that setting of cassandra.storagedir property is expected.
+ */
public static void startEmbeddedCassandra(Logger log) {
ClassLoader clsLdr = CassandraHelper.class.getClassLoader();
URL url = clsLdr.getResource(EMBEDDED_CASSANDRA_YAML);
diff --git a/modules/cassandra/store/src/test/java/org/apache/ignite/tests/utils/CassandraLifeCycleBean.java b/modules/cassandra/store/src/test/java/org/apache/ignite/tests/utils/CassandraLifeCycleBean.java
index d70d71e..6ddc754 100644
--- a/modules/cassandra/store/src/test/java/org/apache/ignite/tests/utils/CassandraLifeCycleBean.java
+++ b/modules/cassandra/store/src/test/java/org/apache/ignite/tests/utils/CassandraLifeCycleBean.java
@@ -107,6 +107,7 @@
System.setProperty(CASSANDRA_CONFIG_PROP, FILE_PREFIX + cassandraCfgFile);
embeddedCassandraDaemon = new CassandraDaemon(true);
+ embeddedCassandraDaemon.applyConfig();
embeddedCassandraDaemon.init(null);
embeddedCassandraDaemon.start();
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 3a3af8e..9633f89 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -29,6 +29,7 @@
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.lang.reflect.Constructor;
+import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.util.ArrayList;
@@ -40,6 +41,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.ListIterator;
+import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
@@ -1077,6 +1079,9 @@
gw.writeUnlock();
}
+ // Check whether UTF-8 is the default character encoding.
+ checkFileEncoding();
+
// Check whether physical RAM is not exceeded.
checkPhysicalRam();
@@ -1406,6 +1411,20 @@
}
/**
+ * Check whether UTF-8 is the default character encoding.
+ * Differing character encodings across cluster may lead to erratic behavior.
+ */
+ private void checkFileEncoding() {
+ String encodingDisplayName = Charset.defaultCharset().displayName(Locale.ENGLISH);
+
+ if (!"UTF-8".equals(encodingDisplayName)) {
+ U.quietAndWarn(log, "Default character encoding is " + encodingDisplayName +
+ ". Specify UTF-8 character encoding by setting -Dfile.encoding=UTF-8 JVM parameter. " +
+ "Differing character encodings across cluster may lead to erratic behavior.");
+ }
+ }
+
+ /**
* Checks whether physical RAM is not exceeded.
*/
@SuppressWarnings("ConstantConditions")
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 556af19..6c72258 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -2486,7 +2486,7 @@
*
* @param cacheMap Map to add to.
* @param cacheName Cache name.
- * @param rich Node to add
+ * @param node Node to add
*/
private void addToMap(Map<Integer, List<ClusterNode>> cacheMap, String cacheName, ClusterNode node) {
List<ClusterNode> cacheNodes = cacheMap.get(CU.cacheId(cacheName));
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/WalStateManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/WalStateManager.java
index 0ed59e9..83c548e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/WalStateManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/WalStateManager.java
@@ -507,9 +507,11 @@
for (Integer grpId0 : session0.disabledGrps) {
CacheGroupContext grp = cctx.cache().cacheGroup(grpId0);
- assert grp != null : "grpId=" + grpId0;
+ if (grp != null)
+ grp.topology().ownMoving(topVer);
+ else if (log.isDebugEnabled())
+ log.debug("Cache group was destroyed before checkpoint finished, [grpId=" + grpId0 + ']');
- grp.topology().ownMoving(topVer);
}
cctx.exchange().refreshPartitions();
diff --git a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
index f4aad17..e449bfa 100644
--- a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
+++ b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
@@ -204,10 +204,15 @@
* @param args Collection of unknown (from JCommander point of view) arguments.
*/
private void parseJvmOptionsAndSpringConfig(Iterable<String> args) {
+ boolean hadFileEncoding = false;
+
for (String arg : args) {
if (arg.startsWith(JVM_OPTION_PREFIX)) {
String jvmOpt = arg.substring(JVM_OPTION_PREFIX.length());
+ if (jvmOpt.startsWith("-Dfile.encoding="))
+ hadFileEncoding = true;
+
if (!checkJVMOptionIsSupported(jvmOpt))
throw new RuntimeException(JVM_OPTION_PREFIX + " JVM parameters for Ignite batch scripts " +
"with double quotes are not supported. " +
@@ -222,6 +227,9 @@
throw new RuntimeException("Unrecognised parameter has been found: " + arg);
}
}
+
+ if (!hadFileEncoding)
+ jvmOptions = (jvmOptions.isEmpty() ? "" : (jvmOptions + " ")) + "-Dfile.encoding=UTF-8";
}
/**
@@ -234,4 +242,4 @@
private boolean checkJVMOptionIsSupported(String jvmOpt) {
return !(jvmOpt.contains("-XX:OnError") || jvmOpt.contains("-XX:OnOutOfMemoryError"));
}
-}
\ No newline at end of file
+}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java
index 5c7f6c0..0ef2289 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java
@@ -19,16 +19,16 @@
import java.util.Arrays;
import java.util.List;
-import java.util.concurrent.ThreadLocalRandom;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CountDownLatch;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteDataStreamer;
-import org.apache.ignite.IgniteException;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.DataRegionConfiguration;
import org.apache.ignite.configuration.DataStorageConfiguration;
@@ -37,19 +37,15 @@
import org.apache.ignite.configuration.WALMode;
import org.apache.ignite.failure.StopNodeFailureHandler;
import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.managers.communication.GridIoMessage;
-import org.apache.ignite.internal.processors.cache.GridCacheGroupIdMessage;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessage;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.lang.IgniteThrowableConsumer;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.CU;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.lang.IgniteRunnable;
import org.apache.ignite.plugin.extensions.communication.Message;
-import org.apache.ignite.spi.IgniteSpiException;
import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
-import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
@@ -82,6 +78,9 @@
/** */
private static final int REBALANCE_BATCH_SIZE = 50 * 1024;
+ /** Number of loaded keys in each cache. */
+ private static final int KEYS_SIZE = 3000;
+
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
super.beforeTest();
@@ -112,12 +111,12 @@
.setDefaultTxTimeout(1000));
cfg.setDataStorageConfiguration(
- new DataStorageConfiguration()
- .setWalMode(WALMode.LOG_ONLY)
- .setDefaultDataRegionConfiguration(
- new DataRegionConfiguration()
- .setPersistenceEnabled(true)
- .setMaxSize(100L * 1024 * 1024)));
+ new DataStorageConfiguration()
+ .setWalMode(WALMode.LOG_ONLY)
+ .setDefaultDataRegionConfiguration(
+ new DataRegionConfiguration()
+ .setPersistenceEnabled(true)
+ .setMaxSize(100L * 1024 * 1024)));
return cfg;
}
@@ -126,7 +125,23 @@
*
*/
@Test
- public void testStopCachesOnDeactivation() throws Exception {
+ public void testStopCachesOnDeactivationFirstGroup() throws Exception {
+ testStopCachesOnDeactivation(GROUP_1);
+ }
+
+ /**
+ *
+ */
+ @Test
+ public void testStopCachesOnDeactivationSecondGroup() throws Exception {
+ testStopCachesOnDeactivation(GROUP_2);
+ }
+
+ /**
+ * @param groupName Group name.
+ * @throws Exception If failed.
+ */
+ private void testStopCachesOnDeactivation(String groupName) throws Exception {
if (MvccFeatureChecker.forcedMvcc())
fail("https://issues.apache.org/jira/browse/IGNITE-10582");
@@ -137,26 +152,58 @@
ig.cluster().active(true);
return null;
- });
+ }, groupName);
}
/**
*
*/
@Test
- public void testDestroySpecificCachesInDifferentCacheGroups() throws Exception {
+ public void testDestroySpecificCachesInDifferentCacheGroupsFirstGroup() throws Exception {
+ testDestroySpecificCachesInDifferentCacheGroups(GROUP_1);
+ }
+
+ /**
+ *
+ */
+ @Test
+ public void testDestroySpecificCachesInDifferentCacheGroupsSecondGroup() throws Exception {
+ testDestroySpecificCachesInDifferentCacheGroups(GROUP_2);
+ }
+
+ /**
+ * @param groupName Group name.
+ * @throws Exception If failed.
+ */
+ private void testDestroySpecificCachesInDifferentCacheGroups(String groupName) throws Exception {
performTest(ig -> {
ig.destroyCaches(Arrays.asList(CACHE_1, CACHE_3));
return null;
- });
+ }, groupName);
}
/**
*
*/
@Test
- public void testDestroySpecificCacheAndCacheGroup() throws Exception {
+ public void testDestroySpecificCacheAndCacheGroupFirstGroup() throws Exception {
+ testDestroySpecificCacheAndCacheGroup(GROUP_1);
+ }
+
+ /**
+ *
+ */
+ @Test
+ public void testDestroySpecificCacheAndCacheGroupSecondGroup() throws Exception {
+ testDestroySpecificCacheAndCacheGroup(GROUP_2);
+ }
+
+ /**
+ * @param groupName Group name.
+ * @throws Exception If failed.
+ */
+ private void testDestroySpecificCacheAndCacheGroup(String groupName) throws Exception {
if (MvccFeatureChecker.forcedMvcc())
fail("https://issues.apache.org/jira/browse/IGNITE-10582");
@@ -164,13 +211,13 @@
ig.destroyCaches(Arrays.asList(CACHE_1, CACHE_3, CACHE_4));
return null;
- });
+ }, groupName);
}
/**
* @param testAction Action that trigger stop or destroy of caches.
*/
- private void performTest(IgniteThrowableConsumer<Ignite, Void> testAction) throws Exception {
+ private void performTest(IgniteThrowableConsumer<Ignite, Void> testAction, String groupName) throws Exception {
IgniteEx ig0 = (IgniteEx)startGrids(2);
ig0.cluster().active(true);
@@ -179,13 +226,27 @@
loadData(ig0);
- startGrid(1);
+ IgniteEx ig1 = startGrid(1);
- runLoad(ig0);
+ RebalanceBlockingSPI commSpi = (RebalanceBlockingSPI)ig1.configuration().getCommunicationSpi();
+
+ // Complete all futures for groups that we don't need to wait.
+ commSpi.resumeRebalanceFutures.forEach((k, v) -> {
+ if (k != CU.cacheId(groupName))
+ v.onDone();
+ });
+
+ CountDownLatch latch = commSpi.suspendRebalanceInMiddleLatch.get(CU.cacheId(groupName));
+
+ assert latch != null;
+
+ // Await some middle point rebalance for group.
+ latch.await();
testAction.accept(ig0);
- U.sleep(1000);
+ // Resume rebalance after action performed.
+ commSpi.resumeRebalanceFutures.get(CU.cacheId(groupName)).onDone();
awaitPartitionMapExchange(true, true, null, true);
@@ -197,22 +258,22 @@
*/
private void loadData(Ignite ig) {
List<CacheConfiguration> configs = Stream.of(
- F.t(CACHE_1, GROUP_1),
- F.t(CACHE_2, GROUP_1),
- F.t(CACHE_3, GROUP_2),
- F.t(CACHE_4, GROUP_2)
+ F.t(CACHE_1, GROUP_1),
+ F.t(CACHE_2, GROUP_1),
+ F.t(CACHE_3, GROUP_2),
+ F.t(CACHE_4, GROUP_2)
).map(names -> new CacheConfiguration<>(names.get1())
- .setGroupName(names.get2())
- .setRebalanceBatchSize(REBALANCE_BATCH_SIZE)
- .setCacheMode(CacheMode.REPLICATED)
- .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
+ .setGroupName(names.get2())
+ .setRebalanceBatchSize(REBALANCE_BATCH_SIZE)
+ .setCacheMode(CacheMode.REPLICATED)
+ .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
).collect(Collectors.toList());
ig.getOrCreateCaches(configs);
configs.forEach(cfg -> {
try (IgniteDataStreamer<Object, Object> streamer = ig.dataStreamer(cfg.getName())) {
- for (int i = 0; i < 3_000; i++)
+ for (int i = 0; i < KEYS_SIZE; i++)
streamer.addData(i, new byte[1024]);
streamer.flush();
@@ -221,69 +282,43 @@
}
/**
- * @param ig Ignite instance.
- */
- private void runLoad(Ignite ig) throws Exception{
- GridTestUtils.runMultiThreaded(new Runnable() {
- @Override public void run() {
- String cacheName = F.rand(CACHE_1, CACHE_2, CACHE_3, CACHE_4);
-
- IgniteCache cache = ig.cache(cacheName);
-
- for (int i = 0; i < 3_000; i++) {
- int idx = ThreadLocalRandom.current().nextInt(3_000);
-
- while (true) {
- try {
- cache.put(idx, new byte[1024]);
-
- break;
- }
- catch (Exception e) {
- MvccFeatureChecker.assertMvccWriteConflict(e);
- }
- }
- }
- }
- }, 4, "load-thread");
- }
-
- /**
*
*/
private static class RebalanceBlockingSPI extends TcpCommunicationSpi {
- /** {@inheritDoc} */
- @Override public void sendMessage(ClusterNode node, Message msg) throws IgniteSpiException {
- slowDownMessage(msg);
+ /** */
+ private final Map<Integer, GridFutureAdapter> resumeRebalanceFutures = new ConcurrentHashMap<>();
- super.sendMessage(node, msg);
+ /** */
+ private final Map<Integer, CountDownLatch> suspendRebalanceInMiddleLatch = new ConcurrentHashMap<>();
+ /** */
+ RebalanceBlockingSPI() {
+ resumeRebalanceFutures.put(CU.cacheId(GROUP_1), new GridFutureAdapter());
+ resumeRebalanceFutures.put(CU.cacheId(GROUP_2), new GridFutureAdapter());
+ suspendRebalanceInMiddleLatch.put(CU.cacheId(GROUP_1), new CountDownLatch(3));
+ suspendRebalanceInMiddleLatch.put(CU.cacheId(GROUP_2), new CountDownLatch(3));
}
/** {@inheritDoc} */
- @Override public void sendMessage(ClusterNode node, Message msg,
- IgniteInClosure<IgniteException> ackC) throws IgniteSpiException {
- slowDownMessage(msg);
+ @Override protected void notifyListener(UUID sndId, Message msg, IgniteRunnable msgC) {
+ if (msg instanceof GridIoMessage &&
+ ((GridIoMessage)msg).message() instanceof GridDhtPartitionSupplyMessage) {
+ GridDhtPartitionSupplyMessage msg0 = (GridDhtPartitionSupplyMessage)((GridIoMessage)msg).message();
- super.sendMessage(node, msg, ackC);
- }
+ CountDownLatch latch = suspendRebalanceInMiddleLatch.get(msg0.groupId());
- /**
- * @param msg Message.
- */
- private void slowDownMessage(Message msg) {
- if (msg instanceof GridIoMessage && ((GridIoMessage)msg).message() instanceof GridDhtPartitionSupplyMessage) {
- int grpId = ((GridCacheGroupIdMessage)((GridIoMessage)msg).message()).groupId();
+ if (latch != null) {
+ if (latch.getCount() > 0)
+ latch.countDown();
+ else {
+ resumeRebalanceFutures.get(msg0.groupId()).listen(f -> super.notifyListener(sndId, msg, msgC));
- if (grpId == CU.cacheId(GROUP_1) || grpId == CU.cacheId(GROUP_2)) {
- try {
- U.sleep(50);
- }
- catch (IgniteInterruptedCheckedException e) {
- e.printStackTrace();
+ return;
}
}
}
+
+ super.notifyListener(sndId, msg, msgC);
}
}
}
diff --git a/modules/core/src/test/java/org/apache/ignite/startup/cmdline/GridCommandLineTransformerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/startup/cmdline/GridCommandLineTransformerSelfTest.java
index d08ed6b..fbcb547 100644
--- a/modules/core/src/test/java/org/apache/ignite/startup/cmdline/GridCommandLineTransformerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/startup/cmdline/GridCommandLineTransformerSelfTest.java
@@ -36,7 +36,7 @@
public void testTransformIfNoArguments() throws Exception {
assertEquals(
"\"INTERACTIVE=0\" \"QUIET=-DIGNITE_QUIET=true\" \"NO_PAUSE=0\" " +
- "\"NO_JMX=0\" \"JVM_XOPTS=\" \"CONFIG=\"",
+ "\"NO_JMX=0\" \"JVM_XOPTS=-Dfile.encoding=UTF-8\" \"CONFIG=\"",
CommandLineTransformer.transform());
}
@@ -111,7 +111,7 @@
public void testTransformIfOnlyPathToConfigSpecified() throws Exception {
assertEquals(
"\"INTERACTIVE=0\" \"QUIET=-DIGNITE_QUIET=true\" \"NO_PAUSE=0\" \"NO_JMX=0\" " +
- "\"JVM_XOPTS=\" \"CONFIG=c:\\qw.xml\"",
+ "\"JVM_XOPTS=-Dfile.encoding=UTF-8\" \"CONFIG=c:\\qw.xml\"",
CommandLineTransformer.transform("c:\\qw.xml"));
}
@@ -122,7 +122,7 @@
public void testTransformIfAllSupportedArguments() throws Exception {
assertEquals(
"\"INTERACTIVE=1\" \"QUIET=-DIGNITE_QUIET=false\" \"NO_PAUSE=1\" \"NO_JMX=1\" " +
- "\"JVM_XOPTS=-Xmx1g -Xms1m\" " +
+ "\"JVM_XOPTS=-Xmx1g -Xms1m -Dfile.encoding=UTF-8\" " +
"\"CONFIG=\"c:\\path to\\русский каталог\"\"",
CommandLineTransformer.transform("-i", "-np", "-v", "-J-Xmx1g", "-J-Xms1m", "-nojmx",
"\"c:\\path to\\русский каталог\""));
diff --git a/modules/platforms/cpp/core/src/ignition.cpp b/modules/platforms/cpp/core/src/ignition.cpp
index 7d90a52..3891be1 100644
--- a/modules/platforms/cpp/core/src/ignition.cpp
+++ b/modules/platforms/cpp/core/src/ignition.cpp
@@ -111,6 +111,10 @@
int idx = 0;
+ std::string fileEncParam = "-Dfile.encoding=";
+
+ bool hadFileEnc = false;
+
// 1. Set classpath.
std::string cpFull = "-Djava.class.path=" + cp;
@@ -131,8 +135,19 @@
opts[idx++] = CopyChars(xmxStr.c_str());
// 4. Set the rest options.
- for (std::list<std::string>::const_iterator i = cfg.jvmOpts.begin(); i != cfg.jvmOpts.end(); ++i)
+ for (std::list<std::string>::const_iterator i = cfg.jvmOpts.begin(); i != cfg.jvmOpts.end(); ++i) {
+ if (i->find(fileEncParam) != std::string::npos)
+ hadFileEnc = true;
+
opts[idx++] = CopyChars(i->c_str());
+ }
+
+ // 5. Set file.encoding.
+ if (!hadFileEnc) {
+ std::string fileEncFull = fileEncParam + "UTF-8";
+
+ opts[idx++] = CopyChars(fileEncFull.c_str());
+ }
}
/**
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteManager.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteManager.cs
index 47260a7..e2a4b9f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteManager.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteManager.cs
@@ -40,6 +40,9 @@
/** Java Command line argument: Xmx. Case sensitive. */
private const string CmdJvmMaxMemJava = "-Xmx";
+ /** Java Command line argument: file.encoding. Case sensitive. */
+ private const string CmdJvmFileEncoding = "-Dfile.encoding=";
+
/** Monitor for DLL load synchronization. */
private static readonly object SyncRoot = new object();
@@ -93,7 +96,7 @@
return cbs;
}
}
-
+
/// <summary>
/// Memory manager attached to currently running JVM.
/// </summary>
@@ -141,6 +144,9 @@
cfg.JvmMaxMemoryMb != IgniteConfiguration.DefaultJvmMaxMem)
jvmOpts.Add(string.Format(CultureInfo.InvariantCulture, "{0}{1}m", CmdJvmMaxMemJava, cfg.JvmMaxMemoryMb));
+ if (!jvmOpts.Any(opt => opt.StartsWith(CmdJvmFileEncoding, StringComparison.Ordinal)))
+ jvmOpts.Add(string.Format(CultureInfo.InvariantCulture, "{0}UTF-8", CmdJvmFileEncoding));
+
return jvmOpts;
}
diff --git a/modules/web-console/frontend/app/components/page-configure/template.pug b/modules/web-console/frontend/app/components/page-configure/template.pug
index 86180fa..e161ba5 100644
--- a/modules/web-console/frontend/app/components/page-configure/template.pug
+++ b/modules/web-console/frontend/app/components/page-configure/template.pug
@@ -32,7 +32,7 @@
svg.icon-left(
ignite-icon='info'
bs-tooltip=''
- data-title='This setting is needed to hide and show tooltips with hints.'
+ data-title='Use this setting to hide or show tooltips with hints.'
data-placement='left'
)
span Tooltips
@@ -46,4 +46,4 @@
ng-class=`{
'pc-hide-tooltips': !$ctrl.tooltipsVisible
}`
- )
\ No newline at end of file
+ )