http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/fs/package.html ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/fs/package.html b/examples/src/main/java/org/apache/ignite/examples/fs/package.html new file mode 100644 index 0000000..80941e2 --- /dev/null +++ b/examples/src/main/java/org/apache/ignite/examples/fs/package.html @@ -0,0 +1,23 @@ +<!-- + 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. + --> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<body> + <!-- Package description. --> + Demonstrates using of Ignite File System. +</body> +</html>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsMapReduceExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsMapReduceExample.java b/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsMapReduceExample.java deleted file mode 100644 index 43990d0..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsMapReduceExample.java +++ /dev/null @@ -1,249 +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.ggfs; - -import org.apache.ignite.*; -import org.apache.ignite.compute.*; -import org.apache.ignite.fs.*; -import org.apache.ignite.fs.mapreduce.*; -import org.apache.ignite.fs.mapreduce.records.*; - -import java.io.*; -import java.util.*; - -/** - * Example that shows how to use {@link org.apache.ignite.fs.mapreduce.IgniteFsTask} to find lines matching particular pattern in the file in pretty - * the same way as {@code grep} command does. - * <p> - * Remote nodes should always be started with configuration file which includes - * GGFS: {@code 'ignite.sh examples/config/filesystem/example-ggfs.xml'}. - * <p> - * Alternatively you can run {@link GgfsNodeStartup} in another JVM which will start - * node with {@code examples/config/filesystem/example-ggfs.xml} configuration. - */ -public class GgfsMapReduceExample { - /** - * Executes example. - * - * @param args Command line arguments. First argument is file name, second argument is regex to look for. - * @throws Exception If failed. - */ - public static void main(String[] args) throws Exception { - if (args.length == 0) - System.out.println("Please provide file name and regular expression."); - else if (args.length == 1) - System.out.println("Please provide regular expression."); - else { - try (Ignite ignite = Ignition.start("examples/config/filesystem/example-ggfs.xml")) { - System.out.println(); - System.out.println(">>> GGFS map reduce example started."); - - // Prepare arguments. - String fileName = args[0]; - - File file = new File(fileName); - - String regexStr = args[1]; - - // Get an instance of Ignite File System. - IgniteFs fs = ignite.fileSystem("ggfs"); - - // Working directory path. - IgniteFsPath workDir = new IgniteFsPath("/examples/ggfs"); - - // Write file to GGFS. - IgniteFsPath fsPath = new IgniteFsPath(workDir, file.getName()); - - writeFile(fs, fsPath, file); - - Collection<Line> lines = fs.execute(new GrepTask(), IgniteFsNewLineRecordResolver.NEW_LINE, - Collections.singleton(fsPath), regexStr); - - if (lines.isEmpty()) { - System.out.println(); - System.out.println("No lines were found."); - } - else { - for (Line line : lines) - print(line.fileLine()); - } - } - } - } - - /** - * Write file to the Ignite file system. - * - * @param fs Ignite file system. - * @param fsPath Ignite file system path. - * @param file File to write. - * @throws Exception In case of exception. - */ - private static void writeFile(IgniteFs fs, IgniteFsPath fsPath, File file) throws Exception { - System.out.println(); - System.out.println("Copying file to GGFS: " + file); - - try ( - IgniteFsOutputStream os = fs.create(fsPath, true); - FileInputStream fis = new FileInputStream(file) - ) { - byte[] buf = new byte[2048]; - - int read = fis.read(buf); - - while (read != -1) { - os.write(buf, 0, read); - - read = fis.read(buf); - } - } - } - - /** - * Print particular string. - * - * @param str String. - */ - private static void print(String str) { - System.out.println(">>> " + str); - } - - /** - * Grep task. - */ - private static class GrepTask extends IgniteFsTask<String, Collection<Line>> { - /** {@inheritDoc} */ - @Override public IgniteFsJob createJob(IgniteFsPath path, IgniteFsFileRange range, - IgniteFsTaskArgs<String> args) { - return new GrepJob(args.userArgument()); - } - - /** {@inheritDoc} */ - @Override public Collection<Line> reduce(List<ComputeJobResult> results) { - Collection<Line> lines = new TreeSet<>(new Comparator<Line>() { - @Override public int compare(Line line1, Line line2) { - return line1.rangePosition() < line2.rangePosition() ? -1 : - line1.rangePosition() > line2.rangePosition() ? 1 : line1.lineIndex() - line2.lineIndex(); - } - }); - - for (ComputeJobResult res : results) { - if (res.getException() != null) - throw res.getException(); - - Collection<Line> line = res.getData(); - - if (line != null) - lines.addAll(line); - } - - return lines; - } - } - - /** - * Grep job. - */ - private static class GrepJob extends IgniteFsInputStreamJobAdapter { - /** Regex string. */ - private final String regex; - - /** - * Constructor. - * - * @param regex Regex string. - */ - private GrepJob(String regex) { - this.regex = regex; - } - - /** {@inheritDoc} */ - @Override public Object execute(IgniteFs ggfs, IgniteFsRangeInputStream in) throws IgniteException, IOException { - Collection<Line> res = null; - - long start = in.startOffset(); - - try (BufferedReader br = new BufferedReader(new InputStreamReader(in))) { - int ctr = 0; - - String line = br.readLine(); - - while (line != null) { - if (line.matches(".*" + regex + ".*")) { - if (res == null) - res = new HashSet<>(); - - res.add(new Line(start, ctr++, line)); - } - - line = br.readLine(); - } - } - - return res; - } - } - - /** - * Single file line with it's position. - */ - private static class Line { - /** Line start position in the file. */ - private long rangePos; - - /** Matching line index within the range. */ - private final int lineIdx; - - /** File line. */ - private String line; - - /** - * Constructor. - * - * @param rangePos Range position. - * @param lineIdx Matching line index within the range. - * @param line File line. - */ - private Line(long rangePos, int lineIdx, String line) { - this.rangePos = rangePos; - this.lineIdx = lineIdx; - this.line = line; - } - - /** - * @return Range position. - */ - public long rangePosition() { - return rangePos; - } - - /** - * @return Matching line index within the range. - */ - public int lineIndex() { - return lineIdx; - } - - /** - * @return File line. - */ - public String fileLine() { - return line; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsNodeStartup.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsNodeStartup.java b/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsNodeStartup.java deleted file mode 100644 index 66e89a9..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsNodeStartup.java +++ /dev/null @@ -1,41 +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.ggfs; - -import org.apache.ignite.*; - -/** - * Starts up an empty node with GGFS configuration. - * You can also start a stand-alone Ignite instance by passing the path - * to configuration file to {@code 'ignite.{sh|bat}'} script, like so: - * {@code 'ignite.sh examples/config/filesystem/example-ggfs.xml'}. - * <p> - * The difference is that running this class from IDE adds all example classes to classpath - * but running from command line doesn't. - */ -public class GgfsNodeStartup { - /** - * Start up an empty node with specified cache configuration. - * - * @param args Command line arguments, none required. - * @throws IgniteException If example execution failed. - */ - public static void main(String[] args) throws IgniteException { - Ignition.start("examples/config/filesystem/example-ggfs.xml"); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/ggfs/package.html ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/ggfs/package.html b/examples/src/main/java/org/apache/ignite/examples/ggfs/package.html deleted file mode 100644 index 80941e2..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/ggfs/package.html +++ /dev/null @@ -1,23 +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. - --> -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<body> - <!-- Package description. --> - Demonstrates using of Ignite File System. -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingExample.java b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingExample.java index 3eb2222..4ad667b 100644 --- a/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingExample.java @@ -50,7 +50,7 @@ public final class MessagingExample { * Executes example. * * @param args Command line arguments, none required. - * @throws IgniteCheckedException If example execution failed. + * @throws IgniteException If example execution failed. */ public static void main(String[] args) throws Exception { try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java index 4324fbc..b02aba2 100644 --- a/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java @@ -20,9 +20,9 @@ package org.apache.ignite.examples.messaging; import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.examples.*; +import org.apache.ignite.internal.util.lang.*; import org.apache.ignite.lang.*; import org.apache.ignite.resources.*; -import org.apache.ignite.internal.util.lang.*; import java.util.*; import java.util.concurrent.*; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExampleNodeStartup.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExampleNodeStartup.java b/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExampleNodeStartup.java index a6ea36d..41e4f81 100644 --- a/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExampleNodeStartup.java +++ b/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExampleNodeStartup.java @@ -27,10 +27,10 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; import java.util.*; -import static org.apache.ignite.configuration.IgniteDeploymentMode.*; import static org.apache.ignite.cache.CacheAtomicityMode.*; import static org.apache.ignite.cache.CachePreloadMode.*; import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*; +import static org.apache.ignite.configuration.IgniteDeploymentMode.*; /** * Starts up an empty node with cache configuration that contains default cache. @@ -43,19 +43,19 @@ public class MemcacheRestExampleNodeStartup { * Start up an empty node with specified cache configuration. * * @param args Command line arguments, none required. - * @throws IgniteCheckedException If example execution failed. + * @throws IgniteException If example execution failed. */ - public static void main(String[] args) throws IgniteCheckedException { + public static void main(String[] args) throws IgniteException { Ignition.start(configuration()); } /** - * Create Grid configuration with GGFS and enabled IPC. + * Create Grid configuration with IgniteFs and enabled IPC. * * @return Grid configuration. - * @throws IgniteCheckedException If configuration creation failed. + * @throws IgniteException If configuration creation failed. */ - public static IgniteConfiguration configuration() throws IgniteCheckedException { + public static IgniteConfiguration configuration() throws IgniteException { IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setLocalHost("127.0.0.1"); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java b/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java index cc775f5..b5f20ce 100644 --- a/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java @@ -36,9 +36,9 @@ public final class LifecycleExample { * Executes example. * * @param args Command line arguments, none required. - * @throws IgniteCheckedException If example execution failed. + * @throws IgniteException If example execution failed. */ - public static void main(String[] args) throws IgniteCheckedException { + public static void main(String[] args) throws IgniteException { System.out.println(); System.out.println(">>> Lifecycle example started."); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java b/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java index 74b3897..6f695fe 100644 --- a/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java @@ -46,7 +46,7 @@ public final class SpringBeanExample { * Executes example. * * @param args Command line arguments, none required. - * @throws IgniteCheckedException If example execution failed. + * @throws IgniteException If example execution failed. */ public static void main(String[] args) throws Exception { System.out.println(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingCheckInExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingCheckInExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingCheckInExample.java index 18ed047..19c6f5d 100644 --- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingCheckInExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingCheckInExample.java @@ -101,7 +101,7 @@ public class StreamingCheckInExample { * Executes example. * * @param args Command line arguments, none required. - * @throws IgniteCheckedException If example execution failed. + * @throws IgniteException If example execution failed. */ public static void main(String[] args) throws Exception { Timer timer = new Timer("check-in-query-worker"); @@ -235,10 +235,10 @@ public class StreamingCheckInExample { * Streams check-in events into the system. * * @param streamer Streamer. - * @throws IgniteCheckedException If failed. + * @throws IgniteException If failed. */ @SuppressWarnings("BusyWait") - private static void streamData(IgniteStreamer streamer) throws IgniteCheckedException { + private static void streamData(IgniteStreamer streamer) throws IgniteException { try { for (int i = 0; i < CNT; i++) { CheckInEvent evt = new CheckInEvent( http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingNodeStartup.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingNodeStartup.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingNodeStartup.java index cbf62a7..c4baae2 100644 --- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingNodeStartup.java +++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingNodeStartup.java @@ -27,9 +27,9 @@ public class StreamingNodeStartup { * Start up an empty node with specified cache configuration. * * @param args Command line arguments, none required. - * @throws IgniteCheckedException If example execution failed. + * @throws IgniteException If example execution failed. */ - public static void main(String[] args) throws IgniteCheckedException { + public static void main(String[] args) throws IgniteException { Ignition.start("examples/config/example-streamer.xml"); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPopularNumbersExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPopularNumbersExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPopularNumbersExample.java index 8893782..cb0eb7d 100644 --- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPopularNumbersExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPopularNumbersExample.java @@ -91,7 +91,7 @@ public class StreamingPopularNumbersExample { * Executes example. * * @param args Command line arguments, none required. - * @throws IgniteCheckedException If example execution failed. + * @throws IgniteException If example execution failed. */ public static void main(String[] args) throws Exception { Timer popularNumbersQryTimer = new Timer("numbers-query-worker"); @@ -139,9 +139,9 @@ public class StreamingPopularNumbersExample { * Streams random numbers into the system. * * @param ignite Ignite. - * @throws IgniteCheckedException If failed. + * @throws IgniteException If failed. */ - private static void streamData(final Ignite ignite) throws IgniteCheckedException { + private static void streamData(final Ignite ignite) throws IgniteException { final IgniteStreamer streamer = ignite.streamer("popular-numbers"); // Use gaussian distribution to ensure that http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPriceBarsExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPriceBarsExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPriceBarsExample.java index a01e5d4..410f633 100644 --- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPriceBarsExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPriceBarsExample.java @@ -73,7 +73,7 @@ public class StreamingPriceBarsExample { * Executes example. * * @param args Command line arguments, none required. - * @throws IgniteCheckedException If example execution failed. + * @throws IgniteException If example execution failed. */ public static void main(String[] args) throws Exception { Timer timer = new Timer("priceBars"); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java8/org/apache/ignite/examples/ComputeExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java8/org/apache/ignite/examples/ComputeExample.java b/examples/src/main/java8/org/apache/ignite/examples/ComputeExample.java index 82dfdce..80e8288 100644 --- a/examples/src/main/java8/org/apache/ignite/examples/ComputeExample.java +++ b/examples/src/main/java8/org/apache/ignite/examples/ComputeExample.java @@ -19,7 +19,6 @@ package org.apache.ignite.examples; import org.apache.ignite.*; import org.apache.ignite.lang.*; -import org.apache.ignite.lang.IgniteCallable; /** * Demonstrates broadcasting and unicasting computations within cluster. @@ -32,7 +31,7 @@ public class ComputeExample { * Executes example. * * @param args Command line arguments, none required. - * @throws IgniteCheckedException If example execution failed. + * @throws IgniteException If example execution failed. */ public static void main(String[] args) throws Exception { try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/java8/org/apache/ignite/examples/MessagingExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java8/org/apache/ignite/examples/MessagingExample.java b/examples/src/main/java8/org/apache/ignite/examples/MessagingExample.java index edf1190..65b7e8f 100644 --- a/examples/src/main/java8/org/apache/ignite/examples/MessagingExample.java +++ b/examples/src/main/java8/org/apache/ignite/examples/MessagingExample.java @@ -18,10 +18,6 @@ package org.apache.ignite.examples; import org.apache.ignite.*; -import org.apache.ignite.cluster.*; -import org.apache.ignite.examples.*; - -import java.util.concurrent.*; /** * Example that demonstrates how to exchange messages between nodes. Use such @@ -47,7 +43,7 @@ public final class MessagingExample { * Executes example. * * @param args Command line arguments, none required. - * @throws IgniteCheckedException If example execution failed. + * @throws IgniteException If example execution failed. */ public static void main(String[] args) throws Exception { try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { @@ -101,9 +97,9 @@ public final class MessagingExample { * Start listening to messages on all cluster nodes within passed in projection. * * @param prj Grid projection. - * @throws IgniteCheckedException If failed. + * @throws IgniteException If failed. */ - private static void startListening(ClusterGroup prj) throws IgniteCheckedException { + private static void startListening(ClusterGroup prj) throws IgniteException { // Add ordered message listener. prj.message().remoteListen(TOPIC.ORDERED, (nodeId, msg) -> { System.out.println("Received ordered message [msg=" + msg + ", fromNodeId=" + nodeId + ']'); @@ -113,7 +109,7 @@ public final class MessagingExample { // So, need to get projection for sender node through entire grid. prj.ignite().forNodeId(nodeId).message().send(TOPIC.ORDERED, msg); } - catch (IgniteCheckedException e) { + catch (IgniteException e) { e.printStackTrace(); } @@ -129,7 +125,7 @@ public final class MessagingExample { // So, need to get projection for sender node through entire grid. prj.ignite().forNodeId(nodeId).message().send(TOPIC.UNORDERED, msg); } - catch (IgniteCheckedException e) { + catch (IgniteException e) { e.printStackTrace(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample1.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample1.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample1.scala index d89b987..b07bb76 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample1.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample1.scala @@ -17,6 +17,8 @@ package org.apache.ignite.scalar.examples +import java.util.concurrent.Callable + import org.apache.ignite._ import org.apache.ignite.cache.CacheName import org.apache.ignite.cache.affinity.CacheAffinityKeyMapped @@ -24,8 +26,6 @@ import org.apache.ignite.scalar.scalar import org.apache.ignite.scalar.scalar._ import org.jetbrains.annotations.Nullable -import java.util.concurrent.Callable - /** * Example of how to collocate computations and data in Ignite using * `CacheAffinityKeyMapped` annotation as opposed to direct API calls. This @@ -59,12 +59,12 @@ object ScalarCacheAffinityExample1 { ('A' to 'Z').foreach(keys :+= _.toString) - populateCache(ignite, keys) + populateCache(ignite$, keys) var results = Map.empty[String, String] keys.foreach(key => { - val res = ignite.call$( + val res = ignite$.call$( new Callable[String] { @CacheAffinityKeyMapped def affinityKey(): String = key @@ -78,7 +78,7 @@ object ScalarCacheAffinityExample1 { val cache = cache$[String, String](NAME) if (!cache.isDefined) { - println(">>> Cache not found [nodeId=" + ignite.cluster().localNode.id + + println(">>> Cache not found [nodeId=" + ignite$.cluster().localNode.id + ", cacheName=" + NAME + ']') "Error" http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample2.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample2.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample2.scala index 3dea5fd..648be33 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample2.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample2.scala @@ -53,17 +53,17 @@ object ScalarCacheAffinityExample2 { ('A' to 'Z').foreach(keys :+= _.toString) - populateCache(ignite, keys) + populateCache(ignite$, keys) // Map all keys to nodes. - val mappings = ignite.cluster().mapKeysToNodes(NAME, keys) + val mappings = ignite$.cluster().mapKeysToNodes(NAME, keys) mappings.foreach(mapping => { val node = mapping._1 val mappedKeys = mapping._2 if (node != null) { - ignite.cluster().forNode(node) *< (() => { + ignite$.cluster().forNode(node) *< (() => { breakable { println(">>> Executing affinity job for keys: " + mappedKeys) @@ -73,7 +73,7 @@ object ScalarCacheAffinityExample2 { // If cache is not defined at this point then it means that // job was not routed by affinity. if (!cache.isDefined) - println(">>> Cache not found [nodeId=" + ignite.cluster().localNode().id() + + println(">>> Cache not found [nodeId=" + ignite$.cluster().localNode().id() + ", cacheName=" + NAME + ']').^^ // Check cache without loading the value. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinitySimpleExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinitySimpleExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinitySimpleExample.scala index f6e12ca..6db5164 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinitySimpleExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinitySimpleExample.scala @@ -53,7 +53,7 @@ object ScalarCacheAffinitySimpleExample extends App { // Clean up caches on all nodes before run. cache$(NAME).get.globalClearAll(0) - val c = ignite.cache[Int, String](NAME) + val c = ignite$.cache[Int, String](NAME) populate(c) visit(c) @@ -67,7 +67,7 @@ object ScalarCacheAffinitySimpleExample extends App { */ private def visit(c: Cache) { (0 until KEY_CNT).foreach(i => - ignite.compute().affinityRun(NAME, i, + ignite$.compute().affinityRun(NAME, i, () => println("Co-located [key= " + i + ", value=" + c.peek(i) + ']')) ) } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheExample.scala index 3855269..d95939a 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheExample.scala @@ -126,7 +126,7 @@ object ScalarCacheExample extends App { * so we can actually see what happens underneath locally and remotely. */ def registerListener() { - val g = ignite + val g = ignite$ g *< (() => { val lsnr = new IgnitePredicate[IgniteEvent] { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala index 04658bd..8ba7f6f 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala @@ -17,13 +17,13 @@ package org.apache.ignite.scalar.examples -import org.apache.ignite.IgniteCheckedException +import java.util.Timer + +import org.apache.ignite.IgniteException import org.apache.ignite.examples.datagrid.CacheNodeStartup import org.apache.ignite.scalar.scalar import org.apache.ignite.scalar.scalar._ -import java.util.Timer - import scala.util.Random /** @@ -58,7 +58,7 @@ object ScalarCachePopularNumbersExample extends App { println() println(">>> Cache popular numbers example started.") - val grp = ignite.cluster().forCache(CACHE_NAME) + val grp = ignite$.cluster().forCache(CACHE_NAME) if (grp.nodes().isEmpty) println("Ignite does not have cache configured: " + CACHE_NAME); @@ -75,7 +75,7 @@ object ScalarCachePopularNumbersExample extends App { query(POPULAR_NUMBERS_CNT) // Clean up caches on all nodes after run. - ignite.cluster().forCache(CACHE_NAME).bcastRun(() => ignite.cache(CACHE_NAME).clearAll(), null) + ignite$.cluster().forCache(CACHE_NAME).bcastRun(() => ignite$.cache(CACHE_NAME).clearAll(), null) } finally { popularNumbersQryTimer.cancel() @@ -85,9 +85,9 @@ object ScalarCachePopularNumbersExample extends App { /** * Populates cache in real time with numbers and keeps count for every number. - * @throws IgniteCheckedException If failed. + * @throws IgniteException If failed. */ - @throws[IgniteCheckedException] + @throws[IgniteException] def streamData() { // Set larger per-node buffer size since our state is relatively small. // Reduce parallel operations since we running the whole grid locally under heavy load. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala index 108c415..0b2a71f 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala @@ -17,6 +17,8 @@ package org.apache.ignite.scalar.examples +import java.util._ + import org.apache.ignite.Ignite import org.apache.ignite.cache.CacheMode._ import org.apache.ignite.cache.CacheProjection @@ -25,8 +27,6 @@ import org.apache.ignite.internal.processors.cache.CacheFlag import org.apache.ignite.scalar.scalar import org.apache.ignite.scalar.scalar._ -import java.util._ - /** * Demonstrates cache ad-hoc queries with Scalar. * <p> @@ -45,7 +45,7 @@ object ScalarCacheQueryExample { */ def main(args: Array[String]) { scalar("examples/config/example-cache.xml") { - example(ignite) + example(ignite$) } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarClosureExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarClosureExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarClosureExample.scala index c825fa6..46a78d1 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarClosureExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarClosureExample.scala @@ -41,7 +41,7 @@ object ScalarClosureExample extends App { * Prints ignite topology. */ def topology() { - ignite foreach (n => println("Node: " + nid8$(n))) + ignite$ foreach (n => println("Node: " + nid8$(n))) } /** @@ -51,31 +51,31 @@ object ScalarClosureExample extends App { // Notice the example usage of Java-side closure 'F.println(...)' and method 'scala' // that explicitly converts Java side object to a proper Scala counterpart. // This method is required since implicit conversion won't be applied here. - ignite.run$(for (w <- "Hello World!".split(" ")) yield () => println(w), null) + ignite$.run$(for (w <- "Hello World!".split(" ")) yield () => println(w), null) } /** * Obligatory example - cloud enabled Hello World! */ def helloWorld() { - ignite.run$("HELLO WORLD!".split(" ") map (w => () => println(w)), null) + ignite$.run$("HELLO WORLD!".split(" ") map (w => () => println(w)), null) } /** * One way to execute closures on the ignite cluster. */ def broadcast() { - ignite.bcastRun(() => println("Broadcasting!!!"), null) + ignite$.bcastRun(() => println("Broadcasting!!!"), null) } /** * Greats all remote nodes only. */ def greetRemotes() { - val me = ignite.cluster().localNode.id + val me = ignite$.cluster().localNode.id // Note that usage Java-based closure. - ignite.cluster().forRemotes() match { + ignite$.cluster().forRemotes() match { case p if p.isEmpty => println("No remote nodes!") case p => p.bcastRun(() => println("Greetings from: " + me), null) } @@ -85,11 +85,11 @@ object ScalarClosureExample extends App { * Same as previous greetings for all remote nodes but remote projection is created manually. */ def greetRemotesAgain() { - val me = ignite.cluster().localNode.id + val me = ignite$.cluster().localNode.id // Just show that we can create any projections we like... // Note that usage of Java-based closure via 'F' typedef. - ignite.cluster().forPredicate((n: ClusterNode) => n.id != me) match { + ignite$.cluster().forPredicate((n: ClusterNode) => n.id != me) match { case p if p.isEmpty => println("No remote nodes!") case p => p.bcastRun(() => println("Greetings again from: " + me), null) } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarContinuationExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarContinuationExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarContinuationExample.scala index 927ddb0..94a8346 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarContinuationExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarContinuationExample.scala @@ -17,17 +17,16 @@ package org.apache.ignite.scalar.examples +import java.math._ +import java.util + import org.apache.ignite.compute.ComputeJobContext -import org.apache.ignite.internal.IgniteInternalFuture -import org.apache.ignite.lang.{IgniteFuture, IgniteClosure} +import org.apache.ignite.lang.{IgniteClosure, IgniteFuture} import org.apache.ignite.resources.IgniteJobContextResource import org.apache.ignite.scalar.scalar import org.apache.ignite.scalar.scalar._ import org.jetbrains.annotations.Nullable -import java.math._ -import java.util - /** * This example recursively calculates `Fibonacci` numbers on the grid. This is * a powerful design pattern which allows for creation of fully distributively recursive @@ -48,14 +47,14 @@ object ScalarContinuationExample { // Calculate fibonacci for N. val N: Long = 100 - val thisNode = ignite.cluster().localNode + val thisNode = ignite$.cluster().localNode val start = System.currentTimeMillis // Projection that excludes this node if others exists. - val prj = if (ignite.cluster().nodes().size() > 1) ignite.cluster().forOthers(thisNode) else ignite.cluster().forNode(thisNode) + val prj = if (ignite$.cluster().nodes().size() > 1) ignite$.cluster().forOthers(thisNode) else ignite$.cluster().forNode(thisNode) - val fib = ignite.compute(prj).apply(new FibonacciClosure(thisNode.id()), N) + val fib = ignite$.compute(prj).apply(new FibonacciClosure(thisNode.id()), N) val duration = System.currentTimeMillis - start @@ -95,7 +94,7 @@ class FibonacciClosure ( // Make sure n is not negative. val n = math.abs(num) - val g = ignite + val g = ignite$ if (n <= 2) return if (n == 0) @@ -110,12 +109,12 @@ class FibonacciClosure ( fut1 = store.get(n - 1) fut2 = store.get(n - 2) - val excludeNode = ignite.cluster().node(excludeNodeId) + val excludeNode = ignite$.cluster().node(excludeNodeId) // Projection that excludes node with id passed in constructor if others exists. - val prj = if (ignite.cluster().nodes().size() > 1) ignite.cluster().forOthers(excludeNode) else ignite.cluster().forNode(excludeNode) + val prj = if (ignite$.cluster().nodes().size() > 1) ignite$.cluster().forOthers(excludeNode) else ignite$.cluster().forNode(excludeNode) - val comp = ignite.compute(prj).withAsync() + val comp = ignite$.compute(prj).withAsync() // If future is not cached in node-local store, cache it. // Note recursive grid execution! http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCreditRiskExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCreditRiskExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCreditRiskExample.scala index 45d3e60..f7b7cef 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCreditRiskExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCreditRiskExample.scala @@ -65,7 +65,7 @@ object ScalarCreditRiskExample { // aware if method was executed just locally or on the 100s of cluster nodes. // Credit risk crdRisk is the minimal amount that creditor has to have // available to cover possible defaults. - val crdRisk = ignite @< (closures(ignite.cluster().nodes().size(), portfolio, horizon, iter, percentile), + val crdRisk = ignite$ @< (closures(ignite$.cluster().nodes().size(), portfolio, horizon, iter, percentile), (s: Seq[Double]) => s.sum / s.size, null) println("Credit risk [crdRisk=" + crdRisk + ", duration=" + http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarJvmCloudExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarJvmCloudExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarJvmCloudExample.scala index f13d1be..2d73edc 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarJvmCloudExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarJvmCloudExample.scala @@ -17,16 +17,16 @@ package org.apache.ignite.scalar.examples +import java.util.concurrent.Executors +import java.util.concurrent.TimeUnit._ +import javax.swing.{JComponent, JLabel, JOptionPane} + import org.apache.ignite.configuration.IgniteConfiguration import org.apache.ignite.internal.util.scala.impl import org.apache.ignite.scalar.scalar import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder -import javax.swing.{JComponent, JLabel, JOptionPane} -import java.util.concurrent.Executors -import java.util.concurrent.TimeUnit._ - /** * This example demonstrates how you can easily startup multiple nodes * in the same JVM with Scala. All started nodes use default configuration http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPiCalculationExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPiCalculationExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPiCalculationExample.scala index 44244ac..c3480d6 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPiCalculationExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPiCalculationExample.scala @@ -36,9 +36,9 @@ object ScalarPiCalculationExample { def main(args: Array[String]) { scalar("examples/config/example-compute.xml") { - val jobs = for (i <- 0 until ignite.cluster().nodes().size()) yield () => calcPi(i * N) + val jobs = for (i <- 0 until ignite$.cluster().nodes().size()) yield () => calcPi(i * N) - println("Pi estimate: " + ignite.reduce$[Double, Double](jobs, _.sum, null)) + println("Pi estimate: " + ignite$.reduce$[Double, Double](jobs, _.sum, null)) } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPingPongExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPingPongExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPingPongExample.scala index 8eb0d8e..877f016 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPingPongExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPingPongExample.scala @@ -17,13 +17,13 @@ package org.apache.ignite.scalar.examples +import java.util.UUID +import java.util.concurrent.CountDownLatch + import org.apache.ignite.messaging.MessagingListenActor import org.apache.ignite.scalar.scalar import org.apache.ignite.scalar.scalar._ -import java.util.UUID -import java.util.concurrent.CountDownLatch - /** * Demonstrates simple protocol-based exchange in playing a ping-pong between * two nodes. It is analogous to `GridMessagingPingPongExample` on Java side. @@ -41,7 +41,7 @@ object ScalarPingPongExample extends App { * Implements Ping Pong example between local and remote node. */ def pingPong() { - val g = ignite + val g = ignite$ if (g.cluster().nodes().size < 2) { println(">>>") @@ -71,7 +71,7 @@ object ScalarPingPongExample extends App { // Set up local player: configure local node 'loc' // to listen for messages from remote node 'rmt'. - ignite.message().localListen(null, new MessagingListenActor[String]() { + ignite$.message().localListen(null, new MessagingListenActor[String]() { def receive(nodeId: UUID, msg: String) { println(msg) @@ -96,7 +96,7 @@ object ScalarPingPongExample extends App { * Implements Ping Pong example between two remote nodes. */ def pingPong2() { - val g = ignite + val g = ignite$ if (g.cluster().forRemotes().nodes().size() < 2) { println(">>>") http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPrimeExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPrimeExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPrimeExample.scala index 3db6488..c22aced 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPrimeExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarPrimeExample.scala @@ -17,11 +17,11 @@ package org.apache.ignite.scalar.examples +import java.util + import org.apache.ignite.scalar.scalar import org.apache.ignite.scalar.scalar._ -import java.util - import scala.util.control.Breaks._ /** @@ -58,7 +58,7 @@ object ScalarPrimeExample { println(">>>") println(">>> Starting to check the following numbers for primes: " + util.Arrays.toString(checkVals)) - val g = ignite + val g = ignite$ checkVals.foreach(checkVal => { val divisor = g.reduce$[Option[Long], Option[Option[Long]]]( http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarScheduleExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarScheduleExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarScheduleExample.scala index 05fec2c..ecea6f4 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarScheduleExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarScheduleExample.scala @@ -33,12 +33,12 @@ object ScalarScheduleExample extends App { println() println("Compute schedule example started.") - val g = ignite + val g = ignite$ var invocations = 0 // Schedule callable that returns incremented value each time. - val fut = ignite.scheduleLocalCall( + val fut = ignite$.scheduleLocalCall( () => { invocations += 1 http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala index 21c2b95..b4f7124 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala @@ -17,14 +17,14 @@ package org.apache.ignite.scalar.examples +import java.util +import java.util.ConcurrentModificationException + import org.apache.ignite.cache.CacheProjection import org.apache.ignite.scalar.scalar import org.apache.ignite.scalar.scalar._ import org.jdk8.backport.ThreadLocalRandom8 -import java.util -import java.util.ConcurrentModificationException - import scala.collection.JavaConversions._ /** @@ -56,6 +56,12 @@ object ScalarSnowflakeSchemaExample { /** ID generator. */ private[this] val idGen = Stream.from(0).iterator + /** DimStore data. */ + private[this] val dataStore = scala.collection.mutable.Map[Integer, DimStore]() + + /** DimProduct data. */ + private[this] val dataProduct = scala.collection.mutable.Map[Integer, DimProduct]() + /** * Example entry point. No arguments required. */ @@ -66,6 +72,7 @@ object ScalarSnowflakeSchemaExample { cache$(PART_CACHE_NAME).get.globalClearAll(0) populateDimensions() + populateFacts() queryStorePurchases() queryProductPurchases() @@ -77,7 +84,7 @@ object ScalarSnowflakeSchemaExample { * `DimStore` and `DimProduct` instances. */ def populateDimensions() { - val dimCache = ignite.jcache[Int, Object](REPL_CACHE_NAME) + val dimCache = ignite$.jcache[Int, Object](REPL_CACHE_NAME) val store1 = new DimStore(idGen.next(), "Store1", "12345", "321 Chilly Dr, NY") val store2 = new DimStore(idGen.next(), "Store2", "54321", "123 Windy Dr, San Francisco") @@ -86,10 +93,31 @@ object ScalarSnowflakeSchemaExample { dimCache.put(store1.id, store1) dimCache.put(store2.id, store2) + dataStore.put(store1.id, store1) + dataStore.put(store2.id, store2) + for (i <- 1 to 20) { val product = new DimProduct(idGen.next(), "Product" + i, i + 1, (i + 1) * 10) dimCache.put(product.id, product) + + dataProduct.put(product.id, product) + } + } + + /** + * Populate cache with `facts`, which in our case are `FactPurchase` objects. + */ + def populateFacts() { + val dimCache = ignite$.jcache[Int, Object](REPL_CACHE_NAME) + val factCache = ignite$.jcache[Int, FactPurchase](PART_CACHE_NAME) + + for (i <- 1 to 100) { + val store: DimStore = rand(dataStore.values) + val prod: DimProduct = rand(dataProduct.values) + val purchase: FactPurchase = new FactPurchase(idGen.next(), prod.id, store.id, i + 1) + + factCache.put(purchase.id, purchase) } } @@ -99,7 +127,7 @@ object ScalarSnowflakeSchemaExample { * `FactPurchase` objects stored in `partitioned` cache. */ def queryStorePurchases() { - val factCache = ignite.cache[Int, FactPurchase](PART_CACHE_NAME) + val factCache = ignite$.cache[Int, FactPurchase](PART_CACHE_NAME) val storePurchases = factCache.sql( "from \"replicated\".DimStore, \"partitioned\".FactPurchase " + @@ -115,8 +143,8 @@ object ScalarSnowflakeSchemaExample { * stored in `partitioned` cache. */ private def queryProductPurchases() { - val dimCache = ignite.cache[Int, Object](REPL_CACHE_NAME) - val factCache = ignite.cache[Int, FactPurchase](PART_CACHE_NAME) + val dimCache = ignite$.cache[Int, Object](REPL_CACHE_NAME) + val factCache = ignite$.cache[Int, FactPurchase](PART_CACHE_NAME) val prods: CacheProjection[Int, DimProduct] = dimCache.viewByType(classOf[Int], classOf[DimProduct]) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarTaskExample.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarTaskExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarTaskExample.scala index c5a5f4c..4874338 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarTaskExample.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarTaskExample.scala @@ -17,12 +17,12 @@ package org.apache.ignite.scalar.examples +import java.util + import org.apache.ignite.compute.{ComputeJob, ComputeJobResult, ComputeTaskSplitAdapter} import org.apache.ignite.scalar.scalar import org.apache.ignite.scalar.scalar._ -import java.util - import scala.collection.JavaConversions._ /** @@ -36,7 +36,7 @@ import scala.collection.JavaConversions._ */ object ScalarTaskExample extends App { scalar("examples/config/example-compute.xml") { - ignite.compute().execute(classOf[GridHelloWorld], "Hello Cloud World!") + ignite$.compute().execute(classOf[GridHelloWorld], "Hello Cloud World!") } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarWorldShortestMapReduce.scala ---------------------------------------------------------------------- diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarWorldShortestMapReduce.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarWorldShortestMapReduce.scala index ce577ad..77e643d 100644 --- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarWorldShortestMapReduce.scala +++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarWorldShortestMapReduce.scala @@ -33,7 +33,7 @@ object ScalarWorldShortestMapReduce extends App { val input = "World shortest mapreduce application" println("Non-space characters count: " + - ignite.reduce$[Int, Int](for (w <- input.split(" ")) yield () => w.length, _.sum, null) + ignite$.reduce$[Int, Int](for (w <- input.split(" ")) yield () => w.length, _.sum, null) ) } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/test/java/org/apache/ignite/examples/IgniteFsExamplesSelfTest.java ---------------------------------------------------------------------- diff --git a/examples/src/test/java/org/apache/ignite/examples/IgniteFsExamplesSelfTest.java b/examples/src/test/java/org/apache/ignite/examples/IgniteFsExamplesSelfTest.java index 8ac2a5c..f238b32 100644 --- a/examples/src/test/java/org/apache/ignite/examples/IgniteFsExamplesSelfTest.java +++ b/examples/src/test/java/org/apache/ignite/examples/IgniteFsExamplesSelfTest.java @@ -17,7 +17,7 @@ package org.apache.ignite.examples; -import org.apache.ignite.examples.ggfs.*; +import org.apache.ignite.examples.fs.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.testframework.junits.common.*; @@ -25,24 +25,24 @@ import org.apache.ignite.testframework.junits.common.*; * IgniteFs examples self test. */ public class IgniteFsExamplesSelfTest extends GridAbstractExamplesTest { - /** GGFS config with shared memory IPC. */ - private static final String GGFS_SHMEM_CFG = "modules/core/src/test/config/ggfs-shmem.xml"; + /** IgniteFs config with shared memory IPC. */ + private static final String IGNITEFS_SHMEM_CFG = "modules/core/src/test/config/ggfs-shmem.xml"; - /** GGFS config with loopback IPC. */ - private static final String GGFS_LOOPBACK_CFG = "modules/core/src/test/config/ggfs-loopback.xml"; + /** IgniteFs config with loopback IPC. */ + private static final String IGNITEFS_LOOPBACK_CFG = "modules/core/src/test/config/ggfs-loopback.xml"; /** * @throws Exception If failed. */ public void testGgfsApiExample() throws Exception { - String configPath = U.isWindows() ? GGFS_LOOPBACK_CFG : GGFS_SHMEM_CFG; + String configPath = U.isWindows() ? IGNITEFS_LOOPBACK_CFG : IGNITEFS_SHMEM_CFG; try { startGrid("test1", configPath); startGrid("test2", configPath); startGrid("test3", configPath); - GgfsExample.main(EMPTY_ARGS); + IgniteFsExamples.main(EMPTY_ARGS); } finally { stopAllGrids(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/examples/src/test/scala/org/apache/ignite/scalar/testsuites/ScalarExamplesSelfTestSuite.scala ---------------------------------------------------------------------- diff --git a/examples/src/test/scala/org/apache/ignite/scalar/testsuites/ScalarExamplesSelfTestSuite.scala b/examples/src/test/scala/org/apache/ignite/scalar/testsuites/ScalarExamplesSelfTestSuite.scala index 150f196..795c856 100644 --- a/examples/src/test/scala/org/apache/ignite/scalar/testsuites/ScalarExamplesSelfTestSuite.scala +++ b/examples/src/test/scala/org/apache/ignite/scalar/testsuites/ScalarExamplesSelfTestSuite.scala @@ -18,12 +18,12 @@ package org.apache.ignite.scalar.testsuites import org.apache.ignite.IgniteSystemProperties +import org.apache.ignite.IgniteSystemProperties._ import org.apache.ignite.scalar.tests.examples.{ScalarExamplesMultiNodeSelfTest, ScalarExamplesSelfTest} -import org.scalatest._ +import org.apache.ignite.testframework.GridTestUtils import org.junit.runner.RunWith +import org.scalatest._ import org.scalatest.junit.JUnitRunner -import IgniteSystemProperties._ -import org.apache.ignite.testframework.GridTestUtils /** * http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/core/src/main/java/org/apache/ignite/Ignite.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/Ignite.java b/modules/core/src/main/java/org/apache/ignite/Ignite.java index 379cb4d..525b2be 100644 --- a/modules/core/src/main/java/org/apache/ignite/Ignite.java +++ b/modules/core/src/main/java/org/apache/ignite/Ignite.java @@ -317,9 +317,9 @@ public interface Ignite extends AutoCloseable { * The method is invoked automatically on objects managed by the * {@code try-with-resources} statement. * - * @throws IgniteCheckedException If failed to stop grid. + * @throws IgniteException If failed to stop grid. */ - @Override public void close() throws IgniteCheckedException; + @Override public void close() throws IgniteException; /** * Gets affinity service to provide information about data partitioning http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java index c348f51..fabc45b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java @@ -3261,7 +3261,7 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit } /** {@inheritDoc} */ - @Override public void close() throws IgniteCheckedException { + @Override public void close() throws IgniteException { Ignition.stop(gridName, true); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml ---------------------------------------------------------------------- diff --git a/modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml b/modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml index 25f10c6..a406b3f 100644 --- a/modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml +++ b/modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml @@ -33,7 +33,7 @@ </property> <property> - <name>fs.AbstractFileSystem.ggfs.impl</name> + <name>fs.AbstractFileSystem.ignitefs.impl</name> <value>org.apache.ignite.fs.hadoop.v2.GridGgfsHadoopFileSystem</value> </property> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/core/src/test/config/hadoop/core-site-loopback.xml ---------------------------------------------------------------------- diff --git a/modules/core/src/test/config/hadoop/core-site-loopback.xml b/modules/core/src/test/config/hadoop/core-site-loopback.xml index a602e4d..273701f 100644 --- a/modules/core/src/test/config/hadoop/core-site-loopback.xml +++ b/modules/core/src/test/config/hadoop/core-site-loopback.xml @@ -33,7 +33,7 @@ </property> <property> - <name>fs.AbstractFileSystem.ggfs.impl</name> + <name>fs.AbstractFileSystem.ignitefs.impl</name> <value>org.apache.ignite.fs.hadoop.v2.GridGgfsHadoopFileSystem</value> </property> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/core/src/test/config/hadoop/core-site-secondary.xml ---------------------------------------------------------------------- diff --git a/modules/core/src/test/config/hadoop/core-site-secondary.xml b/modules/core/src/test/config/hadoop/core-site-secondary.xml index f65502c..1b5dbb6 100644 --- a/modules/core/src/test/config/hadoop/core-site-secondary.xml +++ b/modules/core/src/test/config/hadoop/core-site-secondary.xml @@ -33,7 +33,7 @@ </property> <property> - <name>fs.AbstractFileSystem.ggfs.impl</name> + <name>fs.AbstractFileSystem.ignitefs.impl</name> <value>org.apache.ignite.fs.hadoop.v2.GridGgfsHadoopFileSystem</value> </property> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/core/src/test/config/hadoop/core-site.xml ---------------------------------------------------------------------- diff --git a/modules/core/src/test/config/hadoop/core-site.xml b/modules/core/src/test/config/hadoop/core-site.xml index 93f9274..e63a7ad 100644 --- a/modules/core/src/test/config/hadoop/core-site.xml +++ b/modules/core/src/test/config/hadoop/core-site.xml @@ -33,7 +33,7 @@ </property> <property> - <name>fs.AbstractFileSystem.ggfs.impl</name> + <name>fs.AbstractFileSystem.ignitefs.impl</name> <value>org.apache.ignite.fs.hadoop.v2.GridGgfsHadoopFileSystem</value> </property> </configuration> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestIgnite.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestIgnite.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestIgnite.java index 7b0ca2d..c65783b 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestIgnite.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestIgnite.java @@ -221,7 +221,7 @@ public class GridTestIgnite implements Ignite { } /** {@inheritDoc} */ - @Override public void close() throws IgniteCheckedException {} + @Override public void close() {} /** {@inheritDoc} */ @Override public <K> CacheAffinity<K> affinity(String cacheName) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/hadoop/src/test/java/org/apache/ignite/fs/GridGgfsHadoopFileSystemAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/fs/GridGgfsHadoopFileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/fs/GridGgfsHadoopFileSystemAbstractSelfTest.java index dced567..f4484df 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/fs/GridGgfsHadoopFileSystemAbstractSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/fs/GridGgfsHadoopFileSystemAbstractSelfTest.java @@ -2349,7 +2349,7 @@ public abstract class GridGgfsHadoopFileSystemAbstractSelfTest extends GridGgfsC cfg.set("fs.defaultFS", "ggfs://" + authority + "/"); cfg.set("fs.ggfs.impl", org.apache.ignite.fs.hadoop.v1.GridGgfsHadoopFileSystem.class.getName()); - cfg.set("fs.AbstractFileSystem.ggfs.impl", + cfg.set("fs.AbstractFileSystem.ignitefs.impl", org.apache.ignite.fs.hadoop.v2.GridGgfsHadoopFileSystem.class.getName()); cfg.setBoolean("fs.ggfs.impl.disable.cache", true); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/hadoop/src/test/java/org/apache/ignite/fs/GridGgfsHadoopFileSystemHandshakeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/fs/GridGgfsHadoopFileSystemHandshakeSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/fs/GridGgfsHadoopFileSystemHandshakeSelfTest.java index 45b3872..8356250 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/fs/GridGgfsHadoopFileSystemHandshakeSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/fs/GridGgfsHadoopFileSystemHandshakeSelfTest.java @@ -298,7 +298,7 @@ public class GridGgfsHadoopFileSystemHandshakeSelfTest extends GridGgfsCommonAbs cfg.set("fs.defaultFS", "ggfs://" + authority + "/"); cfg.set("fs.ggfs.impl", org.apache.ignite.fs.hadoop.v1.GridGgfsHadoopFileSystem.class.getName()); - cfg.set("fs.AbstractFileSystem.ggfs.impl", + cfg.set("fs.AbstractFileSystem.ignitefs.impl", org.apache.ignite.fs.hadoop.v2.GridGgfsHadoopFileSystem.class.getName()); cfg.setBoolean("fs.ggfs.impl.disable.cache", true); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopAbstractSelfTest.java index ff7b487..acfc6af 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopAbstractSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopAbstractSelfTest.java @@ -195,7 +195,7 @@ public abstract class GridHadoopAbstractSelfTest extends GridCommonAbstractTest protected void setupFileSystems(Configuration cfg) { cfg.set("fs.defaultFS", ggfsScheme()); cfg.set("fs.ggfs.impl", org.apache.ignite.fs.hadoop.v1.GridGgfsHadoopFileSystem.class.getName()); - cfg.set("fs.AbstractFileSystem.ggfs.impl", org.apache.ignite.fs.hadoop.v2.GridGgfsHadoopFileSystem. + cfg.set("fs.AbstractFileSystem.ignitefs.impl", org.apache.ignite.fs.hadoop.v2.GridGgfsHadoopFileSystem. class.getName()); GridHadoopFileSystemsUtils.setupFileSystems(cfg); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopStartup.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopStartup.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopStartup.java index 7f3fc46..a5626cb 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopStartup.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopStartup.java @@ -42,7 +42,7 @@ public class GridHadoopStartup { cfg.set("fs.defaultFS", "ggfs://ggfs@localhost"); cfg.set("fs.ggfs.impl", org.apache.ignite.fs.hadoop.v1.GridGgfsHadoopFileSystem.class.getName()); - cfg.set("fs.AbstractFileSystem.ggfs.impl", org.apache.ignite.fs.hadoop.v2.GridGgfsHadoopFileSystem.class.getName()); + cfg.set("fs.AbstractFileSystem.ignitefs.impl", org.apache.ignite.fs.hadoop.v2.GridGgfsHadoopFileSystem.class.getName()); cfg.set("dfs.client.block.write.replace-datanode-on-failure.policy", "NEVER"); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala ---------------------------------------------------------------------- diff --git a/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala b/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala index 24fdddb..f7687ce 100644 --- a/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala +++ b/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala @@ -196,7 +196,7 @@ object scalar extends ScalarConversions { * @param body Closure to execute within automatically managed default grid instance. */ def apply(body: Ignite => Unit) { - if (!isStarted) init(Ignition.start, body) else body(ignite) + if (!isStarted) init(Ignition.start, body) else body(ignite$) } /** @@ -207,7 +207,7 @@ object scalar extends ScalarConversions { * @param body Closure to execute within automatically managed default grid instance. */ def apply[T](body: Ignite => T): T = - if (!isStarted) init(Ignition.start, body) else body(ignite) + if (!isStarted) init(Ignition.start, body) else body(ignite$) /** * Executes given closure within automatically managed default grid instance. @@ -300,7 +300,7 @@ object scalar extends ScalarConversions { @inline def dataLoader$[K, V]( @Nullable cacheName: String, bufSize: Int): IgniteDataLoader[K, V] = { - val dl = ignite.dataLoader[K, V](cacheName) + val dl = ignite$.dataLoader[K, V](cacheName) dl.perNodeBufferSize(bufSize) @@ -310,7 +310,7 @@ object scalar extends ScalarConversions { /** * Gets default grid instance. */ - @inline def ignite: Ignite = Ignition.ignite + @inline def ignite$: Ignite = Ignition.ignite /** * Gets node ID as ID8 string. @@ -423,7 +423,7 @@ object scalar extends ScalarConversions { * @return Started grid. */ def start(): Ignite = { - if (!isStarted) Ignition.start else ignite + if (!isStarted) Ignition.start else ignite$ } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarAffinityRoutingSpec.scala ---------------------------------------------------------------------- diff --git a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarAffinityRoutingSpec.scala b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarAffinityRoutingSpec.scala index 23dab0e..6a71f54 100644 --- a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarAffinityRoutingSpec.scala +++ b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarAffinityRoutingSpec.scala @@ -40,9 +40,9 @@ class ScalarAffinityRoutingSpec extends FlatSpec with ShouldMatchers with Before val cnt = c.dataStructures().atomicLong("affinityRun", 0, true) - ignite.affinityRun$(CACHE_NAME, 0, () => { cnt.incrementAndGet() }, null) - ignite.affinityRun$(CACHE_NAME, 1, () => { cnt.incrementAndGet() }, null) - ignite.affinityRun$(CACHE_NAME, 2, () => { cnt.incrementAndGet() }, null) + ignite$.affinityRun$(CACHE_NAME, 0, () => { cnt.incrementAndGet() }, null) + ignite$.affinityRun$(CACHE_NAME, 1, () => { cnt.incrementAndGet() }, null) + ignite$.affinityRun$(CACHE_NAME, 2, () => { cnt.incrementAndGet() }, null) assert(cnt.get === 3) } @@ -56,9 +56,9 @@ class ScalarAffinityRoutingSpec extends FlatSpec with ShouldMatchers with Before val cnt = c.dataStructures().atomicLong("affinityRunAsync", 0, true) - ignite.affinityRunAsync$(CACHE_NAME, 0, () => { cnt.incrementAndGet() }, null).get - ignite.affinityRunAsync$(CACHE_NAME, 1, () => { cnt.incrementAndGet() }, null).get - ignite.affinityRunAsync$(CACHE_NAME, 2, () => { cnt.incrementAndGet() }, null).get + ignite$.affinityRunAsync$(CACHE_NAME, 0, () => { cnt.incrementAndGet() }, null).get + ignite$.affinityRunAsync$(CACHE_NAME, 1, () => { cnt.incrementAndGet() }, null).get + ignite$.affinityRunAsync$(CACHE_NAME, 2, () => { cnt.incrementAndGet() }, null).get assert(cnt.get === 3) } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheProjectionSpec.scala ---------------------------------------------------------------------- diff --git a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheProjectionSpec.scala b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheProjectionSpec.scala index a034d81..c88b5ea 100644 --- a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheProjectionSpec.scala +++ b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheProjectionSpec.scala @@ -31,7 +31,7 @@ class ScalarCacheProjectionSpec extends FlatSpec { behavior of "Cache projection" it should "work properly via grid.cache(...).viewByType(...)" in scalar("examples/config/example-cache.xml") { - val cache = ignite.cache("local").viewByType(classOf[String], classOf[Int]) + val cache = ignite$.cache("local").viewByType(classOf[String], classOf[Int]) assert(cache.putx("1", 1)) assert(cache.get("1") == 1) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheSpec.scala ---------------------------------------------------------------------- diff --git a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheSpec.scala b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheSpec.scala index 2b160a4..2802c14 100644 --- a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheSpec.scala +++ b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheSpec.scala @@ -54,7 +54,7 @@ class ScalarCacheSpec extends FlatSpec with ShouldMatchers { * so we can actually see what happens underneath locally and remotely. */ def registerListener() { - val g = ignite + val g = ignite$ g *< (() => { val lsnr = new IgnitePredicate[IgniteEvent]() { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a26d960/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java b/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java index cb951d6..89350ab 100644 --- a/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java +++ b/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java @@ -320,7 +320,7 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea } /** {@inheritDoc} */ - @Override public void close() throws IgniteCheckedException { + @Override public void close() throws IgniteException { g.close(); }