ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/2] ignite git commit: tmp
Date Fri, 10 Feb 2017 12:55:37 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3477-compact2 fdba3da57 -> 8ad7c8cd6


tmp


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

Branch: refs/heads/ignite-3477-compact2
Commit: a41776824d1f136ebd68c539715e07c798fdc13d
Parents: fdba3da
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Feb 10 15:55:00 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Feb 10 15:55:00 2017 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |  5 +++--
 .../cache/database/tree/io/DataPageIO.java      | 23 ++++++++++++--------
 2 files changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a4177682/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index c74e053..4a010b7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -1141,13 +1141,14 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                             String id = U.id8(localNode().id());
 
                             double cnt = DataPageIO.cnt.sumThenReset();
-                            double found = DataPageIO.foundCnt.sumThenReset();
+                            double found1 = DataPageIO.foundCnt1.sumThenReset();
+                            double found2 = DataPageIO.foundCnt2.sumThenReset();
 
                             String msg = NL +
                                 "Metrics for local node (to disable set 'metricsLogFrequency'
to 0)" + NL +
                                 "    ^-- Node [id=" + id + ", name=" + name() + ", uptime="
+ getUpTimeFormatted() + "]" + NL +
                                 "    ^-- H/N/C [hosts=" + hosts + ", nodes=" + nodes + ",
CPUs=" + cpus + "]" + NL +
-                                "    ^-- cnt=" + cnt + ", precent=" + found / cnt * 100 +
NL +
+                                "    ^-- cnt=" + cnt + ", p1=" + (found1 / cnt * 100) + ",
p2=" + (found2 / cnt * 100) + NL +
                                 "    ^-- CPU [cur=" + dblFmt.format(cpuLoadPct) + "%, avg="
+
                                 dblFmt.format(avgCpuLoadPct) + "%, GC=" + dblFmt.format(gcPct)
+ "%]" + NL +
                                 "    ^-- PageMemory [pages=" + (pageMem != null ? pageMem.loadedPages()
: 0) + "]" + NL +

http://git-wip-us.apache.org/repos/asf/ignite/blob/a4177682/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
index 4abce08..6fce943 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
@@ -1269,7 +1269,8 @@ public class DataPageIO extends PageIO {
     }
 
     public final static LongAdder8 cnt = new LongAdder8();
-    public final static LongAdder8 foundCnt = new LongAdder8();
+    public final static LongAdder8 foundCnt1 = new LongAdder8();
+    public final static LongAdder8 foundCnt2 = new LongAdder8();
 
     /**
      * @param pageAddr Page address.
@@ -1289,7 +1290,7 @@ public class DataPageIO extends PageIO {
 
         int rmvdCnt = getRemovedCount(pageAddr);
 
-        Boolean canAddItem = null;
+        boolean canAddItem = false;
 
         if (rmvdCnt > 0 && row != null) {
             canAddItem = canAddItem(pageAddr, directCnt, indirectCnt, getFirstEntryOffset(pageAddr));
@@ -1308,7 +1309,7 @@ public class DataPageIO extends PageIO {
                         assert size >= 0 && size < pageSize : size;
 
                         if (size >= newEntrySize) {
-                            foundCnt.increment();
+                            foundCnt1.increment();
 
                             int newEntryOff = rmvdItem >>> 16;
 
@@ -1356,8 +1357,8 @@ public class DataPageIO extends PageIO {
                     rmvdItemOff += REMOVED_ITEM_SIZE;
                 }
             }
-
-            row = null;
+            else
+                row = null;
         }
 
         int[] offs = new int[directCnt];
@@ -1374,9 +1375,7 @@ public class DataPageIO extends PageIO {
 
         Arrays.sort(offs);
 
-        if (row != null) {
-            if (canAddItem == null)
-                canAddItem = canAddItem(pageAddr, directCnt, indirectCnt, getFirstEntryOffset(pageAddr));
+        if (row != null && rmvdCnt == 0) {
 //            boolean canAddItem = false;
 //
 //            if (indirectCnt > 0) {
@@ -1390,6 +1389,7 @@ public class DataPageIO extends PageIO {
 //                int firstOff = offs[0] >>> 8;
 //                canAddItem = firstOff > (directCnt + indirectCnt) * ITEM_SIZE + ITEMS_OFF
+ ITEM_SIZE;
 //            }
+            canAddItem = canAddItem(pageAddr, directCnt, indirectCnt, getFirstEntryOffset(pageAddr));
 
             if (!canAddItem)
                 row = null;
@@ -1452,7 +1452,9 @@ public class DataPageIO extends PageIO {
             if (delta != 0) { // Move right.
                 assert delta > 0 : delta;
 
-                if (false && row != null && delta >= newEntrySize) {
+                if (row != null && delta >= newEntrySize) {
+                    foundCnt2.increment();
+
                     int newEntryOff = curOff + curEntrySize;
 
                     writeRowData(pageAddr, newEntryOff, newEntrySize - ITEM_SIZE - PAYLOAD_LEN_SIZE,
row, true);
@@ -1469,6 +1471,9 @@ public class DataPageIO extends PageIO {
 
                     setLink(row, pageAddr, itemId);
 
+                    if (rmvdCnt > 0)
+                        clearRemoved(pageAddr);
+
                     return 0;
                 }
 


Mime
View raw message