You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/01/13 13:14:23 UTC
[7/9] ignite git commit: Fixed lazy search row.
Fixed lazy search row.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0c57ede3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0c57ede3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0c57ede3
Branch: refs/heads/ignite-gg-11810-1
Commit: 0c57ede37682d8526ff9aeca47be2cd1c74f0f15
Parents: 9901183
Author: sboikov <sb...@gridgain.com>
Authored: Fri Jan 13 14:38:00 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jan 13 14:38:00 2017 +0300
----------------------------------------------------------------------
.../cache/IgniteCacheOffheapManagerImpl.java | 44 +++-----------------
1 file changed, 5 insertions(+), 39 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0c57ede3/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 3a68b81..3cf42e1 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
@@ -1074,41 +1074,6 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter imple
/**
*
*/
- private static class LinkSearchRow implements CacheSearchRow {
- /** */
- private final int hash;
-
- /** */
- private final long link;
-
- /**
- * @param hash Key hash code.
- * @param link Link.
- */
- LinkSearchRow(int hash, long link) {
- this.hash = hash;
- this.link = link;
- }
-
- /** {@inheritDoc} */
- @Override public KeyCacheObject key() {
- throw new UnsupportedOperationException();
- }
-
- /** {@inheritDoc} */
- @Override public long link() {
- return link;
- }
-
- /** {@inheritDoc} */
- @Override public int hash() {
- return hash;
- }
- }
-
- /**
- *
- */
private class DataRow extends CacheDataRowAdapter {
/** */
protected int part = -1;
@@ -1119,8 +1084,9 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter imple
/**
* @param hash Hash code.
* @param link Link.
+ * @param keyOnly If {@code true} initializes only key.
*/
- DataRow(int hash, long link) {
+ DataRow(int hash, long link, boolean keyOnly) {
super(link);
this.hash = hash;
@@ -1129,7 +1095,7 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter imple
try {
// We can not init data row lazily because underlying buffer can be concurrently cleared.
- initFromLink(cctx, false);
+ initFromLink(cctx, keyOnly);
}
catch (IgniteCheckedException e) {
throw new IgniteException(e);
@@ -1324,7 +1290,7 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter imple
* @return Search row.
*/
private CacheSearchRow keySearchRow(int hash, long link) {
- return new LinkSearchRow(hash, link);
+ return new DataRow(hash, link, true);
}
/**
@@ -1333,7 +1299,7 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter imple
* @return Data row.
*/
private CacheDataRow dataRow(int hash, long link) {
- return new DataRow(hash, link);
+ return new DataRow(hash, link, false);
}
}