/** * Check whether this worker owns particular key. * * @param key Key. * @return {@code True} in case this worker should process this key. */ protected boolean owns(KeyCacheObject key) { assert key != null; // Avoid hash code and remainder calculation in case there is no actual split. return totalCnt == 1 || key.hashCode() % totalCnt == id; }
/** {@inheritDoc} */ @Override public int hashCode() { int res = (int)(expireTime ^ (expireTime >>> 32)); res = 31 * res + key.hashCode(); return res; }
/** * @param cacheId Cache ID. * @param key Key. */ public SearchRow(int cacheId, KeyCacheObject key) { this.key = key; this.hash = key.hashCode(); this.cacheId = cacheId; }
/** {@inheritDoc} */ @Override public int hashCode() { int res = key.hashCode(); res = 31 * res + cacheId; return res; }
/** {@inheritDoc} */ @Override public int hashCode() { return key.hashCode(); }
/** * @param key Key. * @param val Value. * @param ver Version. * @param part Partition. * @param expireTime Expire time. * @param cacheId Cache ID. */ public DataRow(KeyCacheObject key, CacheObject val, GridCacheVersion ver, int part, long expireTime, int cacheId) { super(0); this.hash = key.hashCode(); this.key = key; this.val = val; this.ver = ver; this.part = part; this.expireTime = expireTime; this.cacheId = cacheId; verReady = true; }
/** {@inheritDoc} */ @Override public void key(KeyCacheObject key) { super.key(key); hash = key.hashCode(); }
/** {@inheritDoc} */ @Override public int hashCode() { return cached.key().hashCode(); }
/** {@inheritDoc} */ @Override public int hash() { return entry.key().hashCode(); }
/** * @param cctx Cache context. * @param key Cache key. */ protected GridCacheMapEntry( GridCacheContext<?, ?> cctx, KeyCacheObject key ) { if (log == null) log = U.logger(cctx.kernalContext(), logRef, GridCacheMapEntry.class); key = (KeyCacheObject)cctx.kernalContext().cacheObjects().prepareForCache(key, cctx); assert key != null; this.key = key; this.hash = key.hashCode(); this.cctx = cctx; this.listenerLock = cctx.continuousQueries().getListenerReadLock(); ver = cctx.shared().versions().startVersion(); }
CacheDataRow row = it.nextX(); partHash += row.key().hashCode();
CacheDataRow row = it.nextX(); partHash += row.key().hashCode();
CacheDataRow row = it.nextX(); partHash += row.key().hashCode();
/** {@inheritDoc} */ @Override public int hashCode() { int res = (int)(expireTime ^ (expireTime >>> 32)); res = 31 * res + key.hashCode(); return res; }
/** * @param cacheId Cache ID. * @param key Key. */ public SearchRow(int cacheId, KeyCacheObject key) { this.key = key; this.hash = key.hashCode(); this.cacheId = cacheId; }
/** * Check whether this worker owns particular key. * * @param key Key. * @return {@code True} in case this worker should process this key. */ protected boolean owns(KeyCacheObject key) { assert key != null; // Avoid hash code and remainder calculation in case there is no actual split. return totalCnt == 1 || key.hashCode() % totalCnt == id; }
/** {@inheritDoc} */ @Override public int hashCode() { return key.hashCode(); }
/** {@inheritDoc} */ @Override public int hashCode() { int res = key.hashCode(); res = 31 * res + cacheId; return res; }
/** {@inheritDoc} */ @Override public void key(KeyCacheObject key) { super.key(key); hash = key.hashCode(); }
/** {@inheritDoc} */ @Override public int hashCode() { return cached.key().hashCode(); }