You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/06/09 14:45:07 UTC

[1/4] incubator-ignite git commit: # ignite-sprint-6: DEVNOTES.txt

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-gg-10326 c2326312d -> da27efda7


# ignite-sprint-6: DEVNOTES.txt


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

Branch: refs/heads/ignite-gg-10326
Commit: 57957d9094dbb9b08cc6ae1be074a275e8daffdb
Parents: c232631
Author: ashutak <as...@gridgain.com>
Authored: Mon Jun 8 18:38:09 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Mon Jun 8 18:38:09 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57957d90/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/DEVNOTES.txt b/DEVNOTES.txt
index 1562dc4..8f1730c 100644
--- a/DEVNOTES.txt
+++ b/DEVNOTES.txt
@@ -69,6 +69,13 @@ To test compliance with JCache TCK use:
 
 mvn test -P-release,jcache-tck -pl :ignite-core -am
 
+Run tests
+==========
+To run tests locally use:
+
+mvn clean test -U -Plgpl,examples,-clean-libs,-release -Dmaven.test.failure.ignore=true -DfailIfNoTests=false -Dtest=%TEST_PATTERN%
+
+For example, %TEST_PATTERN% can be 'org.apache.ignite.testsuites.IgniteBasicTestSuite' or 'GridCacheLocalAtomicFullApiSelfTest#testGet'
 
 Apache RAT Instructions
 =======================


[2/4] incubator-ignite git commit: merge from ignite-1000

Posted by vo...@apache.org.
merge from ignite-1000


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

Branch: refs/heads/ignite-gg-10326
Commit: f8a877691181063199a5d476a036dfb428118ea5
Parents: 57957d9
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue Jun 9 09:02:00 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Jun 9 09:02:00 2015 +0300

----------------------------------------------------------------------
 .../cloud/TcpDiscoveryCloudIpFinder.java        | 25 +++++++++++++-------
 .../TcpDiscoveryCloudIpFinderSelfTest.java      |  3 +--
 2 files changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8a87769/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java b/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
index 2637742..7555b16 100644
--- a/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
+++ b/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
@@ -30,6 +30,7 @@ import org.jclouds.*;
 import org.jclouds.compute.*;
 import org.jclouds.compute.domain.*;
 import org.jclouds.domain.*;
+import org.jclouds.googlecloud.*;
 import org.jclouds.location.reference.*;
 
 import java.io.*;
@@ -97,7 +98,7 @@ import java.util.concurrent.atomic.*;
  *                     &lt;bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.cloud.TcpDiscoveryCloudIpFinder"/&gt;
  *                         &lt;property name="provider" value="google-compute-engine"/&gt;
  *                         &lt;property name="identity" value="your_service_account_email"/&gt;
- *                         &lt;property name="credentialPath" value="path_to_pem_file"/&gt;
+ *                         &lt;property name="credentialPath" value="path_to_json_key"/&gt;
  *                         &lt;property name="zones"&gt;
  *                             &lt;list&gt;
  *                                 &lt;value>us-central1-a&lt/value&gt;
@@ -253,8 +254,7 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
     /**
      * Sets the path to a credential that is used during authentication on the cloud.
      *
-     * This method should be used when an access key or private key is stored in a plain or PEM file without
-     * a passphrase.
+     * This method should be used when an access key or private key is stored in a file.
      * Content of the file, referred by @{code credentialPath}, is fully read and used as a access key or private key
      * during authentication.
      *
@@ -322,7 +322,7 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
                     throw new IgniteSpiException("Both credential and credentialPath are set. Use only one method.");
 
                 if (credentialPath != null)
-                    credential = getPrivateKeyFromFile();
+                    credential = getCredentialFromFile();
 
                 try {
                     ContextBuilder ctxBuilder = ContextBuilder.newBuilder(provider);
@@ -398,13 +398,22 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
     }
 
     /**
-     * Retrieves a private key from the secrets file.
+     * Reads credential info from {@link #credentialPath} and returns in a string format.
      *
-     * @return Private key
+     * @return Credential in {@code String} representation.
+     * @throws IgniteSpiException In case of error.
      */
