You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/12/17 09:10:17 UTC
[1/6] ignite git commit: IGNITE-2153: .NET: Added package
descriptions.
Repository: ignite
Updated Branches:
refs/heads/ignite-2100 2ffeae1a5 -> 4f4e1565f
IGNITE-2153: .NET: Added package descriptions.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b028a267
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b028a267
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b028a267
Branch: refs/heads/ignite-2100
Commit: b028a2677166b5cbbd613d80bd52b11a7f3b6dbe
Parents: ea64f3a
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Wed Dec 16 17:04:50 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Dec 16 17:04:50 2015 +0300
----------------------------------------------------------------------
.../Apache.Ignite.Core.csproj | 20 ++++++++++-
.../Apache.Ignite.Core/Binary/Package-Info.cs | 26 ++++++++++++++
.../Cache/Event/Package-Info.cs | 26 ++++++++++++++
.../Cache/Expiry/Package-Info.cs | 26 ++++++++++++++
.../Apache.Ignite.Core/Cache/Package-Info.cs | 26 ++++++++++++++
.../Cache/Query/Continuous/Package-Info.cs | 26 ++++++++++++++
.../Cache/Query/Package-Info.cs | 26 ++++++++++++++
.../Cache/Store/Package-Info.cs | 26 ++++++++++++++
.../Apache.Ignite.Core/Cluster/Package-Info.cs | 26 ++++++++++++++
.../Apache.Ignite.Core/Common/Package-Info.cs | 26 ++++++++++++++
.../Apache.Ignite.Core/Compute/IComputeTask.cs | 11 +++---
.../Apache.Ignite.Core/Compute/Package-Info.cs | 26 ++++++++++++++
.../DataStructures/Package-Info.cs | 26 ++++++++++++++
.../Datastream/Package-Info.cs | 26 ++++++++++++++
.../Apache.Ignite.Core/Events/Package-Info.cs | 26 ++++++++++++++
.../dotnet/Apache.Ignite.Core/Impl/Ignite.cs | 8 -----
.../dotnet/Apache.Ignite.Core/Index.cs | 31 -----------------
.../Lifecycle/Package-Info.cs | 26 ++++++++++++++
.../Messaging/Package-Info.cs | 26 ++++++++++++++
.../dotnet/Apache.Ignite.Core/Package-Info.cs | 36 ++++++++++++++++++++
.../Apache.Ignite.Core/Resource/Package-Info.cs | 26 ++++++++++++++
.../Apache.Ignite.Core/Services/Package-Info.cs | 26 ++++++++++++++
.../Transactions/Package-Info.cs | 26 ++++++++++++++
23 files changed, 527 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
index 740852d..f758863 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
@@ -54,6 +54,7 @@
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Binary\Package-Info.cs" />
<Compile Include="Cache\CacheAtomicUpdateTimeoutException.cs" />
<Compile Include="Cache\CacheEntryProcessorException.cs" />
<Compile Include="Cache\CacheException.cs" />
@@ -63,8 +64,10 @@
<Compile Include="Cache\Event\ICacheEntryEvent.cs" />
<Compile Include="Cache\Event\ICacheEntryEventFilter.cs" />
<Compile Include="Cache\Event\ICacheEntryEventListener.cs" />
+ <Compile Include="Cache\Event\Package-Info.cs" />
<Compile Include="Cache\Expiry\ExpiryPolicy.cs" />
<Compile Include="Cache\Expiry\IExpiryPolicy.cs" />
+ <Compile Include="Cache\Expiry\Package-Info.cs" />
<Compile Include="Cache\ICache.cs" />
<Compile Include="Cache\ICacheAffinity.cs" />
<Compile Include="Cache\ICacheEntry.cs" />
@@ -75,9 +78,12 @@
<Compile Include="Cache\ICacheMetrics.cs" />
<Compile Include="Cache\CacheResult.cs" />
<Compile Include="Cache\IMutableCacheEntry.cs" />
+ <Compile Include="Cache\Package-Info.cs" />
<Compile Include="Cache\Query\Continuous\ContinuousQuery.cs" />
<Compile Include="Cache\Query\Continuous\IContinuousQueryHandle.cs" />
+ <Compile Include="Cache\Query\Continuous\Package-Info.cs" />
<Compile Include="Cache\Query\IQueryCursor.cs" />
+ <Compile Include="Cache\Query\Package-Info.cs" />
<Compile Include="Cache\Query\QueryBase.cs" />
<Compile Include="Cache\Query\ScanQuery.cs" />
<Compile Include="Cache\Query\SqlFieldsQuery.cs" />
@@ -88,6 +94,7 @@
<Compile Include="Cache\Store\CacheStoreException.cs" />
<Compile Include="Cache\Store\ICacheStore.cs" />
<Compile Include="Cache\Store\ICacheStoreSession.cs" />
+ <Compile Include="Cache\Store\Package-Info.cs" />
<Compile Include="Cluster\ClusterGroupEmptyException.cs" />
<Compile Include="Cluster\ClusterTopologyException.cs" />
<Compile Include="Cluster\ICluster.cs" />
@@ -95,8 +102,10 @@
<Compile Include="Cluster\IClusterMetrics.cs" />
<Compile Include="Cluster\IClusterNode.cs" />
<Compile Include="Cluster\IClusterNodeFilter.cs" />
+ <Compile Include="Cluster\Package-Info.cs" />
<Compile Include="Common\IgniteException.cs" />
<Compile Include="Common\IgniteGuid.cs" />
+ <Compile Include="Common\Package-Info.cs" />
<Compile Include="Compute\ComputeExecutionRejectedException.cs" />
<Compile Include="Compute\ComputeJobAdapter.cs" />
<Compile Include="Compute\ComputeJobFailoverException.cs" />
@@ -113,11 +122,14 @@
<Compile Include="Compute\IComputeJobResult.cs" />
<Compile Include="Compute\IComputeReducer.cs" />
<Compile Include="Compute\IComputeTask.cs" />
+ <Compile Include="Compute\Package-Info.cs" />
<Compile Include="Datastream\IDataStreamer.cs" />
<Compile Include="Datastream\IStreamReceiver.cs" />
+ <Compile Include="Datastream\Package-Info.cs" />
<Compile Include="Datastream\StreamTransformer.cs" />
<Compile Include="Datastream\StreamVisitor.cs" />
<Compile Include="DataStructures\IAtomicLong.cs" />
+ <Compile Include="DataStructures\Package-Info.cs" />
<Compile Include="Events\CacheEvent.cs" />
<Compile Include="Events\CacheQueryExecutedEvent.cs" />
<Compile Include="Events\CacheQueryReadEvent.cs" />
@@ -132,6 +144,7 @@
<Compile Include="Events\IEventListener.cs" />
<Compile Include="Events\IEvents.cs" />
<Compile Include="Events\JobEvent.cs" />
+ <Compile Include="Events\Package-Info.cs" />
<Compile Include="Events\SwapSpaceEvent.cs" />
<Compile Include="Events\TaskEvent.cs" />
<Compile Include="GlobalSuppressions.cs" />
@@ -309,7 +322,9 @@
<Compile Include="Impl\Unmanaged\UnmanagedNonReleaseableTarget.cs" />
<Compile Include="Impl\Unmanaged\UnmanagedTarget.cs" />
<Compile Include="Impl\Unmanaged\UnmanagedUtils.cs" />
- <Compile Include="Index.cs" />
+ <Compile Include="Lifecycle\Package-Info.cs" />
+ <Compile Include="Messaging\Package-Info.cs" />
+ <Compile Include="Package-Info.cs" />
<Compile Include="Lifecycle\ILifecycleBean.cs" />
<Compile Include="Lifecycle\LifecycleEventType.cs" />
<Compile Include="Messaging\IMessageListener.cs" />
@@ -332,16 +347,19 @@
<Compile Include="Binary\BinaryTypeNames.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resource\InstanceResourceAttribute.cs" />
+ <Compile Include="Resource\Package-Info.cs" />
<Compile Include="Resource\StoreSessionResourceAttribute.cs" />
<Compile Include="Services\IService.cs" />
<Compile Include="Services\IServiceContext.cs" />
<Compile Include="Services\IServiceDescriptor.cs" />
<Compile Include="Services\IServices.cs" />
+ <Compile Include="Services\Package-Info.cs" />
<Compile Include="Services\ServiceConfiguration.cs" />
<Compile Include="Services\ServiceInvocationException.cs" />
<Compile Include="Transactions\ITransaction.cs" />
<Compile Include="Transactions\ITransactionMetrics.cs" />
<Compile Include="Transactions\ITransactions.cs" />
+ <Compile Include="Transactions\Package-Info.cs" />
<Compile Include="Transactions\TransactionConcurrency.cs" />
<Compile Include="Transactions\TransactionHeuristicException.cs" />
<Compile Include="Transactions\TransactionIsolation.cs" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Binary/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/Package-Info.cs
new file mode 100644
index 0000000..fd01160
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains Ignite Binary Objects API classes.
+/// </summary>
+namespace Apache.Ignite.Core.Binary
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Event/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Event/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Event/Package-Info.cs
new file mode 100644
index 0000000..0d3dbb0
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Event/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Cache events API.
+/// </summary>
+namespace Apache.Ignite.Core.Cache.Event
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Expiry/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Expiry/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Expiry/Package-Info.cs
new file mode 100644
index 0000000..23a82a4
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Expiry/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Cache expiration API.
+/// </summary>
+namespace Apache.Ignite.Core.Cache.Expiry
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Package-Info.cs
new file mode 100644
index 0000000..4dd7439
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains main Data Grid APIs.
+/// </summary>
+namespace Apache.Ignite.Core.Cache
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/Package-Info.cs
new file mode 100644
index 0000000..2ba6dfe
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains APIs for creating and executing cache continuous queries.
+/// </summary>
+namespace Apache.Ignite.Core.Cache.Query.Continuous
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Package-Info.cs
new file mode 100644
index 0000000..2e83364
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains APIs for creating and executing cache queries.
+/// </summary>
+namespace Apache.Ignite.Core.Cache.Query
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/Package-Info.cs
new file mode 100644
index 0000000..c2772a4
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains cache store interfaces.
+/// </summary>
+namespace Apache.Ignite.Core.Cache.Store
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/Package-Info.cs
new file mode 100644
index 0000000..b62fa40
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains cluster-related classes.
+/// </summary>
+namespace Apache.Ignite.Core.Cluster
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Common/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Common/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Common/Package-Info.cs
new file mode 100644
index 0000000..1e7ea89
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Common/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Common Ignite types.
+/// </summary>
+namespace Apache.Ignite.Core.Common
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Compute/IComputeTask.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/IComputeTask.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/IComputeTask.cs
index 87aebda..5ae1420 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/IComputeTask.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/IComputeTask.cs
@@ -33,7 +33,7 @@ namespace Apache.Ignite.Core.Compute
/// <description>Inject annotated resources into task instance.</description>
/// </item>
/// <item>
- /// <description>Apply <see cref="IComputeTask{A,T,R}.Map(IList{IClusterNode}, TArg)"/>.
+ /// <description>Apply <see cref="Map"/>.
/// This method is responsible for splitting business logic into multiple jobs
/// (units of execution) and mapping them to Ignite nodes.</description>
/// </item>
@@ -41,8 +41,7 @@ namespace Apache.Ignite.Core.Compute
/// <description>System will send mapped Ignite jobs to their respective nodes.</description>
/// </item>
/// <item>
- /// <description>Once job execution results become available method
- /// <see cref="IComputeTask{A,T,R}.OnResult(IComputeJobResult{TJobRes}, IList{IComputeJobResult{TJobRes}})"/>
+ /// <description>Once job execution results become available, <see cref="OnResult"/> method
/// will be called for ech received job result. The policy returned by this method will
/// determine the way task reacts to every job result.
/// <para />
@@ -65,10 +64,8 @@ namespace Apache.Ignite.Core.Compute
/// </description>
/// </item>
/// <item>
- /// <description>Once all results are received or
- /// <see cref="IComputeTask{A,T,R}.OnResult(IComputeJobResult{TJobRes}, IList{IComputeJobResult{TJobRes}})"/>
- /// method returned <see cref="ComputeJobResultPolicy.Reduce"/> policy, method
- /// <see cref="IComputeTask{A,T,R}.Reduce(IList{IComputeJobResult{TJobRes}})"/>
+ /// <description>Once all results are received or <see cref="OnResult"/>
+ /// method returned <see cref="ComputeJobResultPolicy.Reduce"/> policy, method <see cref="Reduce"/>
/// is called to aggregate received results into one final result. Once this method is finished the
/// execution of the Ignite task is complete. This result will be returned to the user through future.
/// </description>
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Compute/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/Package-Info.cs
new file mode 100644
index 0000000..2221c5f
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains Compute Grid functionality.
+/// </summary>
+namespace Apache.Ignite.Core.Compute
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/DataStructures/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/DataStructures/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/DataStructures/Package-Info.cs
new file mode 100644
index 0000000..4b8595f
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/DataStructures/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Distributed data structures.
+/// </summary>
+namespace Apache.Ignite.Core.DataStructures
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/Package-Info.cs
new file mode 100644
index 0000000..9d7790e
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains Ignite Streamer classes.
+/// </summary>
+namespace Apache.Ignite.Core.Datastream
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Events/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/Package-Info.cs
new file mode 100644
index 0000000..e832b74
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains Event Subscription functionality together with various events emitted by Ignite.
+/// </summary>
+namespace Apache.Ignite.Core.Events
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
index 5b952b1..2fcada3 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
@@ -15,14 +15,6 @@
* limitations under the License.
*/
-/**
- * \mainpage Apache Ignite.NET
- *
- * Apache Ignite In-Memory Data Fabric is a high-performance, integrated and distributed in-memory platform for
- * computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with
- * traditional disk-based or flash-based technologies.
- */
-
namespace Apache.Ignite.Core.Impl
{
using System;
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Index.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Index.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Index.cs
deleted file mode 100644
index c6dc5d8..0000000
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Index.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-
-namespace Apache.Ignite.Core
-{
- // Doxygen main page
-
- /**
-
- \mainpage Apache Ignite.NET In-Memory Data Fabric
-
- Apache Ignite.NET In-Memory Data Fabric is a high-performance, integrated and distributed in-memory platform for
- computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with
- traditional disk-based or flash-based technologies.
-
- */
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Lifecycle/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Lifecycle/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Lifecycle/Package-Info.cs
new file mode 100644
index 0000000..ca743ea
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Lifecycle/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains lifecycle-related classes.
+/// </summary>
+namespace Apache.Ignite.Core.Lifecycle
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Messaging/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Messaging/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Messaging/Package-Info.cs
new file mode 100644
index 0000000..b991821
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Messaging/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains Topic-based Messaging functionality.
+/// </summary>
+namespace Apache.Ignite.Core.Messaging
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Package-Info.cs
new file mode 100644
index 0000000..8f6421e
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Package-Info.cs
@@ -0,0 +1,36 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains Ignite APIs.
+/// </summary>
+namespace Apache.Ignite.Core
+{
+ // Doxygen main page
+
+ /**
+
+ \mainpage Apache Ignite.NET In-Memory Data Fabric
+
+ Apache Ignite.NET In-Memory Data Fabric is a high-performance, integrated and distributed in-memory platform for
+ computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with
+ traditional disk-based or flash-based technologies.
+
+ */
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Resource/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Resource/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Resource/Package-Info.cs
new file mode 100644
index 0000000..dbf4101
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Resource/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains attributes to inject resources into user-defined code such as tasks, jobs, entry processors.
+/// </summary>
+namespace Apache.Ignite.Core.Resource
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Services/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Services/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Services/Package-Info.cs
new file mode 100644
index 0000000..435b930
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Services/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains Managed Services APIs.
+/// </summary>
+namespace Apache.Ignite.Core.Services
+{
+ // No-op.
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b028a267/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/Package-Info.cs
new file mode 100644
index 0000000..e63c2c6
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/Package-Info.cs
@@ -0,0 +1,26 @@
+/*
+* 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.
+*/
+
+#pragma warning disable 1587 // invalid XML comment
+
+/// <summary>
+/// Contains transaction-related classes.
+/// </summary>
+namespace Apache.Ignite.Core.Transactions
+{
+ // No-op.
+}
[6/6] ignite git commit: Merge branch 'ignite-1.5' into ignite-2100
Posted by vo...@apache.org.
Merge branch 'ignite-1.5' into ignite-2100
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4f4e1565
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4f4e1565
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4f4e1565
Branch: refs/heads/ignite-2100
Commit: 4f4e1565f03c443c72c8d744c9aafeac5b8107a9
Parents: 2ffeae1 7f35bc6
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Dec 17 11:11:08 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Dec 17 11:11:08 2015 +0300
----------------------------------------------------------------------
.../store/dummy/CacheDummyPersonStore.java | 113 -----
.../store/dummy/CacheDummyStoreExample.java | 133 ------
.../datagrid/store/dummy/package-info.java | 22 -
.../store/jdbc/CacheJdbcPersonStore.java | 43 +-
.../store/jdbc/CacheJdbcStoreExample.java | 24 +-
.../store/spring/CacheSpringPersonStore.java | 131 -----
.../store/spring/CacheSpringStoreExample.java | 147 ------
.../datagrid/store/spring/package-info.java | 22 -
.../ignite/examples/CacheExamplesSelfTest.java | 10 +-
.../processors/cache/GridCacheProcessor.java | 8 +-
.../cache/GridCacheSharedContext.java | 20 +
.../dht/CacheDistributedGetFutureAdapter.java | 2 +-
.../dht/GridPartitionedGetFuture.java | 15 +-
.../dht/GridPartitionedSingleGetFuture.java | 8 +
.../dht/atomic/GridNearAtomicUpdateFuture.java | 10 +-
.../colocated/GridDhtColocatedLockFuture.java | 2 +-
.../distributed/near/GridNearGetFuture.java | 17 +-
.../distributed/near/GridNearLockFuture.java | 30 +-
...ridNearOptimisticTxPrepareFutureAdapter.java | 6 +-
.../cache/transactions/IgniteTxManager.java | 6 +-
.../cache/IgniteCacheNearLockValueSelfTest.java | 11 +-
.../IgniteCacheStoreValueAbstractTest.java | 2 +-
.../IgniteStartCacheInTransactionSelfTest.java | 39 +-
.../CacheGetInsideLockChangingTopologyTest.java | 475 +++++++++++++++++++
.../IgniteCacheFailoverTestSuite3.java | 2 +
.../Apache.Ignite.Core.csproj | 20 +-
.../Apache.Ignite.Core/Binary/Package-Info.cs | 26 +
.../Cache/Event/Package-Info.cs | 26 +
.../Cache/Expiry/Package-Info.cs | 26 +
.../Apache.Ignite.Core/Cache/Package-Info.cs | 26 +
.../Cache/Query/Continuous/Package-Info.cs | 26 +
.../Cache/Query/Package-Info.cs | 26 +
.../Cache/Store/Package-Info.cs | 26 +
.../Apache.Ignite.Core/Cluster/Package-Info.cs | 26 +
.../Apache.Ignite.Core/Common/Package-Info.cs | 26 +
.../Apache.Ignite.Core/Compute/IComputeTask.cs | 11 +-
.../Apache.Ignite.Core/Compute/Package-Info.cs | 26 +
.../DataStructures/Package-Info.cs | 26 +
.../Datastream/Package-Info.cs | 26 +
.../Apache.Ignite.Core/Events/Package-Info.cs | 26 +
.../dotnet/Apache.Ignite.Core/Impl/Ignite.cs | 8 -
.../dotnet/Apache.Ignite.Core/Index.cs | 31 --
.../Lifecycle/Package-Info.cs | 26 +
.../Messaging/Package-Info.cs | 26 +
.../dotnet/Apache.Ignite.Core/Package-Info.cs | 36 ++
.../Apache.Ignite.Core/Resource/Package-Info.cs | 26 +
.../Apache.Ignite.Core/Services/Package-Info.cs | 26 +
.../Transactions/Package-Info.cs | 26 +
48 files changed, 1149 insertions(+), 723 deletions(-)
----------------------------------------------------------------------
[3/6] ignite git commit: ignite-2146 Avoid hang in 'cache.get' if
topology locked.
Posted by vo...@apache.org.
ignite-2146 Avoid hang in 'cache.get' if topology locked.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/96dc238f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/96dc238f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/96dc238f
Branch: refs/heads/ignite-2100
Commit: 96dc238fd3e159c68ba54eef2fc6f3589aa6b2ca
Parents: d8c8214
Author: sboikov <sb...@gridgain.com>
Authored: Thu Dec 17 08:45:48 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Dec 17 08:45:48 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 8 +-
.../cache/GridCacheSharedContext.java | 20 +
.../dht/CacheDistributedGetFutureAdapter.java | 2 +-
.../dht/GridPartitionedGetFuture.java | 15 +-
.../dht/GridPartitionedSingleGetFuture.java | 8 +
.../dht/atomic/GridNearAtomicUpdateFuture.java | 10 +-
.../colocated/GridDhtColocatedLockFuture.java | 2 +-
.../distributed/near/GridNearGetFuture.java | 17 +-
.../distributed/near/GridNearLockFuture.java | 30 +-
...ridNearOptimisticTxPrepareFutureAdapter.java | 6 +-
.../cache/transactions/IgniteTxManager.java | 6 +-
.../cache/IgniteCacheNearLockValueSelfTest.java | 11 +-
.../IgniteCacheStoreValueAbstractTest.java | 2 +-
.../IgniteStartCacheInTransactionSelfTest.java | 39 +-
.../CacheGetInsideLockChangingTopologyTest.java | 475 +++++++++++++++++++
.../IgniteCacheFailoverTestSuite3.java | 2 +
16 files changed, 593 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index f0bed99..380c163 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -3343,16 +3343,14 @@ public class GridCacheProcessor extends GridProcessorAdapter {
* @throws IgniteException If transaction exist.
*/
private void checkEmptyTransactions() throws IgniteException {
- if (transactions().tx() != null)
- throw new IgniteException("Cannot start/stop cache within transaction.");
-
- if (sharedCtx.mvcc().lastExplicitLockTopologyVersion(Thread.currentThread().getId()) != null)
- throw new IgniteException("Cannot start/stop cache within lock.");
+ if (transactions().tx() != null || sharedCtx.lockedTopologyVersion(null) != null)
+ throw new IgniteException("Cannot start/stop cache within lock or transaction.");
}
/**
* @param val Object to check.
* @throws IgniteCheckedException If validation failed.
+ * @return Configuration copy.
*/
private CacheConfiguration cloneCheckSerializable(CacheConfiguration val) throws IgniteCheckedException {
if (val == null)
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
index 608829a..5ed1df9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
@@ -572,6 +572,26 @@ public class GridCacheSharedContext<K, V> {
}
/**
+ * @param ignore Transaction to ignore.
+ * @return Not null topology version if current thread holds lock preventing topology change.
+ */
+ @Nullable public AffinityTopologyVersion lockedTopologyVersion(IgniteInternalTx ignore) {
+ long threadId = Thread.currentThread().getId();
+
+ IgniteInternalTx tx = txMgr.anyActiveThreadTx(threadId, ignore);
+
+ AffinityTopologyVersion topVer = null;
+
+ if (tx != null && tx.topologyVersionSnapshot() != null)
+ topVer = tx.topologyVersionSnapshot();
+
+ if (topVer == null)
+ topVer = mvccMgr.lastExplicitLockTopologyVersion(threadId);
+
+ return topVer;
+ }
+
+ /**
* Nulling references to potentially leak-prone objects.
*/
public void cleanup() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
index 320c3c2..cfbc21b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
@@ -87,7 +87,7 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCompoun
protected IgniteCacheExpiryPolicy expiryPlc;
/** Flag indicating that get should be done on a locked topology version. */
- protected final boolean canRemap;
+ protected boolean canRemap;
/** */
protected final boolean needVer;
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
index 6867e21..e8aaca0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
@@ -133,10 +133,19 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
* Initializes future.
*/
public void init() {
- AffinityTopologyVersion topVer = this.topVer.topologyVersion() > 0 ? this.topVer :
- canRemap ? cctx.affinity().affinityTopologyVersion() : cctx.shared().exchange().readyAffinityVersion();
+ AffinityTopologyVersion lockedTopVer = cctx.shared().lockedTopologyVersion(null);
- map(keys, Collections.<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>>emptyMap(), topVer);
+ if (lockedTopVer != null) {
+ canRemap = false;
+
+ map(keys, Collections.<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>>emptyMap(), lockedTopVer);
+ }
+ else {
+ AffinityTopologyVersion topVer = this.topVer.topologyVersion() > 0 ? this.topVer :
+ canRemap ? cctx.affinity().affinityTopologyVersion() : cctx.shared().exchange().readyAffinityVersion();
+
+ map(keys, Collections.<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>>emptyMap(), topVer);
+ }
markInitialized();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
index 5d0814f..29971fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
@@ -156,6 +156,14 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter<Object> im
) {
assert key != null;
+ AffinityTopologyVersion lockedTopVer = cctx.shared().lockedTopologyVersion(null);
+
+ if (lockedTopVer != null) {
+ topVer = lockedTopVer;
+
+ canRemap = false;
+ }
+
this.cctx = cctx;
this.key = key;
this.readThrough = readThrough;
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index b384bab..eefdc73 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -278,15 +278,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
* Performs future mapping.
*/
public void map() {
- AffinityTopologyVersion topVer = null;
-
- IgniteInternalTx tx = cctx.tm().anyActiveThreadTx(null);
-
- if (tx != null && tx.topologyVersionSnapshot() != null)
- topVer = tx.topologyVersionSnapshot();
-
- if (topVer == null)
- topVer = cctx.mvcc().lastExplicitLockTopologyVersion(Thread.currentThread().getId());
+ AffinityTopologyVersion topVer = cctx.shared().lockedTopologyVersion(null);
if (topVer == null)
mapOnTopology();
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index d3028ca..22b329c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -597,7 +597,7 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture
// If there is another system transaction in progress, use it's topology version to prevent deadlock.
if (topVer == null && tx != null && tx.system()) {
- IgniteInternalTx tx0 = cctx.tm().anyActiveThreadTx(tx);
+ IgniteInternalTx tx0 = cctx.tm().anyActiveThreadTx(Thread.currentThread().getId(), tx);
if (tx0 != null)
topVer = tx0.topologyVersionSnapshot();
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
index cb866e3..a121af9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
@@ -142,11 +142,20 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
* Initializes future.
*/
public void init() {
- AffinityTopologyVersion topVer = tx == null ?
- (canRemap ? cctx.affinity().affinityTopologyVersion() : cctx.shared().exchange().readyAffinityVersion()) :
- tx.topologyVersion();
+ AffinityTopologyVersion lockedTopVer = cctx.shared().lockedTopologyVersion(null);
- map(keys, Collections.<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>>emptyMap(), topVer);
+ if (lockedTopVer != null) {
+ canRemap = false;
+
+ map(keys, Collections.<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>>emptyMap(), lockedTopVer);
+ }
+ else {
+ AffinityTopologyVersion topVer = tx == null ?
+ (canRemap ? cctx.affinity().affinityTopologyVersion() : cctx.shared().exchange().readyAffinityVersion()) :
+ tx.topologyVersion();
+
+ map(keys, Collections.<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>>emptyMap(), topVer);
+ }
markInitialized();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index 4cb7248..23e0f6b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -56,8 +56,10 @@ import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
+import org.apache.ignite.internal.util.typedef.C1;
import org.apache.ignite.internal.util.typedef.C2;
import org.apache.ignite.internal.util.typedef.CI1;
+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.S;
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -163,6 +165,7 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean
* @param accessTtl TTL for read operation.
* @param filter Filter.
* @param skipStore skipStore
+ * @param keepBinary Keep binary flag.
*/
public GridNearLockFuture(
GridCacheContext<?, ?> cctx,
@@ -678,7 +681,22 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean
/** {@inheritDoc} */
@Override public String toString() {
- return S.toString(GridNearLockFuture.class, this, "inTx", inTx(), "super", super.toString());
+ Collection<String> futs = F.viewReadOnly(futures(), new C1<IgniteInternalFuture<?>, String>() {
+ @Override public String apply(IgniteInternalFuture<?> f) {
+ if (isMini(f)) {
+ MiniFuture m = (MiniFuture)f;
+
+ return "[node=" + m.node().id() + ", loc=" + m.node().isLocal() + ", done=" + f.isDone() + "]";
+ }
+ else
+ return "[loc=true, done=" + f.isDone() + "]";
+ }
+ });
+
+ return S.toString(GridNearLockFuture.class, this,
+ "innerFuts", futs,
+ "inTx", inTx(),
+ "super", super.toString());
}
/**
@@ -700,11 +718,13 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean
*/
void map() {
// Obtain the topology version to use.
- AffinityTopologyVersion topVer = cctx.mvcc().lastExplicitLockTopologyVersion(Thread.currentThread().getId());
+ long threadId = Thread.currentThread().getId();
+
+ AffinityTopologyVersion topVer = cctx.mvcc().lastExplicitLockTopologyVersion(threadId);
// If there is another system transaction in progress, use it's topology version to prevent deadlock.
if (topVer == null && tx != null && tx.system()) {
- IgniteInternalTx tx0 = cctx.tm().anyActiveThreadTx(tx);
+ IgniteInternalTx tx0 = cctx.tm().anyActiveThreadTx(threadId, tx);
if (tx0 != null)
topVer = tx0.topologyVersionSnapshot();
@@ -1273,8 +1293,6 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean
cctx.io().send(node, req, cctx.ioPolicy());
}
catch (ClusterTopologyCheckedException ex) {
- assert fut != null;
-
fut.onResult(ex);
}
}
@@ -1288,8 +1306,6 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean
cctx.io().send(node, req, cctx.ioPolicy());
}
catch (ClusterTopologyCheckedException ex) {
- assert fut != null;
-
fut.onResult(ex);
}
catch (IgniteCheckedException e) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
index 5c7553f..b3eab34 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
@@ -50,11 +50,13 @@ public abstract class GridNearOptimisticTxPrepareFutureAdapter extends GridNearT
/** {@inheritDoc} */
@Override public final void prepare() {
// Obtain the topology version to use.
- AffinityTopologyVersion topVer = cctx.mvcc().lastExplicitLockTopologyVersion(Thread.currentThread().getId());
+ long threadId = Thread.currentThread().getId();
+
+ AffinityTopologyVersion topVer = cctx.mvcc().lastExplicitLockTopologyVersion(threadId);
// If there is another system transaction in progress, use it's topology version to prevent deadlock.
if (topVer == null && tx != null && tx.system()) {
- IgniteInternalTx tx0 = cctx.tm().anyActiveThreadTx(tx);
+ IgniteInternalTx tx0 = cctx.tm().anyActiveThreadTx(threadId, tx);
if (tx0 != null)
topVer = tx0.topologyVersionSnapshot();
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 243c4cb..d2b803a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -605,11 +605,11 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
}
/**
+ * @param threadId Thread ID.
+ * @param ignore Transaction to ignore.
* @return Any transaction associated with the current thread.
*/
- public IgniteInternalTx anyActiveThreadTx(IgniteInternalTx ignore) {
- long threadId = Thread.currentThread().getId();
-
+ public IgniteInternalTx anyActiveThreadTx(long threadId, IgniteInternalTx ignore) {
IgniteInternalTx tx = threadMap.get(threadId);
if (tx != null && tx.topologyVersionSnapshot() != null)
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
index d6f0257..100acfe 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
@@ -35,6 +35,8 @@ 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.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
@@ -45,6 +47,9 @@ import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_REA
*
*/
public class IgniteCacheNearLockValueSelfTest extends GridCommonAbstractTest {
+ /** */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
startGridsMultiThreaded(2);
@@ -61,7 +66,7 @@ public class IgniteCacheNearLockValueSelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- cfg.setDiscoverySpi(new TcpDiscoverySpi().setForceServerMode(true));
+ cfg.setDiscoverySpi(new TcpDiscoverySpi().setForceServerMode(true).setIpFinder(IP_FINDER));
if (getTestGridName(0).equals(gridName))
cfg.setClientMode(true);
@@ -126,7 +131,7 @@ public class IgniteCacheNearLockValueSelfTest extends GridCommonAbstractTest {
private Collection<GridNearLockRequest> reqs = new ConcurrentLinkedDeque<>();
/** {@inheritDoc} */
- @Override public void sendMessage(ClusterNode node, Message msg, IgniteInClosure<IgniteException> ackClosure)
+ @Override public void sendMessage(ClusterNode node, Message msg, IgniteInClosure<IgniteException> ackC)
throws IgniteSpiException {
if (msg instanceof GridIoMessage) {
GridIoMessage ioMsg = (GridIoMessage)msg;
@@ -135,7 +140,7 @@ public class IgniteCacheNearLockValueSelfTest extends GridCommonAbstractTest {
reqs.add((GridNearLockRequest)ioMsg.message());
}
- super.sendMessage(node, msg, ackClosure);
+ super.sendMessage(node, msg, ackC);
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
index 70c5dc3..c0fb11d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
@@ -107,7 +107,7 @@ public abstract class IgniteCacheStoreValueAbstractTest extends IgniteCacheAbstr
/** {@inheritDoc} */
@Override protected long getTestTimeout() {
- return 2 * 60_000;
+ return 3 * 60_000;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionSelfTest.java
index 1e10a03..6212c4e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionSelfTest.java
@@ -31,10 +31,10 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
-import org.apache.ignite.transactions.TransactionConcurrency;
-import org.apache.ignite.transactions.TransactionIsolation;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
+import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
/**
* Check starting cache in transaction.
@@ -43,6 +43,9 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
/** */
private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+ /** */
+ private static final String EXPECTED_MSG = "Cannot start/stop cache within lock or transaction.";
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -97,8 +100,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
final String key = "key";
final String val = "val";
- try (Transaction tx = ignite.transactions().txStart(
- TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)){
ignite.cache(null).put(key, val);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@@ -107,7 +109,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
return null;
}
- }, IgniteException.class, "Cannot start/stop cache within transaction.");
+ }, IgniteException.class, EXPECTED_MSG);
tx.commit();
}
@@ -122,8 +124,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
final String key = "key";
final String val = "val";
- try (Transaction tx = ignite.transactions().txStart(
- TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)){
ignite.cache(null).put(key, val);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@@ -132,7 +133,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
return null;
}
- }, IgniteException.class, "Cannot start/stop cache within transaction.");
+ }, IgniteException.class, EXPECTED_MSG);
tx.commit();
}
@@ -147,8 +148,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
final String key = "key";
final String val = "val";
- try (Transaction tx = ignite.transactions().txStart(
- TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)){
ignite.cache(null).put(key, val);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@@ -157,7 +157,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
return null;
}
- }, IgniteException.class, "Cannot start/stop cache within transaction.");
+ }, IgniteException.class, EXPECTED_MSG);
tx.commit();
}
@@ -172,8 +172,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
final String key = "key";
final String val = "val";
- try (Transaction tx = ignite.transactions().txStart(
- TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)){
ignite.cache(null).put(key, val);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@@ -182,7 +181,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
return null;
}
- }, IgniteException.class, "Cannot start/stop cache within transaction.");
+ }, IgniteException.class, EXPECTED_MSG);
tx.commit();
}
@@ -197,8 +196,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
final String key = "key";
final String val = "val";
- try (Transaction tx = ignite.transactions().txStart(
- TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)){
ignite.cache(null).put(key, val);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@@ -207,7 +205,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
return null;
}
- }, IgniteException.class, "Cannot start/stop cache within transaction.");
+ }, IgniteException.class, EXPECTED_MSG);
tx.commit();
}
@@ -222,8 +220,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
final String key = "key";
final String val = "val";
- try (Transaction tx = ignite.transactions().txStart(
- TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)){
ignite.cache(null).put(key, val);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@@ -232,7 +229,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
return null;
}
- }, IgniteException.class, "Cannot start/stop cache within transaction.");
+ }, IgniteException.class, EXPECTED_MSG);
tx.commit();
}
@@ -259,7 +256,7 @@ public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTes
return null;
}
- }, IgniteException.class, "Cannot start/stop cache within lock.");
+ }, IgniteException.class, EXPECTED_MSG);
lock.unlock();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheGetInsideLockChangingTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheGetInsideLockChangingTopologyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheGetInsideLockChangingTopologyTest.java
new file mode 100644
index 0000000..7073a94
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheGetInsideLockChangingTopologyTest.java
@@ -0,0 +1,475 @@
+/*
+ * 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.internal.processors.cache.distributed;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.Lock;
+import javax.cache.CacheException;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.processors.cache.GridCacheAlwaysEvictionPolicy;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.transactions.Transaction;
+import org.apache.ignite.transactions.TransactionConcurrency;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
+import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
+import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
+import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
+
+/**
+ *
+ */
+public class CacheGetInsideLockChangingTopologyTest extends GridCommonAbstractTest {
+ /** */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
+ private static ThreadLocal<Boolean> client = new ThreadLocal<>();
+
+ /** */
+ private static final int SRVS = 3;
+
+ /** */
+ private static final int CLIENTS = 2;
+
+ /** */
+ private static final String TX_CACHE1 = "tx1";
+
+ /** */
+ private static final String TX_CACHE2 = "tx2";
+
+ /** */
+ private static final String ATOMIC_CACHE = "atomic";
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
+
+ Boolean clientMode = client.get();
+
+ client.set(null);
+
+ if (clientMode != null && clientMode)
+ cfg.setClientMode(true);
+ else {
+ cfg.setCacheConfiguration(cacheConfiguration(TX_CACHE1, TRANSACTIONAL),
+ cacheConfiguration(TX_CACHE2, TRANSACTIONAL),
+ cacheConfiguration(ATOMIC_CACHE, ATOMIC));
+ }
+
+ return cfg;
+ }
+
+ /**
+ * @param name Cache name.
+ * @param atomicityMode Atomicity mode.
+ * @return Cache configuration.
+ */
+ private CacheConfiguration cacheConfiguration(String name, CacheAtomicityMode atomicityMode) {
+ CacheConfiguration ccfg = new CacheConfiguration();
+
+ ccfg.setName(name);
+ ccfg.setAtomicityMode(atomicityMode);
+ ccfg.setWriteSynchronizationMode(FULL_SYNC);
+ ccfg.setBackups(1);
+
+ return ccfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ super.beforeTestsStarted();
+
+ startGridsMultiThreaded(SRVS);
+
+ client.set(true);
+
+ Ignite client1 = startGrid(SRVS);
+
+ assertTrue(client1.configuration().isClientMode());
+
+ client.set(true);
+
+ Ignite client2 = startGrid(SRVS + 1);
+
+ assertTrue(client2.configuration().isClientMode());
+
+ client2.createNearCache(TX_CACHE1,
+ new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>()));
+
+ client2.createNearCache(TX_CACHE2,
+ new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>()));
+
+ client2.createNearCache(ATOMIC_CACHE,
+ new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>()));
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+
+ super.afterTestsStopped();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testTxGetInsideLockStopPrimary() throws Exception {
+ getInsideLockStopPrimary(ignite(SRVS), TX_CACHE1);
+ getInsideLockStopPrimary(ignite(SRVS + 1), TX_CACHE1);
+
+ getInsideLockStopPrimary(ignite(SRVS), TX_CACHE2);
+ getInsideLockStopPrimary(ignite(SRVS + 1), TX_CACHE2);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicGetInsideLockStopPrimary() throws Exception {
+ getInsideLockStopPrimary(ignite(SRVS), ATOMIC_CACHE);
+
+ getInsideLockStopPrimary(ignite(SRVS + 1), ATOMIC_CACHE);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicGetInsideTxStopPrimary() throws Exception {
+ getInsideTxStopPrimary(ignite(SRVS), ATOMIC_CACHE);
+
+ getInsideTxStopPrimary(ignite(SRVS + 1), ATOMIC_CACHE);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReadCommittedPessimisticStopPrimary() throws Exception {
+ getReadCommittedStopPrimary(ignite(SRVS), TX_CACHE1, PESSIMISTIC);
+ getReadCommittedStopPrimary(ignite(SRVS + 1), TX_CACHE1, PESSIMISTIC);
+
+ getReadCommittedStopPrimary(ignite(SRVS), TX_CACHE2, PESSIMISTIC);
+ getReadCommittedStopPrimary(ignite(SRVS + 1), TX_CACHE2, PESSIMISTIC);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReadCommittedOptimisticStopPrimary() throws Exception {
+ getReadCommittedStopPrimary(ignite(SRVS), TX_CACHE1, OPTIMISTIC);
+ getReadCommittedStopPrimary(ignite(SRVS + 1), TX_CACHE1, OPTIMISTIC);
+
+ getReadCommittedStopPrimary(ignite(SRVS), TX_CACHE2, OPTIMISTIC);
+ getReadCommittedStopPrimary(ignite(SRVS + 1), TX_CACHE2, OPTIMISTIC);
+ }
+
+ /**
+ * @param ignite Node.
+ * @param cacheName Cache name.
+ * @param concurrency Transaction concurrency.
+ * @throws Exception If failed.
+ */
+ private void getReadCommittedStopPrimary(Ignite ignite,
+ String cacheName,
+ TransactionConcurrency concurrency) throws Exception {
+ IgniteCache<Integer, Integer> txCache = ignite.cache(TX_CACHE1);
+
+ IgniteCache<Integer, Integer> getCache = ignite.cache(cacheName);
+
+ final int NEW_NODE = SRVS + CLIENTS;
+
+ Ignite srv = startGrid(NEW_NODE);
+
+ try {
+ Integer key = primaryKey(srv.cache(cacheName));
+
+ Integer txKey = nearKey(srv.cache(cacheName));
+
+ srv.cache(cacheName).put(key, 1);
+
+ IgniteInternalFuture<?> stopFut = GridTestUtils.runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ U.sleep(500);
+
+ log.info("Stop node.");
+
+ stopGrid(NEW_NODE);
+
+ log.info("Node stopped.");
+
+ return null;
+ }
+ }, "stop-thread");
+
+ try (Transaction tx = ignite.transactions().txStart(concurrency, READ_COMMITTED)) {
+ txCache.put(txKey, 1);
+
+ while (!stopFut.isDone())
+ assertEquals(1, (Object)getCache.get(key));
+
+ tx.commit();
+ }
+ }
+ finally {
+ stopGrid(NEW_NODE);
+ }
+ }
+
+ /**
+ * @param ignite Node.
+ * @param cacheName Cache name.
+ * @throws Exception If failed.
+ */
+ private void getInsideLockStopPrimary(Ignite ignite, String cacheName) throws Exception {
+ IgniteCache<Integer, Integer> lockCache = ignite.cache(TX_CACHE1);
+
+ IgniteCache<Integer, Integer> getCache = ignite.cache(cacheName);
+
+ final int NEW_NODE = SRVS + CLIENTS;
+
+ Ignite srv = startGrid(NEW_NODE);
+
+ try {
+ Integer key = primaryKey(srv.cache(cacheName));
+
+ getCache.put(key, 1);
+
+ IgniteInternalFuture<?> stopFut = GridTestUtils.runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ U.sleep(500);
+
+ log.info("Stop node.");
+
+ stopGrid(NEW_NODE);
+
+ log.info("Node stopped.");
+
+ return null;
+ }
+ }, "stop-thread");
+
+ Lock lock = lockCache.lock(key + 1);
+
+ lock.lock();
+
+ try {
+ while (!stopFut.isDone())
+ assertEquals(1, (Object)getCache.get(key));
+ }
+ finally {
+ lock.unlock();
+ }
+
+ stopFut.get();
+ }
+ finally {
+ stopGrid(NEW_NODE);
+ }
+ }
+
+ /**
+ * @param ignite Node.
+ * @param cacheName Cache name.
+ * @throws Exception If failed.
+ */
+ private void getInsideTxStopPrimary(Ignite ignite, String cacheName) throws Exception {
+ IgniteCache<Integer, Integer> txCache = ignite.cache(TX_CACHE1);
+
+ IgniteCache<Integer, Integer> getCache = ignite.cache(cacheName);
+
+ final int NEW_NODE = SRVS + CLIENTS;
+
+ Ignite srv = startGrid(NEW_NODE);
+
+ try {
+ Integer key = primaryKey(srv.cache(cacheName));
+
+ getCache.put(key, 1);
+
+ IgniteInternalFuture<?> stopFut = GridTestUtils.runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ U.sleep(500);
+
+ log.info("Stop node.");
+
+ stopGrid(NEW_NODE);
+
+ log.info("Node stopped.");
+
+ return null;
+ }
+ }, "stop-thread");
+
+ try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
+ txCache.get(key + 1);
+
+ while (!stopFut.isDone())
+ assertEquals(1, (Object)getCache.get(key));
+
+ tx.commit();
+ }
+ }
+ finally {
+ stopGrid(NEW_NODE);
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testMultithreaded() throws Exception {
+ final AtomicBoolean finished = new AtomicBoolean();
+
+ final int NEW_NODE = SRVS + CLIENTS;
+
+ final AtomicInteger stopIdx = new AtomicInteger();
+
+ IgniteInternalFuture<?> restartFut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ int idx = stopIdx.getAndIncrement();
+
+ int node = NEW_NODE + idx;
+
+ while (!finished.get()) {
+ log.info("Start node: " + node);
+
+ startGrid(node);
+
+ U.sleep(300);
+
+ log.info("Stop node: " + node);
+
+ stopGrid(node);
+ }
+
+ return null;
+ }
+ }, 2, "stop-thread");
+
+ try {
+ final long stopTime = System.currentTimeMillis() + 60_000;
+
+ final AtomicInteger idx = new AtomicInteger();
+
+ final int KEYS = 100_000;
+
+ GridTestUtils.runMultiThreaded(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ int node = idx.getAndIncrement() % (SRVS + CLIENTS);
+
+ Ignite ignite = ignite(node);
+
+ IgniteCache<Integer, Integer> txCache1 = ignite.cache(TX_CACHE1);
+ IgniteCache<Integer, Integer> txCache2 = ignite.cache(TX_CACHE2);
+ IgniteCache<Integer, Integer> atomicCache = ignite.cache(ATOMIC_CACHE);
+
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+ while (U.currentTimeMillis() < stopTime) {
+ Integer lockKey = rnd.nextInt(KEYS, KEYS + 1000);
+
+ Lock lock = txCache1.lock(lockKey);
+
+ try {
+ lock.lock();
+
+ try {
+ executeGet(txCache1);
+
+ executeGet(txCache2);
+
+ executeGet(atomicCache);
+ } finally {
+ lock.unlock();
+ }
+
+ try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, READ_COMMITTED)) {
+ txCache1.put(lockKey, lockKey);
+
+ executeGet(txCache1);
+
+ executeGet(txCache2);
+
+ executeGet(atomicCache);
+
+ tx.commit();
+ }
+ }
+ catch (IgniteException | CacheException e) {
+ log.info("Error: " + e);
+ }
+ }
+
+ return null;
+ }
+
+ private void executeGet(IgniteCache<Integer, Integer> cache) {
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+ for (int i = 0; i < 100; i++)
+ cache.get(rnd.nextInt(KEYS));
+
+ Set<Integer> keys = new HashSet<>();
+
+ for (int i = 0; i < 100; i++) {
+ keys.add(rnd.nextInt(KEYS));
+
+ if (keys.size() == 20) {
+ cache.getAll(keys);
+
+ keys.clear();
+ }
+ }
+
+ cache.getAll(keys);
+ }
+ }, 10, "test-thread");
+
+ finished.set(true);
+
+ restartFut.get();
+ }
+ finally {
+ finished.set(true);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/96dc238f/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java
index 4b04c05..85b6e93 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java
@@ -18,6 +18,7 @@
package org.apache.ignite.testsuites;
import junit.framework.TestSuite;
+import org.apache.ignite.internal.processors.cache.distributed.CacheGetInsideLockChangingTopologyTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCachePutRetryAtomicSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCachePutRetryTransactionalSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.IgniteCachePutRetryAtomicPrimaryWriteOrderSelfTest;
@@ -36,6 +37,7 @@ public class IgniteCacheFailoverTestSuite3 extends TestSuite {
suite.addTestSuite(IgniteCachePutRetryAtomicSelfTest.class);
suite.addTestSuite(IgniteCachePutRetryAtomicPrimaryWriteOrderSelfTest.class);
suite.addTestSuite(IgniteCachePutRetryTransactionalSelfTest.class);
+ suite.addTestSuite(CacheGetInsideLockChangingTopologyTest.class);
return suite;
}
[4/6] ignite git commit: fixed
https://issues.apache.org/jira/browse/IGNITE-2168
Posted by vo...@apache.org.
fixed https://issues.apache.org/jira/browse/IGNITE-2168
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d204b0ed
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d204b0ed
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d204b0ed
Branch: refs/heads/ignite-2100
Commit: d204b0ed9b1a905ec05f0594c48504e691ce7df2
Parents: d8c8214
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Thu Dec 17 09:31:53 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Thu Dec 17 09:31:53 2015 +0300
----------------------------------------------------------------------
.../ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d204b0ed/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
index 0034410..e6584dd 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
@@ -31,7 +31,6 @@ import org.apache.ignite.examples.ExampleNodeStartup;
import org.apache.ignite.examples.ExamplesUtils;
import org.apache.ignite.examples.model.Person;
import org.apache.ignite.examples.util.DbH2ServerStartup;
-import org.apache.ignite.scalar.lang.ScalarOutClosure;
import org.apache.ignite.transactions.Transaction;
import org.h2.jdbcx.JdbcConnectionPool;
[2/6] ignite git commit: fixed
https://issues.apache.org/jira/browse/IGNITE-2158
Posted by vo...@apache.org.
fixed https://issues.apache.org/jira/browse/IGNITE-2158
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d8c82141
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d8c82141
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d8c82141
Branch: refs/heads/ignite-2100
Commit: d8c8214181b2fce4f069b2f8f1bb06ae3fc6d492
Parents: b028a26
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Wed Dec 16 17:19:37 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Wed Dec 16 17:19:37 2015 +0300
----------------------------------------------------------------------
.../store/dummy/CacheDummyPersonStore.java | 113 --------------
.../store/dummy/CacheDummyStoreExample.java | 133 -----------------
.../datagrid/store/dummy/package-info.java | 22 ---
.../store/jdbc/CacheJdbcPersonStore.java | 43 +-----
.../store/jdbc/CacheJdbcStoreExample.java | 25 +++-
.../store/spring/CacheSpringPersonStore.java | 131 -----------------
.../store/spring/CacheSpringStoreExample.java | 147 -------------------
.../datagrid/store/spring/package-info.java | 22 ---
.../ignite/examples/CacheExamplesSelfTest.java | 10 +-
9 files changed, 30 insertions(+), 616 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d8c82141/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyPersonStore.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyPersonStore.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyPersonStore.java
deleted file mode 100644
index 6c0fecb..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyPersonStore.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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.examples.datagrid.store.dummy;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.cache.store.CacheStoreAdapter;
-import org.apache.ignite.cache.store.CacheStoreSession;
-import org.apache.ignite.examples.model.Person;
-import org.apache.ignite.lang.IgniteBiInClosure;
-import org.apache.ignite.resources.CacheNameResource;
-import org.apache.ignite.resources.CacheStoreSessionResource;
-import org.apache.ignite.resources.IgniteInstanceResource;
-import org.apache.ignite.transactions.Transaction;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Dummy cache store implementation.
- */
-public class CacheDummyPersonStore extends CacheStoreAdapter<Long, Person> {
- /** Auto-inject ignite instance. */
- @IgniteInstanceResource
- private Ignite ignite;
-
- /** Auto-inject cache name. */
- @CacheNameResource
- private String cacheName;
-
- /** */
- @CacheStoreSessionResource
- private CacheStoreSession ses;
-
- /** Dummy database. */
- private Map<Long, Person> dummyDB = new ConcurrentHashMap<>();
-
- /** {@inheritDoc} */
- @Override public Person load(Long key) {
- Transaction tx = transaction();
-
- System.out.println(">>> Store load [key=" + key + ", xid=" + (tx == null ? null : tx.xid()) + ']');
-
- return dummyDB.get(key);
- }
-
- /** {@inheritDoc} */
- @Override public void write(javax.cache.Cache.Entry<? extends Long, ? extends Person> entry) {
- Transaction tx = transaction();
-
- Long key = entry.getKey();
- Person val = entry.getValue();
-
- System.out.println(">>> Store put [key=" + key + ", val=" + val + ", xid=" + (tx == null ? null : tx.xid()) + ']');
-
- dummyDB.put(key, val);
- }
-
- /** {@inheritDoc} */
- @Override public void delete(Object key) {
- Transaction tx = transaction();
-
- System.out.println(">>> Store remove [key=" + key + ", xid=" + (tx == null ? null : tx.xid()) + ']');
-
- dummyDB.remove(key);
- }
-
- /** {@inheritDoc} */
- @Override public void loadCache(IgniteBiInClosure<Long, Person> clo, Object... args) {
- int cnt = (Integer)args[0];
-
- System.out.println(">>> Store loadCache for entry count: " + cnt);
-
- for (long i = 0; i < cnt; i++) {
- // Generate dummy person on the fly.
- Person p = new Person(i, "first-" + i, "last-" + 1);
-
- // Ignite will automatically discard entries that don't belong on this node,
- // but we check if local node is primary or backup anyway just to demonstrate that we can.
- // Ideally, partition ID of a key would be stored in the database and only keys
- // for partitions that belong on this node would be loaded from database.
- if (ignite.affinity(cacheName).isPrimaryOrBackup(ignite.cluster().localNode(), p.id)) {
- // Update dummy database.
- // In real life data would be loaded from database.
- dummyDB.put(p.id, p);
-
- // Pass data to cache.
- clo.apply(p.id, p);
- }
- }
- }
-
- /**
- * @return Current transaction.
- */
- @Nullable private Transaction transaction() {
- return ses != null ? ses.transaction() : null;
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d8c82141/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyStoreExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyStoreExample.java
deleted file mode 100644
index a631df3..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyStoreExample.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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.examples.datagrid.store.dummy;
-
-import java.util.UUID;
-import javax.cache.configuration.FactoryBuilder;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.Ignition;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.examples.ExampleNodeStartup;
-import org.apache.ignite.examples.ExamplesUtils;
-import org.apache.ignite.examples.model.Person;
-import org.apache.ignite.transactions.Transaction;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-
-/**
- * Demonstrates usage of cache with underlying persistent store configured.
- * <p>
- * This example uses {@link CacheDummyPersonStore} as a persistent store.
- * <p>
- * Remote nodes can be started with {@link ExampleNodeStartup} in another JVM which will
- * start node with {@code examples/config/example-ignite.xml} configuration.
- */
-public class CacheDummyStoreExample {
- /** Cache name. */
- private static final String CACHE_NAME = CacheDummyStoreExample.class.getSimpleName();
-
- /** Heap size required to run this example. */
- public static final int MIN_MEMORY = 1024 * 1024 * 1024;
-
- /** Number of entries to load. */
- private static final int ENTRY_COUNT = 100_000;
-
- /** Global person ID to use across entire example. */
- private static final Long id = Math.abs(UUID.randomUUID().getLeastSignificantBits());
-
- /**
- * Executes example.
- *
- * @param args Command line arguments, none required.
- * @throws IgniteException If example execution failed.
- */
- public static void main(String[] args) throws IgniteException {
- ExamplesUtils.checkMinMemory(MIN_MEMORY);
-
- // To start ignite with desired configuration uncomment the appropriate line.
- try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
- System.out.println();
- System.out.println(">>> Cache store example started.");
-
- CacheConfiguration<Long, Person> cacheCfg = new CacheConfiguration<>(CACHE_NAME);
-
- // Set atomicity as transaction, since we are showing transactions in example.
- cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
- // Configure Dummy store.
- cacheCfg.setCacheStoreFactory(FactoryBuilder.factoryOf(CacheDummyPersonStore.class));
-
- cacheCfg.setReadThrough(true);
- cacheCfg.setWriteThrough(true);
-
- try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg)) {
- // Make initial cache loading from persistent store. This is a
- // distributed operation and will call CacheStore.loadCache(...)
- // method on all nodes in topology.
- loadCache(cache);
-
- // Start transaction and execute several cache operations with
- // read/write-through to persistent store.
- executeTransaction(cache);
- }
- }
- }
-
- /**
- * Makes initial cache loading.
- *
- * @param cache Cache to load.
- */
- private static void loadCache(IgniteCache<Long, Person> cache) {
- long start = System.currentTimeMillis();
-
- // Start loading cache from persistent store on all caching nodes.
- cache.loadCache(null, ENTRY_COUNT);
-
- long end = System.currentTimeMillis();
-
- System.out.println(">>> Loaded " + cache.size() + " keys with backups in " + (end - start) + "ms.");
- }
-
- /**
- * Executes transaction with read/write-through to persistent store.
- *
- * @param cache Cache to execute transaction on.
- */
- private static void executeTransaction(IgniteCache<Long, Person> cache) {
- try (Transaction tx = Ignition.ignite().transactions().txStart()) {
- Person val = cache.get(id);
-
- System.out.println("Read value: " + val);
-
- val = cache.getAndPut(id, new Person(id, "Isaac", "Newton"));
-
- System.out.println("Overwrote old value: " + val);
-
- val = cache.get(id);
-
- System.out.println("Read value: " + val);
-
- tx.commit();
- }
-
- System.out.println("Read value after commit: " + cache.get(id));
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d8c82141/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/package-info.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/package-info.java
deleted file mode 100644
index 42c3899..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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 description. -->
- * Contains dummy cache store implementation.
- */
-package org.apache.ignite.examples.datagrid.store.dummy;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d8c82141/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
index 6ba181e..f93a49f 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
@@ -24,62 +24,29 @@ import java.sql.SQLException;
import javax.cache.Cache;
import javax.cache.integration.CacheLoaderException;
import javax.cache.integration.CacheWriterException;
-import javax.sql.DataSource;
-import org.apache.ignite.IgniteException;
import org.apache.ignite.cache.store.CacheStore;
import org.apache.ignite.cache.store.CacheStoreAdapter;
import org.apache.ignite.cache.store.CacheStoreSession;
import org.apache.ignite.examples.model.Person;
import org.apache.ignite.lang.IgniteBiInClosure;
import org.apache.ignite.resources.CacheStoreSessionResource;
-import org.h2.jdbcx.JdbcConnectionPool;
/**
* Example of {@link CacheStore} implementation that uses JDBC
* transaction with cache transactions and maps {@link Long} to {@link Person}.
*/
public class CacheJdbcPersonStore extends CacheStoreAdapter<Long, Person> {
- /** Data source. */
- public static final DataSource DATA_SRC =
- JdbcConnectionPool.create("jdbc:h2:mem:example;DB_CLOSE_DELAY=-1", "", "");
-
/** Store session. */
@CacheStoreSessionResource
private CacheStoreSession ses;
- /**
- * Constructor.
- *
- * @throws IgniteException If failed.
- */
- public CacheJdbcPersonStore() throws IgniteException {
- prepareDb();
- }
-
- /**
- * Prepares database for example execution. This method will create a
- * table called "PERSONS" so it can be used by store implementation.
- *
- * @throws IgniteException If failed.
- */
- private void prepareDb() throws IgniteException {
- try (Connection conn = DATA_SRC.getConnection()) {
- conn.createStatement().execute(
- "create table if not exists PERSONS (" +
- "id number unique, firstName varchar(255), lastName varchar(255))");
- }
- catch (SQLException e) {
- throw new IgniteException("Failed to create database table.", e);
- }
- }
-
/** {@inheritDoc} */
@Override public Person load(Long key) {
System.out.println(">>> Store load [key=" + key + ']');
Connection conn = ses.attachment();
- try (PreparedStatement st = conn.prepareStatement("select * from PERSONS where id = ?")) {
+ try (PreparedStatement st = conn.prepareStatement("select * from PERSON where id = ?")) {
st.setString(1, key.toString());
ResultSet rs = st.executeQuery();
@@ -106,7 +73,7 @@ public class CacheJdbcPersonStore extends CacheStoreAdapter<Long, Person> {
// Try update first. If it does not work, then try insert.
// Some databases would allow these to be done in one 'upsert' operation.
try (PreparedStatement st = conn.prepareStatement(
- "update PERSONS set firstName = ?, lastName = ? where id = ?")) {
+ "update PERSON set first_name = ?, last_name = ? where id = ?")) {
st.setString(1, val.firstName);
st.setString(2, val.lastName);
st.setLong(3, val.id);
@@ -117,7 +84,7 @@ public class CacheJdbcPersonStore extends CacheStoreAdapter<Long, Person> {
// If update failed, try to insert.
if (updated == 0) {
try (PreparedStatement st = conn.prepareStatement(
- "insert into PERSONS (id, firstName, lastName) values (?, ?, ?)")) {
+ "insert into PERSON (id, first_name, last_name) values (?, ?, ?)")) {
st.setLong(1, val.id);
st.setString(2, val.firstName);
st.setString(3, val.lastName);
@@ -137,7 +104,7 @@ public class CacheJdbcPersonStore extends CacheStoreAdapter<Long, Person> {
Connection conn = ses.attachment();
- try (PreparedStatement st = conn.prepareStatement("delete from PERSONS where id=?")) {
+ try (PreparedStatement st = conn.prepareStatement("delete from PERSON where id=?")) {
st.setLong(1, (Long)key);
st.executeUpdate();
@@ -156,7 +123,7 @@ public class CacheJdbcPersonStore extends CacheStoreAdapter<Long, Person> {
Connection conn = ses.attachment();
- try (PreparedStatement stmt = conn.prepareStatement("select * from PERSONS limit ?")) {
+ try (PreparedStatement stmt = conn.prepareStatement("select * from PERSON limit ?")) {
stmt.setInt(1, entryCnt);
ResultSet rs = stmt.executeQuery();
http://git-wip-us.apache.org/repos/asf/ignite/blob/d8c82141/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
index 55ad5df..0034410 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
@@ -30,7 +30,10 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.examples.ExampleNodeStartup;
import org.apache.ignite.examples.ExamplesUtils;
import org.apache.ignite.examples.model.Person;
+import org.apache.ignite.examples.util.DbH2ServerStartup;
+import org.apache.ignite.scalar.lang.ScalarOutClosure;
import org.apache.ignite.transactions.Transaction;
+import org.h2.jdbcx.JdbcConnectionPool;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -39,6 +42,13 @@ import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
* <p>
* This example uses {@link CacheJdbcPersonStore} as a persistent store.
* <p>
+ * To start the example, you should:
+ * <ul>
+ * <li>Start H2 database TCP server using {@link DbH2ServerStartup}.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
+ * <li>Start example using {@link CacheJdbcStoreExample}.</li>
+ * </ul>
+ * <p>
* Remote nodes can be started with {@link ExampleNodeStartup} in another JVM which will
* start node with {@code examples/config/example-ignite.xml} configuration.
*/
@@ -82,7 +92,7 @@ public class CacheJdbcStoreExample {
@Override public CacheStoreSessionListener create() {
CacheJdbcStoreSessionListener lsnr = new CacheJdbcStoreSessionListener();
- lsnr.setDataSource(CacheJdbcPersonStore.DATA_SRC);
+ lsnr.setDataSource(JdbcConnectionPool.create("jdbc:h2:tcp://localhost/mem:ExampleDb", "sa", ""));
return lsnr;
}
@@ -143,5 +153,18 @@ public class CacheJdbcStoreExample {
}
System.out.println("Read value after commit: " + cache.get(id));
+
+ // Clear entry from memory, but keep it in store.
+ cache.clear(id);
+
+ // Operations on this cache will not affect store.
+ IgniteCache<Long, Person> cacheSkipStore = cache.withSkipStore();
+
+ System.out.println("Read value skipping store (expecting null): " + cacheSkipStore.get(id));
+
+ System.out.println("Read value with store lookup (expecting NOT null): " + cache.get(id));
+
+ // Expecting not null, since entry should be in memory since last call.
+ System.out.println("Read value skipping store (expecting NOT null): " + cacheSkipStore.get(id));
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d8c82141/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringPersonStore.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringPersonStore.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringPersonStore.java
deleted file mode 100644
index 0029890..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringPersonStore.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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.examples.datagrid.store.spring;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.concurrent.atomic.AtomicInteger;
-import javax.cache.Cache;
-import javax.cache.integration.CacheLoaderException;
-import javax.sql.DataSource;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.cache.store.CacheStore;
-import org.apache.ignite.cache.store.CacheStoreAdapter;
-import org.apache.ignite.examples.model.Person;
-import org.apache.ignite.lang.IgniteBiInClosure;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowCallbackHandler;
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.jdbc.datasource.DriverManagerDataSource;
-
-/**
- * Example of {@link CacheStore} implementation that uses JDBC
- * transaction with cache transactions and maps {@link Long} to {@link Person}.
- */
-public class CacheSpringPersonStore extends CacheStoreAdapter<Long, Person> {
- /** Data source. */
- public static final DataSource DATA_SRC = new DriverManagerDataSource("jdbc:h2:mem:example;DB_CLOSE_DELAY=-1");
-
- /** Spring JDBC template. */
- private JdbcTemplate jdbcTemplate;
-
- /**
- * Constructor.
- *
- * @throws IgniteException If failed.
- */
- public CacheSpringPersonStore() throws IgniteException {
- jdbcTemplate = new JdbcTemplate(DATA_SRC);
-
- prepareDb();
- }
-
- /**
- * Prepares database for example execution. This method will create a
- * table called "PERSONS" so it can be used by store implementation.
- *
- * @throws IgniteException If failed.
- */
- private void prepareDb() throws IgniteException {
- jdbcTemplate.update(
- "create table if not exists PERSONS (" +
- "id number unique, firstName varchar(255), lastName varchar(255))");
- }
-
- /** {@inheritDoc} */
- @Override public Person load(Long key) {
- System.out.println(">>> Store load [key=" + key + ']');
-
- try {
- return jdbcTemplate.queryForObject("select * from PERSONS where id = ?", new RowMapper<Person>() {
- @Override public Person mapRow(ResultSet rs, int rowNum) throws SQLException {
- return new Person(rs.getLong(1), rs.getString(2), rs.getString(3));
- }
- }, key);
- }
- catch (EmptyResultDataAccessException ignored) {
- return null;
- }
- }
-
- /** {@inheritDoc} */
- @Override public void write(Cache.Entry<? extends Long, ? extends Person> entry) {
- Long key = entry.getKey();
- Person val = entry.getValue();
-
- System.out.println(">>> Store write [key=" + key + ", val=" + val + ']');
-
- int updated = jdbcTemplate.update("update PERSONS set firstName = ?, lastName = ? where id = ?",
- val.firstName, val.lastName, val.id);
-
- if (updated == 0) {
- jdbcTemplate.update("insert into PERSONS (id, firstName, lastName) values (?, ?, ?)",
- val.id, val.firstName, val.lastName);
- }
- }
-
- /** {@inheritDoc} */
- @Override public void delete(Object key) {
- System.out.println(">>> Store delete [key=" + key + ']');
-
- jdbcTemplate.update("delete from PERSONS where id = ?", key);
- }
-
- /** {@inheritDoc} */
- @Override public void loadCache(final IgniteBiInClosure<Long, Person> clo, Object... args) {
- if (args == null || args.length == 0 || args[0] == null)
- throw new CacheLoaderException("Expected entry count parameter is not provided.");
-
- int entryCnt = (Integer)args[0];
-
- final AtomicInteger cnt = new AtomicInteger();
-
- jdbcTemplate.query("select * from PERSONS limit ?", new RowCallbackHandler() {
- @Override public void processRow(ResultSet rs) throws SQLException {
- Person person = new Person(rs.getLong(1), rs.getString(2), rs.getString(3));
-
- clo.apply(person.id, person);
-
- cnt.incrementAndGet();
- }
- }, entryCnt);
-
- System.out.println(">>> Loaded " + cnt + " values into cache.");
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d8c82141/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringStoreExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringStoreExample.java
deleted file mode 100644
index 273ea1c..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringStoreExample.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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.examples.datagrid.store.spring;
-
-import java.util.UUID;
-import javax.cache.configuration.Factory;
-import javax.cache.configuration.FactoryBuilder;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.Ignition;
-import org.apache.ignite.cache.store.CacheStoreSessionListener;
-import org.apache.ignite.cache.store.jdbc.CacheJdbcStoreSessionListener;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.examples.ExampleNodeStartup;
-import org.apache.ignite.examples.ExamplesUtils;
-import org.apache.ignite.examples.model.Person;
-import org.apache.ignite.transactions.Transaction;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-
-/**
- * Demonstrates usage of cache with underlying persistent store configured.
- * <p>
- * This example uses {@link CacheSpringPersonStore} as a persistent store.
- * <p>
- * Remote nodes can be started with {@link ExampleNodeStartup} in another JVM which will
- * start node with {@code examples/config/example-ignite.xml} configuration.
- */
-public class CacheSpringStoreExample {
- /** Cache name. */
- private static final String CACHE_NAME = CacheSpringStoreExample.class.getSimpleName();
-
- /** Heap size required to run this example. */
- public static final int MIN_MEMORY = 1024 * 1024 * 1024;
-
- /** Number of entries to load. */
- private static final int ENTRY_COUNT = 100_000;
-
- /** Global person ID to use across entire example. */
- private static final Long id = Math.abs(UUID.randomUUID().getLeastSignificantBits());
-
- /**
- * Executes example.
- *
- * @param args Command line arguments, none required.
- * @throws IgniteException If example execution failed.
- */
- public static void main(String[] args) throws IgniteException {
- ExamplesUtils.checkMinMemory(MIN_MEMORY);
-
- // To start ignite with desired configuration uncomment the appropriate line.
- try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
- System.out.println();
- System.out.println(">>> Cache store example started.");
-
- CacheConfiguration<Long, Person> cacheCfg = new CacheConfiguration<>(CACHE_NAME);
-
- // Set atomicity as transaction, since we are showing transactions in example.
- cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
- // Configure Spring store.
- cacheCfg.setCacheStoreFactory(FactoryBuilder.factoryOf(CacheSpringPersonStore.class));
-
- // Configure Spring session listener.
- cacheCfg.setCacheStoreSessionListenerFactories(new Factory<CacheStoreSessionListener>() {
- @Override public CacheStoreSessionListener create() {
- CacheJdbcStoreSessionListener lsnr = new CacheJdbcStoreSessionListener();
-
- lsnr.setDataSource(CacheSpringPersonStore.DATA_SRC);
-
- return lsnr;
- }
- });
-
- cacheCfg.setReadThrough(true);
- cacheCfg.setWriteThrough(true);
-
- try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg)) {
- // Make initial cache loading from persistent store. This is a
- // distributed operation and will call CacheStore.loadCache(...)
- // method on all nodes in topology.
- loadCache(cache);
-
- // Start transaction and execute several cache operations with
- // read/write-through to persistent store.
- executeTransaction(cache);
- }
- }
- }
-
- /**
- * Makes initial cache loading.
- *
- * @param cache Cache to load.
- */
- private static void loadCache(IgniteCache<Long, Person> cache) {
- long start = System.currentTimeMillis();
-
- // Start loading cache from persistent store on all caching nodes.
- cache.loadCache(null, ENTRY_COUNT);
-
- long end = System.currentTimeMillis();
-
- System.out.println(">>> Loaded " + cache.size() + " keys with backups in " + (end - start) + "ms.");
- }
-
- /**
- * Executes transaction with read/write-through to persistent store.
- *
- * @param cache Cache to execute transaction on.
- */
- private static void executeTransaction(IgniteCache<Long, Person> cache) {
- try (Transaction tx = Ignition.ignite().transactions().txStart()) {
- Person val = cache.get(id);
-
- System.out.println("Read value: " + val);
-
- val = cache.getAndPut(id, new Person(id, "Isaac", "Newton"));
-
- System.out.println("Overwrote old value: " + val);
-
- val = cache.get(id);
-
- System.out.println("Read value: " + val);
-
- tx.commit();
- }
-
- System.out.println("Read value after commit: " + cache.get(id));
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d8c82141/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/package-info.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/package-info.java
deleted file mode 100644
index 3f03bde..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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 description. -->
- * Contains Spring-based cache store implementation.
- */
-package org.apache.ignite.examples.datagrid.store.spring;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d8c82141/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java b/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
index c11fa1a..050c59f 100644
--- a/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
+++ b/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
@@ -25,14 +25,13 @@ import org.apache.ignite.examples.datagrid.CachePutGetExample;
import org.apache.ignite.examples.datagrid.CacheQueryExample;
import org.apache.ignite.examples.datagrid.CacheTransactionExample;
import org.apache.ignite.examples.datagrid.starschema.CacheStarSchemaExample;
-import org.apache.ignite.examples.datagrid.store.dummy.CacheDummyStoreExample;
import org.apache.ignite.examples.datastructures.IgniteAtomicLongExample;
import org.apache.ignite.examples.datastructures.IgniteAtomicReferenceExample;
import org.apache.ignite.examples.datastructures.IgniteAtomicSequenceExample;
import org.apache.ignite.examples.datastructures.IgniteAtomicStampedExample;
import org.apache.ignite.examples.datastructures.IgniteCountDownLatchExample;
-import org.apache.ignite.examples.datastructures.IgniteSemaphoreExample;
import org.apache.ignite.examples.datastructures.IgniteQueueExample;
+import org.apache.ignite.examples.datastructures.IgniteSemaphoreExample;
import org.apache.ignite.examples.datastructures.IgniteSetExample;
import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
@@ -106,13 +105,6 @@ public class CacheExamplesSelfTest extends GridAbstractExamplesTest {
/**
* @throws Exception If failed.
*/
- public void testCacheDummyStoreExample() throws Exception {
- CacheDummyStoreExample.main(EMPTY_ARGS);
- }
-
- /**
- * @throws Exception If failed.
- */
public void testCacheQueryExample() throws Exception {
CacheQueryExample.main(EMPTY_ARGS);
}
[5/6] ignite git commit: Merge remote-tracking branch
'origin/ignite-1.5' into ignite-1.5_
Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/ignite-1.5' into ignite-1.5_
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7f35bc6d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7f35bc6d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7f35bc6d
Branch: refs/heads/ignite-2100
Commit: 7f35bc6d13cd609e63b8e59b1a28d30f402bd44f
Parents: d204b0e 96dc238
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Thu Dec 17 09:32:08 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Thu Dec 17 09:32:08 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 8 +-
.../cache/GridCacheSharedContext.java | 20 +
.../dht/CacheDistributedGetFutureAdapter.java | 2 +-
.../dht/GridPartitionedGetFuture.java | 15 +-
.../dht/GridPartitionedSingleGetFuture.java | 8 +
.../dht/atomic/GridNearAtomicUpdateFuture.java | 10 +-
.../colocated/GridDhtColocatedLockFuture.java | 2 +-
.../distributed/near/GridNearGetFuture.java | 17 +-
.../distributed/near/GridNearLockFuture.java | 30 +-
...ridNearOptimisticTxPrepareFutureAdapter.java | 6 +-
.../cache/transactions/IgniteTxManager.java | 6 +-
.../cache/IgniteCacheNearLockValueSelfTest.java | 11 +-
.../IgniteCacheStoreValueAbstractTest.java | 2 +-
.../IgniteStartCacheInTransactionSelfTest.java | 39 +-
.../CacheGetInsideLockChangingTopologyTest.java | 475 +++++++++++++++++++
.../IgniteCacheFailoverTestSuite3.java | 2 +
16 files changed, 593 insertions(+), 60 deletions(-)
----------------------------------------------------------------------