ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [30/50] ignite git commit: Skipping lines that go before 'from' parameter of REST log request
Date Thu, 28 Jan 2016 07:37:30 GMT
Skipping lines that go before 'from' parameter of REST log request


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

Branch: refs/heads/ignite-2324
Commit: eb78b2ab1579149cfac72eeb6f80836ee84acb36
Parents: 7fcd6fc
Author: Denis Magda <dmagda@gridgain.com>
Authored: Fri Jan 22 10:40:04 2016 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Fri Jan 22 10:40:04 2016 +0300

----------------------------------------------------------------------
 .../processors/rest/handlers/log/GridLogCommandHandler.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/eb78b2ab/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
index 2f8529d..4957993 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
@@ -161,10 +161,13 @@ public class GridLogCommandHandler extends GridRestCommandHandlerAdapter
{
         try (BufferedReader reader =  new BufferedReader(new FileReader(logFile))) {
             String line;
 
-            while (from <= to && (line = reader.readLine()) != null) {
-                content.append(line);
+            int start = 0;
 
-                from++;
+            while (start <= to && (line = reader.readLine()) != null) {
+                if (start >= from)
+                    content.append(line);
+
+                start++;
             }
         }
         catch (IOException e) {


Mime
View raw message