-    private String getPrivateKeyFromFile() throws IgniteSpiException {
+    private String getCredentialFromFile() throws IgniteSpiException {
         try {
-            return Files.toString(new File(credentialPath), Charsets.UTF_8);
+            String fileContents = Files.toString(new File(credentialPath), Charsets.UTF_8);
+
+            if (provider.equals("google-compute-engine")) {
+                Supplier<Credentials> credentialSupplier = new GoogleCredentialsFromJson(fileContents);
+
+                return credentialSupplier.get().credential;
+            }
+
+            return fileContents;
         }
         catch (IOException e) {
             throw new IgniteSpiException("Failed to retrieve the private key from the file: " + credentialPath, e);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8a87769/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java b/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
index aba0760..d1d945f 100644
--- a/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
+++ b/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
@@ -101,9 +101,8 @@ public class TcpDiscoveryCloudIpFinderSelfTest extends
 
         if (provider.equals("google-compute-engine"))
             ipFinder.setCredentialPath(IgniteCloudTestSuite.getSecretKey(provider));
-        else {
+        else
             ipFinder.setCredential(IgniteCloudTestSuite.getSecretKey(provider));
-        }
 
         Collection<InetSocketAddress> addresses = ipFinder.getRegisteredAddresses();
 


[3/4] incubator-ignite git commit: # Minor changes to interop logic.

Posted by vo...@apache.org.
# Minor changes to interop logic.


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

Branch: refs/heads/ignite-gg-10326
Commit: 9bc3f79e930669172dd2d957653f8aaa136ccb3a
Parents: c232631
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Jun 9 12:08:51 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Jun 9 12:08:51 2015 +0300

----------------------------------------------------------------------
 .../internal/interop/InteropIgnition.java       | 52 +++++++++++++++++++-
 .../internal/interop/InteropProcessor.java      |  8 +++
 2 files changed, 58 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9bc3f79e/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
index 3ccd361..d8cc276 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
@@ -35,6 +35,9 @@ import java.util.*;
  */
 @SuppressWarnings("UnusedDeclaration")
 public class InteropIgnition {
+    /** Map with active instances. */
+    private static final HashMap<String, InteropProcessor> instances = new HashMap<>();
+
     /**
      * Start Ignite node in interop mode.
      *
@@ -44,8 +47,8 @@ public class InteropIgnition {
      * @param envPtr Environment pointer.
      * @return Ignite instance.
      */
-    public static InteropProcessor start(@Nullable String springCfgPath, @Nullable String gridName, int factoryId,
-        long envPtr) {
+    public static synchronized InteropProcessor start(@Nullable String springCfgPath, @Nullable String gridName,
+        int factoryId, long envPtr) {
         IgniteConfiguration cfg = configuration(springCfgPath);
 
         if (gridName != null)
@@ -57,10 +60,55 @@ public class InteropIgnition {
 
         trackFinalization(proc);
 
+        InteropProcessor old = instances.put(gridName, proc);
+
+        assert old == null;
+
         return proc;
     }
 
     /**
+     * Get instance by environment pointer.
+     *
+     * @param gridName Grid name.
+     * @return Instance or {@code null} if it doesn't exists (never started or stopped).
+     */
+    @Nullable public static synchronized InteropProcessor instance(@Nullable String gridName) {
+        return instances.get(gridName);
+    }
+
+    /**
+     * Stop single instance.
+     *
+     * @param gridName Grid name,
+     * @param cancel Cancel flag.
+     * @return {@code True} if instance was found and stopped.
+     */
+    public static synchronized boolean stop(@Nullable String gridName, boolean cancel) {
+        if (Ignition.stop(gridName, cancel)) {
+            InteropProcessor old = instances.remove(gridName);
+
+            assert old != null;
+
+            return true;
+        }
+        else
+            return false;
+    }
+
+    /**
+     * Stop all instances.
+     *
+     * @param cancel Cancel flag.
+     */
+    public static synchronized void stopAll(boolean cancel) {
+        for (InteropProcessor proc : instances.values())
+            Ignition.stop(proc.ignite().name(), cancel);
+
+        instances.clear();
+    }
+
+    /**
      * Create configuration.
      *
      * @param springCfgPath Path to Spring XML.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9bc3f79e/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
index aa4f877..325a464 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.interop;
 
+import org.apache.ignite.*;
 import org.jetbrains.annotations.*;
 
 /**
@@ -24,6 +25,13 @@ import org.jetbrains.annotations.*;
  */
 public interface InteropProcessor {
     /**
+     * Get owning Ignite instance.
+     *
+     * @return Ignite instance.
+     */
+    public Ignite ignite();
+
+    /**
      * Get stop runnable to perform cleanup when interop is not longer used.
      * <p/>
      * <b>NOTE!</b> This runnable is called when current instance of interop processor is eligible for garbage


[4/4] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-sprint-6

Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-sprint-6


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

Branch: refs/heads/ignite-gg-10326
Commit: da27efda7f6a6b03dd2435aa41ba5e52925b256d
Parents: 9bc3f79 f8a8776
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Jun 9 12:10:11 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Jun 9 12:10:11 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                                    |  7 ++++++
 .../cloud/TcpDiscoveryCloudIpFinder.java        | 25 +++++++++++++-------
 .../TcpDiscoveryCloudIpFinderSelfTest.java      |  3 +--
 3 files changed, 25 insertions(+), 10 deletions(-)
----------------------------------------------------------------------