Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-651 00c934cc3 -> 685209c6e


IGNITE-651 - Persistance for marshaller cache


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

Branch: refs/heads/ignite-651
Commit: 685209c6e360dc8299e9e5b3227e8e9a7929898b
Parents: 00c934c
Author: Valentin Kulichenko <vkuliche...@gridgain.com>
Authored: Tue Mar 31 15:37:24 2015 -0700
Committer: Valentin Kulichenko <vkuliche...@gridgain.com>
Committed: Tue Mar 31 15:37:24 2015 -0700

----------------------------------------------------------------------
 .../ignite/internal/MarshallerContextImpl.java  | 31 ++++----------------
 ...ridCacheContinuousQueryAbstractSelfTest.java |  2 +-
 2 files changed, 6 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/685209c6/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
index d5a0526..4a27222 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
@@ -23,7 +23,6 @@ import org.apache.ignite.internal.util.typedef.internal.*;
 
 import javax.cache.event.*;
 import java.io.*;
-import java.nio.channels.*;
 import java.util.concurrent.*;
 
 /**
@@ -125,18 +124,8 @@ public class MarshallerContextImpl extends 
MarshallerContextAdapter {
         if (clsName == null) {
             File file = new File(workDir, id + ".classname");
 
-            try (
-                FileInputStream in = new FileInputStream(file);
-                BufferedReader reader = new BufferedReader(new 
InputStreamReader(in))
-            ) {
-                FileLock lock = in.getChannel().lock(0, Long.MAX_VALUE, true);
-
-                try {
-                    clsName = reader.readLine();
-                }
-                finally {
-                    lock.release();
-                }
+            try (BufferedReader reader = new BufferedReader(new 
FileReader(file))) {
+                clsName = reader.readLine();
             }
             catch (IOException e) {
                 throw new IgniteCheckedException("Failed to read class name 
from file [id=" + id +
@@ -173,20 +162,10 @@ public class MarshallerContextImpl extends 
MarshallerContextAdapter {
 
                 File file = new File(workDir, evt.getKey() + ".classname");
 
-                try (
-                    FileOutputStream out = new FileOutputStream(file);
-                    Writer writer = new OutputStreamWriter(out)
-                ) {
-                    FileLock lock  = out.getChannel().lock();
-
-                    try {
-                        writer.write(evt.getValue());
+                try (Writer writer = new FileWriter(file)) {
+                    writer.write(evt.getValue());
 
-                        writer.flush();
-                    }
-                    finally {
-                        lock.release();
-                    }
+                    writer.flush();
                 }
                 catch (IOException e) {
                     U.error(log, "Failed to write class name to file [id=" + 
evt.getKey() +

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/685209c6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index 27bb4e4..a22e0c7 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -174,7 +174,7 @@ public abstract class 
GridCacheContinuousQueryAbstractSelfTest extends GridCommo
         for (int i = 0; i < gridCount(); i++) {
             GridContinuousProcessor proc = grid(i).context().continuous();
 
-            assertEquals(String.valueOf(i), 2, ((Map)U.field(proc, 
"locInfos")).size());
+            assertEquals(String.valueOf(i), 3, ((Map)U.field(proc, 
"locInfos")).size());
             assertEquals(String.valueOf(i), 0, ((Map)U.field(proc, 
"rmtInfos")).size());
             assertEquals(String.valueOf(i), 0, ((Map)U.field(proc, 
"startFuts")).size());
             assertEquals(String.valueOf(i), 0, ((Map)U.field(proc, 
"waitForStartAck")).size());

Reply via email to