[ignite] branch master updated: IGNITE-13385 Added documentation on cache warm-up strategy (#8689)

2021-01-22 Thread dmagda
This is an automated email from the ASF dual-hosted git repository.

dmagda pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new b6c2af1  IGNITE-13385 Added documentation on cache warm-up strategy 
(#8689)
b6c2af1 is described below

commit b6c2af192147d7db9a41251efd230c95c5dafe5a
Author: Nikita Safonov <73828260+nikita-tech-wri...@users.noreply.github.com>
AuthorDate: Sat Jan 23 00:21:42 2021 +0300

IGNITE-13385 Added documentation on cache warm-up strategy (#8689)
---
 docs/_docs/memory-configuration/data-regions.adoc | 69 +++
 1 file changed, 69 insertions(+)

diff --git a/docs/_docs/memory-configuration/data-regions.adoc 
b/docs/_docs/memory-configuration/data-regions.adoc
index f2646ad..4517ada 100644
--- a/docs/_docs/memory-configuration/data-regions.adoc
+++ b/docs/_docs/memory-configuration/data-regions.adoc
@@ -82,3 +82,72 @@ 
include::code-snippets/dotnet/MemoryArchitecture.cs[tag=mem,indent=0]
 tab:C++[unsupported]
 --
 
+== Cache Warm-Up Strategy
+
+The cache warm-up strategy provides an ability to load data from the disk to 
the node before it is joined to the cluster.
+This prevents performance loss when the node is restarted.
+
+[NOTE]
+
+The cache warm-up strategy is applicable only to the data regions. It can be 
configured both for all regions (by default) or for each region separately.
+
+
+Presently, Ignite warm-up strategy implies loading data into the region, 
starting with indexes, until it runs out of free space.
+
+To warm up all data regions, pass the configuration parameter 
`LoadAllWarmUpStrategy` to the 
`DataStorageConfiguration#setDefaultWarmUpConfiguration` as follows:
+
+[source, java]
+
+setDefaultWarmUpConfiguration(loadAllWarmUpStrategy)
+
+
+To warm up a specific data region, pass the configuration parameter 
`LoadAllWarmUpStrategy` to the 
`DataStorageConfiguration#setWarmUpConfiguration` as follows:
+
+[source, java]
+
+setWarmUpConfiguration(loadAllWarmUpStrategy)
+
+
+To stop warming up all data regions, pass the configuration parameter 
`NoOpWarmUpStrategy` to the 
`DataStorageConfiguration#setDefaultWarmUpConfiguration` as follows:
+
+[source, java]
+
+setDefaultWarmUpConfiguration(noOpWarmUpStrategy)
+
+
+To stop warming up a specific data region, pass the configuration parameter 
`NoOpWarmUpStrategy` to the `DataStorageConfiguration#setWarmUpConfiguration` 
as follows:
+
+[source, java]
+
+setWarmUpConfiguration(noOpWarmUpStrategy)
+
+
+You can also stop the cache warming up process by using `control.sh` and JMX.
+
+To stop the warming up using control.sh:
+
+[tabs]
+--
+tab:Linux[]
+[source,shell,subs="verbatim,quotes"]
+
+control.sh --warm-up --stop --yes
+
+tab:Windows[]
+[source,shell,subs="verbatim,quotes"]
+
+control.bat --warm-up --stop --yes
+
+--
+
+To stop the warming up using JMX, use the method below:
+
+[source, java]
+
+org.apache.ignite.mxbean.WarmUpMXBean#stopWarmUp
+
+
+
+
+
+



[ignite] branch master updated: IGNITE-14033 .NET: Fix MessagingTest.TestRemoteListen flakiness

2021-01-22 Thread ptupitsyn
This is an automated email from the ASF dual-hosted git repository.

ptupitsyn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 1bc9ab8  IGNITE-14033 .NET: Fix MessagingTest.TestRemoteListen 
flakiness
1bc9ab8 is described below

commit 1bc9ab8e367df56c4febde9ac55a54c6c89b1ff1
Author: Pavel Tupitsyn 
AuthorDate: Fri Jan 22 17:53:27 2021 +0300

IGNITE-14033 .NET: Fix MessagingTest.TestRemoteListen flakiness

* Improve assertions to understand the failures easier
* Add `TestStopRemoteListenRemovesAllCallbacksUponExit` to demonstrate the 
problem, ignore with a ticket link
* Add `AssertHandleRegistryHasItems` with a timeout to fix the flakiness
---
 .../Apache.Ignite.Core.Tests/MessagingTest.cs  | 128 ++---
 1 file changed, 110 insertions(+), 18 deletions(-)

diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs
index 659afa7..ead9763 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs
@@ -335,13 +335,34 @@ namespace Apache.Ignite.Core.Tests
 }
 
 /// 
+/// Tests that  guarantees 
that all handlers are removed
+/// upon method exit.
+/// 
+[Test]
+[Ignore("IGNITE-14032")]
+public void TestStopRemoteListenRemovesAllCallbacksUponExit()
+{
+const string topic = "topic";
+
+var messaging =_grid1.GetMessaging();
+var listenId = 
messaging.RemoteListen(MessagingTestHelper.GetListener("first"), topic);
+
+TestUtils.AssertHandleRegistryHasItems(-1, 1, _grid1, _grid2, 
_grid3);
+
+messaging.Send(1, topic);
+messaging.StopRemoteListen(listenId);
+
+TestUtils.AssertHandleRegistryHasItems(-1, 0, _grid1, _grid2, 
_grid3);
+}
+
+/// 
 /// Tests RemoteListen.
 /// 
 private void TestRemoteListen(object topic, bool async = false)
 {
 var messaging =_grid1.GetMessaging();
 
-var listener = MessagingTestHelper.GetListener();
+var listener = MessagingTestHelper.GetListener("first");
 var listenId = async
 ? messaging.RemoteListenAsync(listener, topic).Result
 : messaging.RemoteListen(listener, topic);
@@ -353,9 +374,10 @@ namespace Apache.Ignite.Core.Tests
 CheckNoMessage(NextId());
 
 // Test multiple subscriptions for the same filter
+var listener2 = MessagingTestHelper.GetListener("second");
 var listenId2 = async
-? messaging.RemoteListenAsync(listener, topic).Result
-: messaging.RemoteListen(listener, topic);
+? messaging.RemoteListenAsync(listener2, topic).Result
+: messaging.RemoteListen(listener2, topic);
 
 CheckSend(topic, msg: messaging, remoteListen: true, 
repeatMultiplier: 2); // expect twice the messages
 
@@ -364,6 +386,14 @@ namespace Apache.Ignite.Core.Tests
 else
 messaging.StopRemoteListen(listenId2);
 
+// Wait for all to unsubscribe: StopRemoteListen (both sync and 
async) does not remove remote listeners
+// upon exit. Remote listeners are removed with disco messages 
after some delay -
+// see TestStopRemoteListenRemovesAllCallbacksUponExit.
+TestUtils.AssertHandleRegistryHasItems(
+(int)MessagingTestHelper.SleepTimeout.TotalMilliseconds,
+1,
+_grid1, _grid2, _grid3);
+
 CheckSend(topic, msg: messaging, remoteListen: true); // back to 
normal after unsubscription
 
 // Test message type mismatch
@@ -464,7 +494,7 @@ namespace Apache.Ignite.Core.Tests
 if (sharedResult.Length != 0)
 {
 Assert.Fail("Unexpected messages ({0}): {1}; last sent 
message: {2}", sharedResult.Length,
-string.Join(",", sharedResult), lastMsg);
+string.Join(",", sharedResult.Select(x => x.ToString())), 
lastMsg);
 }
 }
 
