You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2018/01/10 16:58:25 UTC

ignite git commit: IGNITE-7089 .NET: Thin client: LINQPad example

Repository: ignite
Updated Branches:
  refs/heads/master b2ec33985 -> a7cdea18d


IGNITE-7089 .NET: Thin client: LINQPad example


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a7cdea18
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a7cdea18
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a7cdea18

Branch: refs/heads/master
Commit: a7cdea18d51760b29ca5016ba124818766904a01
Parents: b2ec339
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Jan 10 19:58:17 2018 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Jan 10 19:58:17 2018 +0300

----------------------------------------------------------------------
 .../NuGet/LINQPad/BinaryModeExample.linq        |  1 -
 .../NuGet/LINQPad/ComputeExample.linq           |  1 -
 .../NuGet/LINQPad/PutGetExample.linq            |  1 -
 .../NuGet/LINQPad/QueryExample.linq             |  1 -
 .../NuGet/LINQPad/ThinClient.linq               | 56 ++++++++++++++++++++
 5 files changed, 56 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a7cdea18/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/BinaryModeExample.linq
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/BinaryModeExample.linq b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/BinaryModeExample.linq
index 4b2291e..f72c2e1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/BinaryModeExample.linq
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/BinaryModeExample.linq
@@ -28,7 +28,6 @@
 /// 
 /// Requirements:
 /// * Java Runtime Environment (JRE): http://www.oracle.com/technetwork/java/javase/downloads/index.html (x86 for regular LINQPad, x64 for AnyCPU LINQPad)
-/// * Microsoft Visual C++ 2010 Redistributable Package: http://www.microsoft.com/en-us/download/details.aspx?id=14632 (x86 for regular LINQPad, x64 for AnyCPU LINQPad)
 /// </summary>
 
 // Force new LINQPad query process to reinit JVM.

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7cdea18/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ComputeExample.linq
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ComputeExample.linq b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ComputeExample.linq
index 98e3d29..cf5a45f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ComputeExample.linq
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ComputeExample.linq
@@ -30,7 +30,6 @@
 /// 
 /// Requirements:
 /// * Java Runtime Environment (JRE): http://www.oracle.com/technetwork/java/javase/downloads/index.html (x86 for regular LINQPad, x64 for AnyCPU LINQPad)
-/// * Microsoft Visual C++ 2010 Redistributable Package: http://www.microsoft.com/en-us/download/details.aspx?id=14632 (x86 for regular LINQPad, x64 for AnyCPU LINQPad)
 /// </summary>
 
 void Main()

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7cdea18/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/PutGetExample.linq
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/PutGetExample.linq b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/PutGetExample.linq
index ef37a3c..ea396da 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/PutGetExample.linq
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/PutGetExample.linq
@@ -28,7 +28,6 @@
 /// 
 /// Requirements:
 /// * Java Runtime Environment (JRE): http://www.oracle.com/technetwork/java/javase/downloads/index.html (x86 for regular LINQPad, x64 for AnyCPU LINQPad)
-/// * Microsoft Visual C++ 2010 Redistributable Package: http://www.microsoft.com/en-us/download/details.aspx?id=14632 (x86 for regular LINQPad, x64 for AnyCPU LINQPad)
 /// </summary>
 
 void Main()

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7cdea18/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/QueryExample.linq
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/QueryExample.linq b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/QueryExample.linq
index b3d63ba..ae48596 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/QueryExample.linq
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/QueryExample.linq
@@ -31,7 +31,6 @@
 /// 
 /// Requirements:
 /// * Java Runtime Environment (JRE): http://www.oracle.com/technetwork/java/javase/downloads/index.html (x86 for regular LINQPad, x64 for AnyCPU LINQPad)
-/// * Microsoft Visual C++ 2010 Redistributable Package: http://www.microsoft.com/en-us/download/details.aspx?id=14632 (x86 for regular LINQPad, x64 for AnyCPU LINQPad)
 /// </summary>
 
 void Main()

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7cdea18/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ThinClient.linq
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ThinClient.linq b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ThinClient.linq
new file mode 100644
index 0000000..e557e82
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ThinClient.linq
@@ -0,0 +1,56 @@
+<Query Kind="Statements">
+  <NuGetReference>Apache.Ignite</NuGetReference>
+  <Namespace>Apache.Ignite.Core</Namespace>
+  <Namespace>Apache.Ignite.Core.Client</Namespace>
+  <Namespace>Apache.Ignite.Core.Binary</Namespace>
+  <Namespace>Apache.Ignite.Core.Cache.Query</Namespace>
+</Query>
+
+/*
+* 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.
+*/
+
+/// <summary>
+/// This example demonstrates thin client protocol connection.
+/// Thin client connects to an existing Ignite node and does not start JVM in process.
+///
+/// This example requires running Ignite node.
+/// You can start an Ignite node with ignite.bat or Apache.Ignite.exe.
+/// Alternatively, open QueryExample in a separate tab, add Thread.Sleep(-1) in there and run.
+/// </summary>
+
+var cfg = new IgniteClientConfiguration { Host = "127.0.0.1" };
+using (var client = Ignition.StartClient(cfg))
+{
+	// Create cache for demo purpose.
+	var fooCache = client.GetOrCreateCache<int, object>("thin-client-test").WithKeepBinary<int, IBinaryObject>();
+	fooCache[1] = client.GetBinary().GetBuilder("foo")
+		.SetStringField("Name", "John")
+		.SetTimestampField("Birthday", new DateTime(2001, 5, 15).ToUniversalTime())
+		.Build();
+
+	var cacheNames = client.GetCacheNames();
+	"Diplaying first 5 items from each cache:".Dump();
+	
+	foreach (var name in cacheNames)
+	{
+		var cache = client.GetCache<object, object>(name).WithKeepBinary<object, object>();
+		var items = cache.Query(new ScanQuery<object, object>()).Take(5)
+			.ToDictionary(x => x.Key.ToString(), x => x.Value.ToString());
+		
+		items.Dump(name);
+	}
+}