ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: 630
Date Wed, 13 May 2015 09:09:02 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-630-tests 845efeba7 -> 19d7be89e


630


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

Branch: refs/heads/ignite-630-tests
Commit: 19d7be89e03c7d2b8fced47a6da72538f5cd7cfb
Parents: 845efeb
Author: avinogradov <avinogradov@gridgain.com>
Authored: Wed May 13 12:08:54 2015 +0300
Committer: avinogradov <avinogradov@gridgain.com>
Committed: Wed May 13 12:08:54 2015 +0300

----------------------------------------------------------------------
 .../util/lang/GridMetadataAwareAdapter.java     | 27 ++++++++++++++++++++
 1 file changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/19d7be89/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridMetadataAwareAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridMetadataAwareAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridMetadataAwareAdapter.java
index 917dbcc..0881348 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridMetadataAwareAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridMetadataAwareAdapter.java
@@ -24,6 +24,7 @@ import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
 
 import java.io.*;
+import java.text.*;
 import java.util.*;
 import java.util.concurrent.*;
 
@@ -77,6 +78,10 @@ public class GridMetadataAwareAdapter {
     @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"})
     private GridMutex mux;
 
+    private static long[] cntrA = new long[4];
+
+    private static long[] cntrG = new long[4];
+
     /**
      * Default constructor.
      */
@@ -136,6 +141,17 @@ public class GridMetadataAwareAdapter {
 
             data[key] = val;
 
+            cntrA[key]++;
+
+            SimpleDateFormat sdf = new SimpleDateFormat("HHmm");
+            try (PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("/target/add"
+ sdf.format(new Date().getTime()) + ".txt", true)))) {
+                StackTraceElement[] elements = Thread.currentThread().getStackTrace();
+                out.println((data != null ? data.length : null) + "- " + cntrA[0] + "," +
cntrA[1] + "," + cntrA[2] + "," + cntrA[3] + "             " + key + " " + Arrays.toString(elements));
+            }
+            catch (IOException e) {
+                //exception handling left as an exercise for the reader
+            }
+
             return old;
         }
     }
@@ -152,6 +168,17 @@ public class GridMetadataAwareAdapter {
         A.notNull(key, "key");
 
         synchronized (mux) {
+            cntrG[key]++;
+
+            SimpleDateFormat sdf = new SimpleDateFormat("HHmm");
+            try (PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("/target/get"
+ sdf.format(new Date().getTime()) + ".txt", true)))) {
+                StackTraceElement[] elements = Thread.currentThread().getStackTrace();
+                out.println((data != null ? data.length : null) + "- " + cntrG[0] + "," +
cntrG[1] + "," + cntrG[2] + "," + cntrG[3] + "             " + key + " " + Arrays.toString(elements));
+            }
+            catch (IOException e) {
+                //exception handling left as an exercise for the reader
+            }
+
             return data != null && data.length > key ? (V)data[key] : null;
         }
     }


Mime
View raw message