@@ -570,7 +600,7 @@ namespace Apache.Ignite.Core.Tests
 public static class MessagingTestHelper
 {
 /** */
-public static readonly ConcurrentStack ReceivedMessages = new 
ConcurrentStack();
+public static readonly ConcurrentStack 
ReceivedMessages = new ConcurrentStack();
 
 /** */
 private static readonly ConcurrentStack Failures = new 
ConcurrentStack();
@@ -579,9 +609,6 @@ namespace Apache.Ignite.Core.Tests
 private static readonly CountdownEvent ReceivedEvent = new 
CountdownEvent(0);
 
 /** */
-private static readonly ConcurrentStack 

[ignite] branch ignite-ducktape updated: IGNITE-14038 : Separate JVM settings in the ducktests. (#8660)

2021-01-22 Thread av
This is an automated email from the ASF dual-hosted git repository.

av pushed a commit to branch ignite-ducktape
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-ducktape by this push:
 new 0541ac3  IGNITE-14038 : Separate JVM settings in the ducktests. (#8660)
0541ac3 is described below

commit 0541ac3becbfdbc45cb7d27c36109194be684dea
Author: Vladimir Steshin 
AuthorDate: Fri Jan 22 17:00:17 2021 +0300

IGNITE-14038 : Separate JVM settings in the ducktests. (#8660)
---
 .../tests/checks/utils/check_jvm_settings.py   |  49 +
 .../ducktests/tests/ignitetest/services/ignite.py  |   6 +-
 .../tests/ignitetest/services/ignite_app.py|   4 +-
 .../tests/ignitetest/services/utils/ignite_spec.py |  43 +---
 .../tests/ignitetest/services/utils/jvm_utils.py   | 109 +
 .../ducktests/tests/ignitetest/tests/self_test.py  |   2 +-
 6 files changed, 191 insertions(+), 22 deletions(-)

diff --git a/modules/ducktests/tests/checks/utils/check_jvm_settings.py 
b/modules/ducktests/tests/checks/utils/check_jvm_settings.py
new file mode 100644
index 000..1e178d0
--- /dev/null
+++ b/modules/ducktests/tests/checks/utils/check_jvm_settings.py
@@ -0,0 +1,49 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Checks JVM settings.
+"""
+
+from ignitetest.services.utils.jvm_utils import create_jvm_settings, 
merge_jvm_settings, DEFAULT_HEAP
+
+
+class CheckJVMSettings:
+"""
+Checks behavior of various tools.
+"""
+
+# pylint: disable=R0201
+def check_list(self):
+"""
+Checks list representation of JVM settings.
+"""
+jvm_settings = create_jvm_settings()
+
+assert "-Xms" + DEFAULT_HEAP in jvm_settings
+assert "-Xmx" + DEFAULT_HEAP in jvm_settings
+
+jvm_settings = merge_jvm_settings(jvm_settings, additionals="-Xms981M 
-Xmx981M")
+
+assert "-Xms981M" in jvm_settings
+assert "-Xmx981M" in jvm_settings
+assert "-Xms" + DEFAULT_HEAP not in jvm_settings
+assert "-Xmx" + DEFAULT_HEAP not in jvm_settings
+
+jvm_settings = merge_jvm_settings(jvm_settings, 
additionals="-XX:ParallelGCThreads=1024")
+jvm_settings = merge_jvm_settings(jvm_settings, 
additionals="-xx:ParallelGCThreads=512")
+
+assert "-XX:ParallelGCThreads=1024" in jvm_settings
+assert "-XX:ParallelGCThreads=512" not in jvm_settings
diff --git a/modules/ducktests/tests/ignitetest/services/ignite.py 
b/modules/ducktests/tests/ignitetest/services/ignite.py
index af866b2..854d9f3 100644
--- a/modules/ducktests/tests/ignitetest/services/ignite.py
+++ b/modules/ducktests/tests/ignitetest/services/ignite.py
@@ -33,10 +33,10 @@ class IgniteService(IgniteAwareService):
 APP_SERVICE_CLASS = "org.apache.ignite.startup.cmdline.CommandLineStartup"
 
 # pylint: disable=R0913
-def __init__(self, context, config, num_nodes, jvm_opts=None, 
startup_timeout_sec=60, shutdown_timeout_sec=10,
- modules=None):
+def __init__(self, context, config, num_nodes, jvm_opts=None, 
full_jvm_opts=None, startup_timeout_sec=60,
+ shutdown_timeout_sec=10, modules=None):
 super().__init__(context, config, num_nodes, startup_timeout_sec, 
shutdown_timeout_sec, modules=modules,
- jvm_opts=jvm_opts)
+ jvm_opts=jvm_opts, full_jvm_opts=full_jvm_opts)
 
 def clean_node(self, node):
 node.account.kill_java_processes(self.APP_SERVICE_CLASS, 
clean_shutdown=False, allow_fail=True)
diff --git a/modules/ducktests/tests/ignitetest/services/ignite_app.py 
b/modules/ducktests/tests/ignitetest/services/ignite_app.py
index 502eb56..3798feb 100644
--- a/modules/ducktests/tests/ignitetest/services/ignite_app.py
+++ b/modules/ducktests/tests/ignitetest/services/ignite_app.py
@@ -36,10 +36,10 @@ class IgniteApplicationService(IgniteAwareService):
 # pylint: disable=R0913
 def __init__(self, context, config, java_class_name, num_nodes=1, 
params="", startup_timeout_sec=60,
  shutdown_timeout_sec=10, modules=None, 
servicejava_class_name=SERVICE_JAVA_CLASS_NAME, jvm_opts=None,
- 

[ignite-3] branch main updated: IGNITE-13836 Support for multiple configuration roots, REST module improvements (#14)

2021-01-22 Thread sergeychugunov
This is an automated email from the ASF dual-hosted git repository.

sergeychugunov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
 new 02512fe  IGNITE-13836 Support for multiple configuration roots, REST 
module improvements (#14)
02512fe is described below

commit 02512fe1970b5b9703b9296d178893f879fb7b8a
Author: Sergey Chugunov 
AuthorDate: Fri Jan 22 15:58:09 2021 +0300

IGNITE-13836 Support for multiple configuration roots, REST module 
improvements (#14)
---
 modules/configuration-annotation-processor/pom.xml |  12 ++
 .../processor/internal/Processor.java  |  32 -
 .../processor/internal/HasFieldMatcher.java|   2 +-
 .../processor/internal/HasMethodMatcher.java   |   2 +-
 .../processor/internal/ProcessorTest.java  |  11 +-
 .../sample/CacheConfigurationSchema.java   |   1 +
 .../sample/ClusterWideConfigurationSchema.java |   1 +
 ...hema.java => DiscoveryConfigurationSchema.java} |  14 +-
 .../sample/NetworkConfigurationSchema.java}|  16 ++-
 .../ignite/configuration/sample/UsageTest.java |  78 ---
 .../configuration/ConfigurationRegistry.java}  |  25 +++-
 .../apache/ignite/configuration/Configurator.java  |  17 +++
 .../org/apache/ignite/configuration/RootKey.java}  |  15 +-
 .../src/main/resources/bootstrap-config.json   |   1 -
 modules/{ignite-runner => rest}/pom.xml|  34 +++--
 .../java/org/apache/ignite/rest/ErrorResult.java   |   0
 .../java/org/apache/ignite/rest/RestModule.java| 153 +
 .../configuration}/RestConfigurationSchema.java|   5 +-
 .../presentation/ConfigurationPresentation.java|  52 +++
 .../ignite/rest}/presentation/FormatConverter.java |   7 +-
 .../rest}/presentation/json/JsonConverter.java |  17 ++-
 .../rest/presentation/json/JsonPresentation.java   |  83 +++
 modules/{ignite-runner => runner}/pom.xml  |   7 +
 .../java/org/apache/ignite/app/IgniteRunner.java   |  52 +--
 .../ignite/configuration/ConfigurationModule.java  |  38 ++---
 .../extended/AutoAdjustConfigurationSchema.java|   1 -
 .../extended/BaselineConfigurationSchema.java  |   0
 .../extended/DataStorageConfigurationSchema.java   |   0
 .../extended/LocalConfigurationSchema.java |   4 -
 .../org/apache/ignite/utils/IgniteProperties.java  |   0
 .../src/main/resources/bootstrap-config.json   |  19 +++
 .../src/main/resources/ignite.properties   |   0
 .../src/main/resources/simplelogger.properties |   0
 parent/pom.xml |   7 +
 pom.xml|   5 +-
 35 files changed, 529 insertions(+), 182 deletions(-)

diff --git a/modules/configuration-annotation-processor/pom.xml 
b/modules/configuration-annotation-processor/pom.xml
index a986a59..f74d5fd 100644
--- a/modules/configuration-annotation-processor/pom.xml
+++ b/modules/configuration-annotation-processor/pom.xml
@@ -64,6 +64,18 @@
 com.google.testing.compile
 compile-testing
 test
+
+
+junit
+junit
+
+
+
+
+
+org.hamcrest
+hamcrest-library
+test
 
 
 
diff --git 
a/modules/configuration-annotation-processor/src/main/java/org/apache/ignite/configuration/processor/internal/Processor.java
 
b/modules/configuration-annotation-processor/src/main/java/org/apache/ignite/configuration/processor/internal/Processor.java
index 50d10c9..b86a3c5 100644
--- 
a/modules/configuration-annotation-processor/src/main/java/org/apache/ignite/configuration/processor/internal/Processor.java
+++ 
b/modules/configuration-annotation-processor/src/main/java/org/apache/ignite/configuration/processor/internal/Processor.java
@@ -55,6 +55,7 @@ import javax.lang.model.util.Elements;
 import org.apache.ignite.configuration.ConfigurationTree;
 import org.apache.ignite.configuration.ConfigurationValue;
 import org.apache.ignite.configuration.Configurator;
+import org.apache.ignite.configuration.RootKey;
 import org.apache.ignite.configuration.annotation.Config;
 import org.apache.ignite.configuration.annotation.ConfigValue;
 import org.apache.ignite.configuration.annotation.NamedConfigValue;
@@ -273,6 +274,9 @@ public class Processor extends AbstractProcessor {
 // Create VIEW, INIT and CHANGE classes
 createPojoBindings(packageName, fields, schemaClassName, 
configurationClassBuilder, configurationInterfaceBuilder);
 
+if (isRoot)
+createRootKeyField(configInterface, configurationClassBuilder, 
configDesc);
+
 // Create constructors for configuration class
 createConstructors(configClass, configName, 
configurationClassBuilder, CONFIGURATOR_TYPE, 

[ignite] branch ignite-ducktape updated: IGNITE-14012 fix ducktape jmx_tools MBean pattern (#8672)

2021-01-22 Thread av
This is an automated email from the ASF dual-hosted git repository.

av pushed a commit to branch ignite-ducktape
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-ducktape by this push:
 new f904aa2  IGNITE-14012 fix ducktape jmx_tools MBean pattern (#8672)
f904aa2 is described below

commit f904aa29733932b05d93ed7ceded426d006ebc84
Author: Mikhail Filatov 
AuthorDate: Fri Jan 22 14:05:58 2021 +0300

IGNITE-14012 fix ducktape jmx_tools MBean pattern (#8672)
---
 modules/ducktests/tests/ignitetest/services/utils/jmx_utils.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/ducktests/tests/ignitetest/services/utils/jmx_utils.py 
b/modules/ducktests/tests/ignitetest/services/utils/jmx_utils.py
index a14d96d..c45fc90 100644
--- a/modules/ducktests/tests/ignitetest/services/utils/jmx_utils.py
+++ b/modules/ducktests/tests/ignitetest/services/utils/jmx_utils.py
@@ -187,7 +187,7 @@ class IgniteJmxMixin:
 """
 :return: IgniteKernal MBean.
 """
-return self.jmx_client().find_mbean('.*group=Kernal,name=IgniteKernal')
+return 
self.jmx_client().find_mbean('.*group=Kernal.*name=IgniteKernal')
 
 @memoize
 def disco_mbean(self):
@@ -197,6 +197,6 @@ class IgniteJmxMixin:
 disco_spi = next(self.kernal_mbean().DiscoverySpiFormatted).strip()
 
 if 'ZookeeperDiscoverySpi' in disco_spi:
-return 
self.jmx_client().find_mbean('.*group=SPIs,name=ZookeeperDiscoverySpi')
+return 
self.jmx_client().find_mbean('.*group=SPIs.*name=ZookeeperDiscoverySpi')
 
-return 
self.jmx_client().find_mbean('.*group=SPIs,name=TcpDiscoverySpi')
+return 
self.jmx_client().find_mbean('.*group=SPIs.*name=TcpDiscoverySpi')



[ignite-3] 01/01: Table access API. Draft. Simple examples added.

2021-01-22 Thread amashenkov
This is an automated email from the ASF dual-hosted git repository.

amashenkov pushed a commit to branch ignite-14035
in repository https://gitbox.apache.org/repos/asf/ignite-3.git

commit 528cfdec2de83ea3b87cd3ef03234aa78b05bec9
Author: Andrew Mashenkov 
AuthorDate: Fri Jan 22 13:01:57 2021 +0300

Table access API. Draft.
Simple examples added.
---
 modules/commons/pom.xml|  58 
 .../java/org/apache/ignite/storage/KVView.java |  29 ++
 .../main/java/org/apache/ignite/storage/Row.java   |  31 ++
 .../main/java/org/apache/ignite/storage/Table.java |  46 +++
 .../java/org/apache/ignite/storage/TableView.java  |  29 ++
 .../apache/ignite/storage/binary/BinaryObject.java |  25 ++
 .../ignite/storage/binary/BinaryObjects.java   |  27 ++
 .../apache/ignite/storage/mapper/KeyMapper.java|  24 ++
 .../org/apache/ignite/storage/mapper/Mappers.java  |  43 +++
 .../apache/ignite/storage/mapper/RowMapper.java|  32 ++
 .../apache/ignite/storage/mapper/ValueMapper.java  |  33 ++
 .../java/org/apache/ignite/storage/Example.java| 335 +
 pom.xml|   3 +-
 13 files changed, 714 insertions(+), 1 deletion(-)

diff --git a/modules/commons/pom.xml b/modules/commons/pom.xml
new file mode 100644
index 000..5ea7ce9
--- /dev/null
+++ b/modules/commons/pom.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+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;>
+4.0.0
+
+
+org.apache.ignite
+apache-ignite
+3.0.0-SNAPSHOT
+../../pom.xml
+
+
+ignite-commons
+
+
+
+org.jetbrains
+annotations
+${jetbrains.annotations.version}
+
+
+
+
+org.junit.jupiter
+junit-jupiter-api
+${junit.jupiter.version}
+test
+
+
+org.junit.jupiter
+junit-jupiter-params
+${junit.jupiter.version}
+test
+
+
+
diff --git 
a/modules/commons/src/main/java/org/apache/ignite/storage/KVView.java 
b/modules/commons/src/main/java/org/apache/ignite/storage/KVView.java
new file mode 100644
index 000..f093f75
--- /dev/null
+++ b/modules/commons/src/main/java/org/apache/ignite/storage/KVView.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.storage;
+
+/**
+ *
+ */
+public interface KVView {
+public V get(K key);
+
+public V put(K key, V val);
+
+public boolean putIfAbsent(K key, V val);
+}
diff --git a/modules/commons/src/main/java/org/apache/ignite/storage/Row.java 
b/modules/commons/src/main/java/org/apache/ignite/storage/Row.java
new file mode 100644
index 000..06f5800
--- /dev/null
+++ b/modules/commons/src/main/java/org/apache/ignite/storage/Row.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.storage;
+
+import org.apache.ignite.storage.binary.BinaryObject;
+
+/**
+ *
+ */
+public interface Row {
+public  T field(String name);
+
+public BinaryObject binaryObjectField(String fieldName);
+
+int intField(String fieldName);
+}
diff --git a/modules/commons/src/main/java/org/apache/ignite/storage/Table.java 

[ignite-3] branch ignite-14035 created (now 528cfde)

2021-01-22 Thread amashenkov
This is an automated email from the ASF dual-hosted git repository.

amashenkov pushed a change to branch ignite-14035
in repository https://gitbox.apache.org/repos/asf/ignite-3.git.


  at 528cfde  Table access API. Draft. Simple examples added.

This branch includes the following new commits:

 new 528cfde  Table access API. Draft. Simple examples added.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[ignite-3] branch ignite-13885 updated: IGNITE-13885 Bugfixing.

2021-01-22 Thread ascherbakov
This is an automated email from the ASF dual-hosted git repository.

ascherbakov pushed a commit to branch ignite-13885
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/ignite-13885 by this push:
 new fbd7d2d  IGNITE-13885 Bugfixing.
fbd7d2d is described below

commit fbd7d2d9f1ee807c5e0f929ab178e002e85e160e
Author: Alexey Scherbakov 
AuthorDate: Fri Jan 22 11:59:32 2021 +0300

IGNITE-13885 Bugfixing.
---
 .../alipay/sofa/jraft/counter/CounterExampleTest.java   |  7 ---
 .../com/alipay/sofa/jraft/counter/CounterServer.java| 17 +
 .../test/java/com/alipay/sofa/jraft/test/TestUtils.java |  6 +++---
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git 
a/modules/raft/src/test/java/com/alipay/sofa/jraft/counter/CounterExampleTest.java
 
b/modules/raft/src/test/java/com/alipay/sofa/jraft/counter/CounterExampleTest.java
index d03c2f2..81d378e 100644
--- 
a/modules/raft/src/test/java/com/alipay/sofa/jraft/counter/CounterExampleTest.java
+++ 
b/modules/raft/src/test/java/com/alipay/sofa/jraft/counter/CounterExampleTest.java
@@ -58,7 +58,6 @@ public class CounterExampleTest {
 
 @Test
 public void testCounter() throws IOException, InterruptedException, 
TimeoutException, RemotingException {
-
 try {
 String initConfStr = 
"127.0.0.1:8080,127.0.0.1:8081,127.0.0.1:8082";
 
@@ -69,7 +68,9 @@ public class CounterExampleTest {
 CounterServer node1 = CounterServer.start(dataPath, groupId, 
"127.0.0.1:8081", initConfStr);
 CounterServer node2 = CounterServer.start(dataPath, groupId, 
"127.0.0.1:8082", initConfStr);
 
-Thread.sleep(3000);
+LOG.info("Waiting for leader election");
+
+Thread.sleep(2000);
 
 // Create client.
 final Configuration conf = new Configuration();
@@ -87,7 +88,7 @@ public class CounterExampleTest {
 
 final PeerId leader = 
RouteTable.getInstance().selectLeader(groupId);
 System.out.println("Leader is " + leader);
-final int n = 1;
+final int n = 1000;
 final CountDownLatch latch = new CountDownLatch(n);
 final long start = System.currentTimeMillis();
 for (int i = 0; i < n; i++) {
diff --git 
a/modules/raft/src/test/java/com/alipay/sofa/jraft/counter/CounterServer.java 
b/modules/raft/src/test/java/com/alipay/sofa/jraft/counter/CounterServer.java
index e6fa618..9461ceb 100644
--- 
a/modules/raft/src/test/java/com/alipay/sofa/jraft/counter/CounterServer.java
+++ 
b/modules/raft/src/test/java/com/alipay/sofa/jraft/counter/CounterServer.java
@@ -116,14 +116,10 @@ public class CounterServer {
 
 public static CounterServer start(String dataPath, String groupId, String 
serverIdStr, String initConfStr) throws IOException {
 final NodeOptions nodeOptions = new NodeOptions();
-// 为了测试,调整 snapshot 间隔等参数
-// 设置选举超时时间为 1 秒
+
 nodeOptions.setElectionTimeoutMs(1000);
-// 关闭 CLI 服务。
 nodeOptions.setDisableCli(false);
-// 每隔30秒做一次 snapshot
 nodeOptions.setSnapshotIntervalSecs(30);
-// 解析参数
 final PeerId serverId = new PeerId();
 if (!serverId.parse(serverIdStr)) {
 throw new IllegalArgumentException("Fail to parse serverId:" + 
serverIdStr);
@@ -132,11 +128,16 @@ public class CounterServer {
 if (!initConf.parse(initConfStr)) {
 throw new IllegalArgumentException("Fail to parse initConf:" + 
initConfStr);
 }
-// 设置初始集群配置
 nodeOptions.setInitialConf(initConf);
 
-// 启动
-final CounterServer counterServer = new CounterServer(dataPath, 
groupId, serverId, nodeOptions);
+File serverData = new File(dataPath, serverIdStr.replaceAll("\\W+", 
""));
+
+if (!serverData.exists()) {
+if (!serverData.mkdirs())
+throw new IllegalArgumentException("Failed to create server 
data path:" + serverData);
+}
+
+final CounterServer counterServer = new 
CounterServer(serverData.getPath(), groupId, serverId, nodeOptions);
 System.out.println("Started counter server at port:"
+ 
counterServer.getNode().getNodeId().getPeerId().getPort());
 
diff --git 
a/modules/raft/src/test/java/com/alipay/sofa/jraft/test/TestUtils.java 
b/modules/raft/src/test/java/com/alipay/sofa/jraft/test/TestUtils.java
index 4bd1926..b41f44f 100644
--- a/modules/raft/src/test/java/com/alipay/sofa/jraft/test/TestUtils.java
+++ b/modules/raft/src/test/java/com/alipay/sofa/jraft/test/TestUtils.java
@@ -67,9 +67,9 @@ public class TestUtils {
 }
 
 public static String mkTempDir() {
-String userDirectory = System.getProperty("user.dir");
-// String tmpDir = System.getProperty("java.io.tmpdir", "/tmp");
-return Paths.get(userDirectory, "jraft_test_" + 
System.nanoTime()).toString();
+