ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-3477 Optimization for update if value size does not change.
Date Tue, 24 Jan 2017 08:14:41 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3477-1 7a5f09117 -> 89f56cc6d


ignite-3477 Optimization for update if value size does not change.


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

Branch: refs/heads/ignite-3477-1
Commit: 89f56cc6d4fcfbdb39996c4f0ea0a06568de411c
Parents: 7a5f091
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Jan 24 11:09:18 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Jan 24 11:14:25 2017 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/CacheLazyEntry.java     |  2 +-
 .../internal/processors/cache/GridCacheMapEntry.java  |  4 ++--
 .../cache/IgniteCacheOffheapManagerImpl.java          |  7 +++++--
 .../cache/distributed/dht/GridDhtCacheEntry.java      |  4 ++--
 .../cache/distributed/dht/GridDhtLocalPartition.java  | 14 ++------------
 5 files changed, 12 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/89f56cc6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
index be6019e..a4bb6bc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
@@ -182,7 +182,7 @@ public class CacheLazyEntry<K, V> extends CacheInterceptorEntry<K,
V> {
      *
      * @param updateCntr Update counter.
      */
-    public void updateCounter(Long updateCntr) {
+    public void updateCounter(long updateCntr) {
         this.updateCntr = updateCntr;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/89f56cc6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index b425410..6dc1d04 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -1030,7 +1030,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
 
         CacheLazyEntry entry0 = null;
 
-        Long updateCntr0;
+        long updateCntr0;
 
         boolean deferred;
 
@@ -3022,7 +3022,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
     /**
      * @param cntr Updated partition counter.
      */
-    protected void onUpdateFinished(Long cntr) {
+    protected void onUpdateFinished(long cntr) {
         // No-op.
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/89f56cc6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index a975633..f472735 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@ -937,6 +937,8 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
                 if (canUpdateOldRow(oldRow, dataRow) && rowStore.updateRow(oldRow.link(),
dataRow)) {
                     old = oldRow;
 
+                    dataRow.link(oldRow.link());
+
                     rmvOld = false;
                 }
                 else {
@@ -1030,8 +1032,9 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
         }
 
         /** {@inheritDoc} */
-        @Override public CacheDataRow find(KeyCacheObject key)
-            throws IgniteCheckedException {
+        @Override public CacheDataRow find(KeyCacheObject key) throws IgniteCheckedException
{
+            key.valueBytes(cctx.cacheObjectContext());
+
             return dataTree.findOne(new SearchRow(key));
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/89f56cc6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
index b0ec408..fc78f69 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
@@ -118,8 +118,8 @@ public class GridDhtCacheEntry extends GridDistributedCacheEntry {
     }
 
     /** {@inheritDoc} */
-    @Override protected void onUpdateFinished(Long cntr) {
-        if (cntr != null)
+    @Override protected void onUpdateFinished(long cntr) {
+        if (cctx.shared().database().persistenceEnabled())
             locPart.onUpdateReceived(cntr);
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/89f56cc6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index 8fbd30a..9b30593 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -126,10 +126,10 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
     private final CacheDataStore store;
 
     /** Partition updates. */
-    private ConcurrentNavigableMap<Long, Boolean> updates = new ConcurrentSkipListMap<>();
+    private final ConcurrentNavigableMap<Long, Boolean> updates = new ConcurrentSkipListMap<>();
 
     /** Last applied update. */
-    private AtomicLong lastApplied = new AtomicLong(0);
+    private final AtomicLong lastApplied = new AtomicLong(0);
 
     /** Set if failed to move partition to RENTING state due to reservations, to be checked
when
      * reservation is released. */
@@ -253,16 +253,6 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
     }
 
     /**
-     * @return Last received update.
-     */
-    private long lastReceivedUpdate() {
-        if (updates.isEmpty())
-            return lastApplied.get();
-
-        return updates.lastKey();
-    }
-
-    /**
      * @param cntr Received counter.
      */
     public void onUpdateReceived(long cntr) {


Mime
View raw message