Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sboikov committed Mar 9, 2015
1 parent 365b359 commit 57ae9ec
Show file tree
Hide file tree
Showing 60 changed files with 521 additions and 520 deletions.
Expand Up @@ -20,7 +20,7 @@
import java.lang.annotation.*; import java.lang.annotation.*;


/** /**
* Annotation for ignite immutable objects. * Annotation for immutable objects.
*/ */
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
Expand Down
Expand Up @@ -316,7 +316,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
/** Collection of type metadata. */ /** Collection of type metadata. */
private Collection<CacheTypeMetadata> typeMeta; private Collection<CacheTypeMetadata> typeMeta;


/** */ /** Copy on get flag. */
private boolean cpOnGet = DFLT_COPY_ON_GET; private boolean cpOnGet = DFLT_COPY_ON_GET;


/** Empty constructor (all values are initialized to their defaults). */ /** Empty constructor (all values are initialized to their defaults). */
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -32,7 +32,7 @@
/** /**
* Cache affinity manager. * Cache affinity manager.
*/ */
public class GridCacheAffinityManager<K, V> extends GridCacheManagerAdapter<K, V> { public class GridCacheAffinityManager extends GridCacheManagerAdapter {
/** Factor for maximum number of attempts to calculate all partition affinity keys. */ /** Factor for maximum number of attempts to calculate all partition affinity keys. */
private static final int MAX_PARTITION_KEY_ATTEMPT_RATIO = 10; private static final int MAX_PARTITION_KEY_ATTEMPT_RATIO = 10;


Expand Down Expand Up @@ -207,7 +207,7 @@ public <T> int partition(Object key) {
* @param topVer Topology version. * @param topVer Topology version.
* @return Affinity nodes. * @return Affinity nodes.
*/ */
public List<ClusterNode> nodes(K key, long topVer) { public List<ClusterNode> nodes(Object key, long topVer) {
return nodes(partition(key), topVer); return nodes(partition(key), topVer);
} }


Expand Down Expand Up @@ -296,10 +296,10 @@ public Collection<ClusterNode> backups(int part, long topVer) {
* @param topVer Topology version. * @param topVer Topology version.
* @return Nodes for the keys. * @return Nodes for the keys.
*/ */
public Collection<ClusterNode> remoteNodes(Iterable<? extends K> keys, long topVer) { public Collection<ClusterNode> remoteNodes(Iterable keys, long topVer) {
Collection<Collection<ClusterNode>> colcol = new GridLeanSet<>(); Collection<Collection<ClusterNode>> colcol = new GridLeanSet<>();


for (K key : keys) for (Object key : keys)
colcol.add(nodes(key, topVer)); colcol.add(nodes(key, topVer));


return F.view(F.flatCollections(colcol), F.remoteNodes(cctx.localNodeId())); return F.view(F.flatCollections(colcol), F.remoteNodes(cctx.localNodeId()));
Expand Down
Expand Up @@ -102,7 +102,7 @@ public class GridCacheContext<K, V> implements Externalizable {
private GridUnsafeMemory unsafeMemory; private GridUnsafeMemory unsafeMemory;


/** Affinity manager. */ /** Affinity manager. */
private GridCacheAffinityManager<K, V> affMgr; private GridCacheAffinityManager affMgr;


/** Event manager. */ /** Event manager. */
private GridCacheEventManager evtMgr; private GridCacheEventManager evtMgr;
Expand All @@ -111,7 +111,7 @@ public class GridCacheContext<K, V> implements Externalizable {
private GridCacheQueryManager<K, V> qryMgr; private GridCacheQueryManager<K, V> qryMgr;


/** Continuous query manager. */ /** Continuous query manager. */
private CacheContinuousQueryManager<K, V> contQryMgr; private CacheContinuousQueryManager contQryMgr;


/** Swap manager. */ /** Swap manager. */
private GridCacheSwapManager swapMgr; private GridCacheSwapManager swapMgr;
Expand All @@ -120,7 +120,7 @@ public class GridCacheContext<K, V> implements Externalizable {
private GridCacheEvictionManager<K, V> evictMgr; private GridCacheEvictionManager<K, V> evictMgr;


/** Data structures manager. */ /** Data structures manager. */
private CacheDataStructuresManager<K, V> dataStructuresMgr; private CacheDataStructuresManager dataStructuresMgr;


/** Eager TTL manager. */ /** Eager TTL manager. */
private GridCacheTtlManager ttlMgr; private GridCacheTtlManager ttlMgr;
Expand Down Expand Up @@ -230,9 +230,9 @@ public GridCacheContext(
GridCacheStoreManager storeMgr, GridCacheStoreManager storeMgr,
GridCacheEvictionManager<K, V> evictMgr, GridCacheEvictionManager<K, V> evictMgr,
GridCacheQueryManager<K, V> qryMgr, GridCacheQueryManager<K, V> qryMgr,
CacheContinuousQueryManager<K, V> contQryMgr, CacheContinuousQueryManager contQryMgr,
GridCacheAffinityManager<K, V> affMgr, GridCacheAffinityManager affMgr,
CacheDataStructuresManager<K, V> dataStructuresMgr, CacheDataStructuresManager dataStructuresMgr,
GridCacheTtlManager ttlMgr, GridCacheTtlManager ttlMgr,
GridCacheDrManager drMgr, GridCacheDrManager drMgr,
CacheJtaManagerAdapter jtaMgr) { CacheJtaManagerAdapter jtaMgr) {
Expand Down Expand Up @@ -691,7 +691,7 @@ public boolean isLocalNode(UUID id) {
/** /**
* @return Partition topology. * @return Partition topology.
*/ */
public GridDhtPartitionTopology<K, V> topology() { public GridDhtPartitionTopology topology() {
assert isNear() || isDht() || isColocated() || isDhtAtomic(); assert isNear() || isDht() || isColocated() || isDhtAtomic();


return isNear() ? near().dht().topology() : dht().topology(); return isNear() ? near().dht().topology() : dht().topology();
Expand Down Expand Up @@ -854,7 +854,7 @@ public GridCacheEventManager events() {
/** /**
* @return Cache affinity manager. * @return Cache affinity manager.
*/ */
public GridCacheAffinityManager<K, V> affinity() { public GridCacheAffinityManager affinity() {
return affMgr; return affMgr;
} }


Expand All @@ -868,7 +868,7 @@ public GridCacheQueryManager<K, V> queries() {
/** /**
* @return Continuous query manager, {@code null} if disabled. * @return Continuous query manager, {@code null} if disabled.
*/ */
public CacheContinuousQueryManager<K, V> continuousQueries() { public CacheContinuousQueryManager continuousQueries() {
return contQryMgr; return contQryMgr;
} }


Expand Down Expand Up @@ -917,7 +917,7 @@ public GridCacheEvictionManager<K, V> evicts() {
/** /**
* @return Data structures manager. * @return Data structures manager.
*/ */
public CacheDataStructuresManager<K, V> dataStructures() { public CacheDataStructuresManager dataStructures() {
return dataStructuresMgr; return dataStructuresMgr;
} }


Expand Down
Expand Up @@ -211,7 +211,7 @@ public interface GridCacheEntryEx {
* @throws IgniteCheckedException If swap could not be released. * @throws IgniteCheckedException If swap could not be released.
* @throws GridCacheEntryRemovedException If entry was removed. * @throws GridCacheEntryRemovedException If entry was removed.
*/ */
public <K, V> boolean invalidate(@Nullable CacheEntryPredicate[] filter) public boolean invalidate(@Nullable CacheEntryPredicate[] filter)
throws GridCacheEntryRemovedException, IgniteCheckedException; throws GridCacheEntryRemovedException, IgniteCheckedException;


/** /**
Expand All @@ -222,7 +222,7 @@ public <K, V> boolean invalidate(@Nullable CacheEntryPredicate[] filter)
* @throws IgniteCheckedException If operation failed. * @throws IgniteCheckedException If operation failed.
* @return {@code true} if entry was not being used and could be removed. * @return {@code true} if entry was not being used and could be removed.
*/ */
public <K, V> boolean compact(@Nullable CacheEntryPredicate[] filter) public boolean compact(@Nullable CacheEntryPredicate[] filter)
throws GridCacheEntryRemovedException, IgniteCheckedException; throws GridCacheEntryRemovedException, IgniteCheckedException;


/** /**
Expand All @@ -232,7 +232,7 @@ public <K, V> boolean compact(@Nullable CacheEntryPredicate[] filter)
* @return {@code True} if entry could be evicted. * @return {@code True} if entry could be evicted.
* @throws IgniteCheckedException In case of error. * @throws IgniteCheckedException In case of error.
*/ */
public <K, V> boolean evictInternal(boolean swap, GridCacheVersion obsoleteVer, public boolean evictInternal(boolean swap, GridCacheVersion obsoleteVer,
@Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException; @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException;


/** /**
Expand Down Expand Up @@ -505,7 +505,7 @@ public GridTuple3<Boolean, Object, EntryProcessorResult<Object>> innerUpdateLoca
* @throws IgniteCheckedException If failed to remove from swap. * @throws IgniteCheckedException If failed to remove from swap.
* @return {@code True} if entry was not being used, passed the filter and could be removed. * @return {@code True} if entry was not being used, passed the filter and could be removed.
*/ */
public <K, V> boolean clear(GridCacheVersion ver, boolean readers, public boolean clear(GridCacheVersion ver, boolean readers,
@Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException; @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException;


/** /**
Expand Down Expand Up @@ -577,7 +577,7 @@ public boolean tmLock(IgniteInternalTx tx, long timeout) throws GridCacheEntryRe
* @return Value. * @return Value.
* @throws GridCacheEntryRemovedException If entry has been removed. * @throws GridCacheEntryRemovedException If entry has been removed.
*/ */
@Nullable public <K, V> CacheObject peek(GridCachePeekMode mode, CacheEntryPredicate... filter) @Nullable public CacheObject peek(GridCachePeekMode mode, CacheEntryPredicate... filter)
throws GridCacheEntryRemovedException; throws GridCacheEntryRemovedException;


/** /**
Expand Down Expand Up @@ -607,7 +607,7 @@ public boolean tmLock(IgniteInternalTx tx, long timeout) throws GridCacheEntryRe
* @return Value. * @return Value.
* @throws GridCacheEntryRemovedException If entry has been removed. * @throws GridCacheEntryRemovedException If entry has been removed.
*/ */
@Nullable public <K, V> CacheObject peek(Collection<GridCachePeekMode> modes, @Nullable public CacheObject peek(Collection<GridCachePeekMode> modes,
CacheEntryPredicate... filter) throws GridCacheEntryRemovedException; CacheEntryPredicate... filter) throws GridCacheEntryRemovedException;


/** /**
Expand Down
Expand Up @@ -27,7 +27,7 @@
*/ */
public class GridCacheManagerAdapter<K, V> implements GridCacheManager<K, V> { public class GridCacheManagerAdapter<K, V> implements GridCacheManager<K, V> {
/** Context. */ /** Context. */
protected GridCacheContext<K, V> cctx; protected GridCacheContext cctx;


/** Logger. */ /** Logger. */
protected IgniteLogger log; protected IgniteLogger log;
Expand Down
Expand Up @@ -2318,7 +2318,7 @@ protected void clearReader(UUID nodeId) throws GridCacheEntryRemovedException {
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
@Override public <K, V> boolean clear(GridCacheVersion ver, boolean readers, @Override public boolean clear(GridCacheVersion ver, boolean readers,
@Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException {
cctx.denyOnFlag(READ); cctx.denyOnFlag(READ);


Expand Down Expand Up @@ -2564,7 +2564,7 @@ protected void onInvalidate() {
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
@Override public <K, V> boolean invalidate(@Nullable CacheEntryPredicate[] filter) @Override public boolean invalidate(@Nullable CacheEntryPredicate[] filter)
throws GridCacheEntryRemovedException, IgniteCheckedException { throws GridCacheEntryRemovedException, IgniteCheckedException {
if (F.isEmptyOrNulls(filter)) { if (F.isEmptyOrNulls(filter)) {
synchronized (this) { synchronized (this) {
Expand Down Expand Up @@ -2604,7 +2604,7 @@ protected void onInvalidate() {
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
@Override public <K, V> boolean compact(@Nullable CacheEntryPredicate[] filter) @Override public boolean compact(@Nullable CacheEntryPredicate[] filter)
throws GridCacheEntryRemovedException, IgniteCheckedException { throws GridCacheEntryRemovedException, IgniteCheckedException {
// For optimistic checking. // For optimistic checking.
GridCacheVersion startVer; GridCacheVersion startVer;
Expand Down Expand Up @@ -2796,7 +2796,7 @@ void next(int segId, @Nullable GridCacheMapEntry next) {
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
@Nullable @Override public <K, V> CacheObject peek(GridCachePeekMode mode, @Nullable @Override public CacheObject peek(GridCachePeekMode mode,
CacheEntryPredicate[] filter) CacheEntryPredicate[] filter)
throws GridCacheEntryRemovedException { throws GridCacheEntryRemovedException {
try { try {
Expand Down Expand Up @@ -2848,7 +2848,7 @@ void next(int segId, @Nullable GridCacheMapEntry next) {
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
@Override public <K, V> CacheObject peek(Collection<GridCachePeekMode> modes, @Override public CacheObject peek(Collection<GridCachePeekMode> modes,
CacheEntryPredicate[] filter) CacheEntryPredicate[] filter)
throws GridCacheEntryRemovedException { throws GridCacheEntryRemovedException {
assert modes != null; assert modes != null;
Expand Down Expand Up @@ -2996,7 +2996,7 @@ private void groupLockSanityCheck(IgniteInternalTx tx) throws GridCacheEntryRemo
* @throws GridCacheEntryRemovedException If entry got removed. * @throws GridCacheEntryRemovedException If entry got removed.
* @throws IgniteCheckedException If unexpected cache failure occurred. * @throws IgniteCheckedException If unexpected cache failure occurred.
*/ */
@Nullable private <K, V> GridTuple<CacheObject> peekTxThenGlobal(boolean failFast, @Nullable private GridTuple<CacheObject> peekTxThenGlobal(boolean failFast,
CacheEntryPredicate[] filter, CacheEntryPredicate[] filter,
IgniteInternalTx tx) IgniteInternalTx tx)
throws GridCacheFilterFailedException, GridCacheEntryRemovedException, IgniteCheckedException throws GridCacheFilterFailedException, GridCacheEntryRemovedException, IgniteCheckedException
Expand All @@ -3019,7 +3019,7 @@ private void groupLockSanityCheck(IgniteInternalTx tx) throws GridCacheEntryRemo
* @return Peeked value. * @return Peeked value.
* @throws GridCacheFilterFailedException If filter failed. * @throws GridCacheFilterFailedException If filter failed.
*/ */
@Nullable private <K, V> GridTuple<CacheObject> peekTx(boolean failFast, @Nullable private GridTuple<CacheObject> peekTx(boolean failFast,
CacheEntryPredicate[] filter, CacheEntryPredicate[] filter,
@Nullable IgniteInternalTx tx) throws GridCacheFilterFailedException { @Nullable IgniteInternalTx tx) throws GridCacheFilterFailedException {
return tx == null ? null : tx.peek(cctx, failFast, key, filter); return tx == null ? null : tx.peek(cctx, failFast, key, filter);
Expand All @@ -3036,7 +3036,7 @@ private void groupLockSanityCheck(IgniteInternalTx tx) throws GridCacheEntryRemo
* @throws IgniteCheckedException If unexpected cache failure occurred. * @throws IgniteCheckedException If unexpected cache failure occurred.
*/ */
@SuppressWarnings({"RedundantTypeArguments"}) @SuppressWarnings({"RedundantTypeArguments"})
@Nullable private <K, V> GridTuple<CacheObject> peekGlobal(boolean failFast, @Nullable private GridTuple<CacheObject> peekGlobal(boolean failFast,
long topVer, long topVer,
CacheEntryPredicate[] filter, CacheEntryPredicate[] filter,
@Nullable IgniteCacheExpiryPolicy expiryPlc @Nullable IgniteCacheExpiryPolicy expiryPlc
Expand Down Expand Up @@ -3092,7 +3092,7 @@ private void groupLockSanityCheck(IgniteInternalTx tx) throws GridCacheEntryRemo
* @throws GridCacheFilterFailedException If filter failed. * @throws GridCacheFilterFailedException If filter failed.
*/ */
@SuppressWarnings({"unchecked"}) @SuppressWarnings({"unchecked"})
@Nullable private <K, V> GridTuple<CacheObject> peekSwap(boolean failFast, @Nullable private GridTuple<CacheObject> peekSwap(boolean failFast,
CacheEntryPredicate[] filter) CacheEntryPredicate[] filter)
throws IgniteCheckedException, GridCacheFilterFailedException throws IgniteCheckedException, GridCacheFilterFailedException
{ {
Expand Down Expand Up @@ -3837,7 +3837,7 @@ protected CacheObject saveValueForIndexUnlocked() throws IgniteCheckedException
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
@Override public <K, V> boolean evictInternal(boolean swap, GridCacheVersion obsoleteVer, @Override public boolean evictInternal(boolean swap, GridCacheVersion obsoleteVer,
@Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException {
boolean marked = false; boolean marked = false;


Expand Down Expand Up @@ -3976,7 +3976,7 @@ protected CacheObject saveValueForIndexUnlocked() throws IgniteCheckedException
* @param filter Entry filter. * @param filter Entry filter.
* @return {@code True} if entry is visitable. * @return {@code True} if entry is visitable.
*/ */
public <K, V> boolean visitable(CacheEntryPredicate[] filter) { public boolean visitable(CacheEntryPredicate[] filter) {
try { try {
if (obsoleteOrDeleted() || (filter != CU.empty0() && if (obsoleteOrDeleted() || (filter != CU.empty0() &&
!cctx.isAll(this, filter))) !cctx.isAll(this, filter)))
Expand Down

0 comments on commit 57ae9ec

Please sign in to comment.