#ignite-964: rename examples files.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/bdf65670 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bdf65670 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bdf65670 Branch: refs/heads/ignite-964 Commit: bdf65670454b71266c27393a28606837a01a998a Parents: 8733ba2 Author: ivasilinets <ivasilin...@gridgain.com> Authored: Wed Jul 8 20:32:51 2015 +0300 Committer: ivasilinets <ivasilin...@gridgain.com> Committed: Wed Jul 8 20:32:51 2015 +0300 ---------------------------------------------------------------------- .../src/main/js/compute-callable-example.js | 44 --------------- .../src/main/js/compute-task-split-example.js | 56 -------------------- examples/src/main/js/map-reduce-example.js | 56 ++++++++++++++++++++ examples/src/main/js/run-function-example.js | 44 +++++++++++++++ 4 files changed, 100 insertions(+), 100 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bdf65670/examples/src/main/js/compute-callable-example.js ---------------------------------------------------------------------- diff --git a/examples/src/main/js/compute-callable-example.js b/examples/src/main/js/compute-callable-example.js deleted file mode 100644 index 1005c9f..0000000 --- a/examples/src/main/js/compute-callable-example.js +++ /dev/null @@ -1,44 +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. - */ - -var apacheIgnite = require("apache-ignite"); -var Ignition = apacheIgnite.Ignition; - -Ignition.start(['127.0.0.1:9095'], null, onConnect); - -function onConnect(err, ignite) { - console.log(">>> Compute callable example started"); - - var f = function (args) { - var words = args.split(" "); - - var sum = 0; - - for (var i = 0; i < words.length; ++i) { - sum += words[i].length; - } - - return sum; - } - - var onRunScript = function(err, sum) { - console.log(">>> Total number of characters in the phrase is '" + sum + "'."); - console.log(">>> Check all nodes for output (this node is also part of the cluster)."); - } - - ignite.compute().runScript(f, "Hello Ignite Enabled World!", onRunScript); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bdf65670/examples/src/main/js/compute-task-split-example.js ---------------------------------------------------------------------- diff --git a/examples/src/main/js/compute-task-split-example.js b/examples/src/main/js/compute-task-split-example.js deleted file mode 100644 index e6d7ee9..0000000 --- a/examples/src/main/js/compute-task-split-example.js +++ /dev/null @@ -1,56 +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. - */ - -var apacheIgnite = require("apache-ignite"); -var Ignition = apacheIgnite.Ignition; - -Ignition.start(['127.0.0.1:9095'], null, onConnect); - -function onConnect(err, ignite) { - console.log(">>> Compute task split example started."); - - var map = function(nodes, args) { - var words = args.split(" "); - - for (var i = 0; i < words.length; i++) { - var f = function (word) { - print(">>> Printing '" + word + "' on this node from ignite job."); - - return word.length; - }; - - emit(f, words[i], nodes[i % nodes.length]); - } - } - - var reduce = function(results) { - var sum = 0; - - for (var i = 0; i < results.length; ++i) { - sum += results[i]; - } - - return sum; - } - - var onMapReduce = function(err, cnt) { - console.log(">>> Total number of characters in the phrase is '" + cnt + "'."); - console.log(">>> Check all nodes for output (this node is also part of the cluster)."); - } - - ignite.compute().execute(map, reduce, "Hello Ignite Enabled World!", onMapReduce); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bdf65670/examples/src/main/js/map-reduce-example.js ---------------------------------------------------------------------- diff --git a/examples/src/main/js/map-reduce-example.js b/examples/src/main/js/map-reduce-example.js new file mode 100644 index 0000000..e6d7ee9 --- /dev/null +++ b/examples/src/main/js/map-reduce-example.js @@ -0,0 +1,56 @@ +/* + * 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. + */ + +var apacheIgnite = require("apache-ignite"); +var Ignition = apacheIgnite.Ignition; + +Ignition.start(['127.0.0.1:9095'], null, onConnect); + +function onConnect(err, ignite) { + console.log(">>> Compute task split example started."); + + var map = function(nodes, args) { + var words = args.split(" "); + + for (var i = 0; i < words.length; i++) { + var f = function (word) { + print(">>> Printing '" + word + "' on this node from ignite job."); + + return word.length; + }; + + emit(f, words[i], nodes[i % nodes.length]); + } + } + + var reduce = function(results) { + var sum = 0; + + for (var i = 0; i < results.length; ++i) { + sum += results[i]; + } + + return sum; + } + + var onMapReduce = function(err, cnt) { + console.log(">>> Total number of characters in the phrase is '" + cnt + "'."); + console.log(">>> Check all nodes for output (this node is also part of the cluster)."); + } + + ignite.compute().execute(map, reduce, "Hello Ignite Enabled World!", onMapReduce); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bdf65670/examples/src/main/js/run-function-example.js ---------------------------------------------------------------------- diff --git a/examples/src/main/js/run-function-example.js b/examples/src/main/js/run-function-example.js new file mode 100644 index 0000000..1005c9f --- /dev/null +++ b/examples/src/main/js/run-function-example.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +var apacheIgnite = require("apache-ignite"); +var Ignition = apacheIgnite.Ignition; + +Ignition.start(['127.0.0.1:9095'], null, onConnect); + +function onConnect(err, ignite) { + console.log(">>> Compute callable example started"); + + var f = function (args) { + var words = args.split(" "); + + var sum = 0; + + for (var i = 0; i < words.length; ++i) { + sum += words[i].length; + } + + return sum; + } + + var onRunScript = function(err, sum) { + console.log(">>> Total number of characters in the phrase is '" + sum + "'."); + console.log(">>> Check all nodes for output (this node is also part of the cluster)."); + } + + ignite.compute().runScript(f, "Hello Ignite Enabled World!", onRunScript); +} \ No newline at end of file