ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject incubator-ignite git commit: # GG-6107 WIP.
Date Mon, 13 Apr 2015 16:43:10 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-gg-6107 [created] 888eeae19


# GG-6107 WIP.


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

Branch: refs/heads/ignite-gg-6107
Commit: 888eeae197765ace700ef9505bd6188aa38dc353
Parents: d9f8970
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Mon Apr 13 23:42:55 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Mon Apr 13 23:42:55 2015 +0700

----------------------------------------------------------------------
 .../ignite/internal/visor/igfs/VisorIgfsProfiler.java   | 10 +++++++---
 .../internal/visor/igfs/VisorIgfsProfilerEntry.java     | 12 ++++++++++++
 .../internal/visor/igfs/VisorIgfsProfilerTask.java      | 10 ++++++++--
 3 files changed, 27 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/888eeae1/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
index 173c439..c56577f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
@@ -41,10 +41,14 @@ public class VisorIgfsProfiler {
     public static VisorIgfsProfilerEntry aggregateIgfsProfilerEntries(List<VisorIgfsProfilerEntry>
entries) {
         assert !F.isEmpty(entries);
 
+        VisorIgfsProfilerEntry first = entries.get(0);
+
         if (entries.size() == 1)
-            return entries.get(0); // No need to aggregate.
+            return first; // No need to aggregate.
         else {
-            String path = entries.get(0).path();
+            String path = first.path();
+
+            long threadId = first.threadId();
 
             Collections.sort(entries, VisorIgfsProfilerEntry.ENTRY_TIMESTAMP_COMPARATOR);
 
@@ -80,7 +84,7 @@ public class VisorIgfsProfiler {
                 counters.aggregate(entry.counters());
             }
 
-            return new VisorIgfsProfilerEntry(path, ts, mode, size, bytesRead, readTime,
userReadTime,
+            return new VisorIgfsProfilerEntry(path, ts, threadId, mode, size, bytesRead,
readTime, userReadTime,
                 bytesWritten, writeTime, userWriteTime, counters);
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/888eeae1/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
index bf1a75d..5122bfc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
@@ -44,6 +44,9 @@ public class VisorIgfsProfilerEntry implements Serializable {
     /** Timestamp of last file operation. */
     private final long ts;
 
+    /** Thread ID that worked with file. */
+    private final long threadId;
+
     /** IGFS mode. */
     private final IgfsMode mode;
 
@@ -84,6 +87,7 @@ public class VisorIgfsProfilerEntry implements Serializable {
     public VisorIgfsProfilerEntry(
         String path,
         long ts,
+        long threadId,
         IgfsMode mode,
         long size,
         long bytesRead,
@@ -98,6 +102,7 @@ public class VisorIgfsProfilerEntry implements Serializable {
 
         this.path = path;
         this.ts = ts;
+        this.threadId = threadId;
         this.mode = mode;
         this.size = size;
         this.bytesRead = bytesRead;
@@ -145,6 +150,13 @@ public class VisorIgfsProfilerEntry implements Serializable {
     }
 
     /**
+     * @return Thread ID.
+     */
+    public long threadId() {
+        return threadId;
+    }
+
+    /**
      * @return IGFS mode.
      */
     public IgfsMode mode() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/888eeae1/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
index f750ab3..928f1a3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
@@ -47,6 +47,8 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<V
         /** Timestamp. */
         private final long ts;
 
+        private final long threadId;
+
         /** Log entry type. */
         private final int entryType;
 
@@ -82,6 +84,7 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<V
          */
         private VisorIgfsProfilerParsedLine(
             long ts,
+            long threadId,
             int entryType,
             String path,
             IgfsMode mode,
@@ -94,6 +97,7 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<V
             long totalBytes
         ) {
             this.ts = ts;
+            this.threadId = threadId;
             this.entryType = entryType;
             this.path = path;
             this.mode = mode;
@@ -178,8 +182,8 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String,
Collection<V
 
                 if (logsDir != null)
                     return parse(logsDir, arg);
-                else
-                    return Collections.emptyList();
+
+                return Collections.emptyList();
             }
             catch (IOException | IllegalArgumentException e) {
                 throw new IgniteException("Failed to parse profiler logs for IGFS: " + arg,
e);
@@ -290,6 +294,7 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String,
Collection<V
                 if (LOG_TYPES.contains(entryType))
                     return new VisorIgfsProfilerParsedLine(
                         parseLong(ss, LOG_COL_TIMESTAMP, 0),
+                        parseLong(ss, LOG_COL_THREAD_ID, 0),
                         entryType,
                         parseString(ss, LOG_COL_PATH),
                         parseIgfsMode(ss, LOG_COL_IGFS_MODE),
@@ -384,6 +389,7 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String,
Collection<V
                 new VisorIgfsProfilerEntry(
                     path,
                     ts,
+                    0, // TODO GG-6107
                     mode,
                     size,
                     bytesRead,


Mime
View raw message