ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [28/50] [abbrv] ignite git commit: WIP
Date Wed, 07 Sep 2016 11:17:13 GMT
WIP


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

Branch: refs/heads/ignite-2649
Commit: 4dc629429ef88488c889176ee2b26fd888442c5c
Parents: 629b75e
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Sep 7 12:15:15 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Sep 7 12:15:15 2016 +0300

----------------------------------------------------------------------
 .../spi/checkpoint/sharedfs/SharedFsCheckpointSpi.java   |  6 +++---
 .../spi/checkpoint/sharedfs/SharedFsTimeoutTask.java     | 10 ++--------
 .../ignite/spi/checkpoint/sharedfs/SharedFsUtils.java    | 11 ++++-------
 .../ignite/spi/swapspace/file/FileSwapSpaceSpi.java      |  1 -
 .../ignite/stream/socket/SocketStreamerSelfTest.java     |  4 ++--
 5 files changed, 11 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4dc62942/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsCheckpointSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsCheckpointSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsCheckpointSpi.java
index c5a8c4c..efb5b99 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsCheckpointSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsCheckpointSpi.java
@@ -326,7 +326,7 @@ public class SharedFsCheckpointSpi extends IgniteSpiAdapter implements
Checkpoin
                         log.debug("Checking checkpoint file: " + file.getAbsolutePath());
 
                     try {
-                        SharedFsCheckpointData data = SharedFsUtils.read(file, marsh, log,
ignite.configuration());
+                        SharedFsCheckpointData data = SharedFsUtils.read(file, marsh, log);
 
                         if (data.getHost().equals(host)) {
                             files.put(file, new SharedFsTimeData(data.getExpireTime(), file.lastModified(),
@@ -389,7 +389,7 @@ public class SharedFsCheckpointSpi extends IgniteSpiAdapter implements
Checkpoin
 
         if (file.exists())
             try {
-                SharedFsCheckpointData data = SharedFsUtils.read(file, marsh, log, ignite.configuration());
+                SharedFsCheckpointData data = SharedFsUtils.read(file, marsh, log);
 
                 return data != null ?
                     data.getExpireTime() == 0 || data.getExpireTime() > U.currentTimeMillis()
?
@@ -437,7 +437,7 @@ public class SharedFsCheckpointSpi extends IgniteSpiAdapter implements
Checkpoin
 
             try {
                 SharedFsUtils.write(file, new SharedFsCheckpointData(state, expireTime, host,
key),
-                    marsh, log, ignite.configuration());
+                    marsh, log);
             }
             catch (IOException e) {
                 // Select next shared directory if exists, otherwise throw exception

http://git-wip-us.apache.org/repos/asf/ignite/blob/4dc62942/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsTimeoutTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsTimeoutTask.java
b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsTimeoutTask.java
index 07619c0..3cf11f8 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsTimeoutTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsTimeoutTask.java
@@ -25,7 +25,6 @@ import java.util.HashSet;
 import java.util.Map;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
-import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.marshaller.Marshaller;
@@ -117,13 +116,8 @@ class SharedFsTimeoutTask extends IgniteSpiThread {
                     SharedFsTimeData timeData = entry.getValue();
 
                     try {
-                        if (timeData.getLastAccessTime() != file.lastModified()) {
-                            final IgniteConfiguration igniteCfg = new IgniteConfiguration();
-
-                            igniteCfg.setGridName(getGridName());
-
-                            timeData.setExpireTime(SharedFsUtils.read(file, marshaller, log,
igniteCfg).getExpireTime());
-                        }
+                        if (timeData.getLastAccessTime() != file.lastModified())
+                            timeData.setExpireTime(SharedFsUtils.read(file, marshaller, log).getExpireTime());
                     }
                     catch (IgniteCheckedException e) {
                         U.error(log, "Failed to marshal/unmarshal in checkpoint file: " +
file.getAbsolutePath(), e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/4dc62942/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsUtils.java
b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsUtils.java
index e16f6ca..b1698fa 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsUtils.java
@@ -25,10 +25,8 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
-import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.marshaller.Marshaller;
-import org.apache.ignite.marshaller.MarshallerUtils;
 
 /**
  * Utility class that helps to manage files. It provides read/write
@@ -54,7 +52,7 @@ final class SharedFsUtils {
      *    to {@link SharedFsCheckpointData} object.
      * @throws IOException Thrown if file read error occurred.
      */
-    static SharedFsCheckpointData read(File file, Marshaller m, IgniteLogger log, final IgniteConfiguration
igniteCfg)
+    static SharedFsCheckpointData read(File file, Marshaller m, IgniteLogger log)
         throws IOException, IgniteCheckedException {
         assert file != null;
         assert m != null;
@@ -63,7 +61,7 @@ final class SharedFsUtils {
         InputStream in = new FileInputStream(file);
 
         try {
-            return (SharedFsCheckpointData) MarshallerUtils.unmarshal(igniteCfg.getGridName(),
m, in, U.gridClassLoader());
+            return (SharedFsCheckpointData)m.unmarshal(in, U.gridClassLoader());
         }
         finally {
             U.close(in, log);
@@ -78,12 +76,11 @@ final class SharedFsUtils {
      * @param data Checkpoint data.
      * @param m Grid marshaller.
      * @param log Messages logger.
-     * @param igniteCfg Ignite config.
      * @throws IgniteCheckedException Thrown if data could not be marshalled.
      * @throws IOException Thrown if file write operation failed.
      */
-    static void write(File file, SharedFsCheckpointData data, Marshaller m, IgniteLogger
log,
-        final IgniteConfiguration igniteCfg) throws IOException, IgniteCheckedException {
+    static void write(File file, SharedFsCheckpointData data, Marshaller m, IgniteLogger
log)
+        throws IOException, IgniteCheckedException {
         assert file != null;
         assert m != null;
         assert data != null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/4dc62942/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
index 10fd9b8..df35ed3 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
@@ -57,7 +57,6 @@ import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiInClosure;
 import org.apache.ignite.lang.IgniteInClosure;
-import org.apache.ignite.marshaller.MarshallerUtils;
 import org.apache.ignite.resources.LoggerResource;
 import org.apache.ignite.spi.IgniteSpiAdapter;
 import org.apache.ignite.spi.IgniteSpiCloseableIterator;

http://git-wip-us.apache.org/repos/asf/ignite/blob/4dc62942/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java
index a59ebea..1056990 100644
--- a/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerSelfTest.java
@@ -169,7 +169,7 @@ public class SocketStreamerSelfTest extends GridCommonAbstractTest {
      */
     public void testSizeBasedCustomConverter() throws Exception {
         SocketMessageConverter<Message> converter = new SocketMessageConverter<Message>()
{
-            @Override public Message convert(byte[] msg, String gridName) {
+            @Override public Message convert(byte[] msg) {
                 int i = (msg[0] & 0xFF) << 24;
                 i |= (msg[1] & 0xFF) << 16;
                 i |= (msg[2] & 0xFF) << 8;
@@ -233,7 +233,7 @@ public class SocketStreamerSelfTest extends GridCommonAbstractTest {
      */
     public void testDelimiterBasedCustomConverter() throws Exception {
         SocketMessageConverter<Message> converter = new SocketMessageConverter<Message>()
{
-            @Override public Message convert(byte[] msg, String gridName) {
+            @Override public Message convert(byte[] msg) {
                 int i = (msg[0] & 0xFF) << 24;
                 i |= (msg[1] & 0xFF) << 16;
                 i |= (msg[2] & 0xFF) << 8;


Mime
View raw message