Merge branch 'sprint-1' of 
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-9655-merge


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

Branch: refs/heads/sprint-1
Commit: 90e38c1f2b7db05f26d5d3dd06e2b59088a31762
Parents: 4e0ccef a8573b4
Author: Alexey Goncharuk <agoncha...@gridgain.com>
Authored: Sun Feb 15 00:05:55 2015 -0800
Committer: Alexey Goncharuk <agoncha...@gridgain.com>
Committed: Sun Feb 15 00:05:55 2015 -0800

----------------------------------------------------------------------
 assembly/core-jar.xml                           |  67 --
 assembly/dependencies-fabric.xml                |  42 +-
 assembly/dependencies-hadoop.xml                |  42 +-
 examples/config/example-cache.xml               |   2 +-
 .../datagrid/CacheContinuousQueryExample.java   |  69 +-
 .../datagrid/CachePopularNumbersExample.java    |  31 +-
 .../examples/datagrid/CacheQueryExample.java    | 209 ++---
 .../starschema/CacheStarSchemaExample.java      |  41 +-
 .../datagrid/starschema/DimProduct.java         |   6 +-
 .../examples/datagrid/starschema/DimStore.java  |   6 +-
 .../datagrid/starschema/FactPurchase.java       |  10 +-
 .../ignite/jdbc/JdbcComplexQuerySelfTest.java   |  15 +-
 .../ignite/jdbc/JdbcMetadataSelfTest.java       |  13 +-
 .../jdbc/JdbcPreparedStatementSelfTest.java     |  32 +-
 .../ignite/jdbc/JdbcResultSetSelfTest.java      |  39 +-
 .../ignite/jdbc/JdbcStatementSelfTest.java      |  11 +-
 .../clients/src/test/resources/spring-cache.xml |   2 +-
 .../java/org/apache/ignite/IgniteCache.java     |  44 +-
 .../apache/ignite/cache/CacheProjection.java    |   4 +-
 .../cache/query/CacheContinuousQuery.java       | 284 ------
 .../cache/query/CacheContinuousQueryEntry.java  |  49 -
 .../apache/ignite/cache/query/CacheQueries.java | 152 ----
 .../apache/ignite/cache/query/CacheQuery.java   | 294 ------
 .../cache/query/CacheQueryConfiguration.java    | 180 ----
 .../ignite/cache/query/CacheQueryFuture.java    |  66 --
 .../cache/query/CacheQueryGroupIndex.java       |  49 -
 .../ignite/cache/query/CacheQueryMetrics.java   |  60 --
 .../ignite/cache/query/CacheQuerySqlField.java  | 123 ---
 .../cache/query/CacheQuerySqlFunction.java      |  67 --
 .../ignite/cache/query/CacheQueryTextField.java |  33 -
 .../ignite/cache/query/CacheQueryType.java      |  47 -
 .../cache/query/CacheQueryTypeResolver.java     |  32 -
 .../ignite/cache/query/ContinuousQuery.java     | 314 +++++++
 .../org/apache/ignite/cache/query/Query.java    | 143 +++
 .../cache/query/QueryAffinityPredicate.java     | 135 ---
 .../cache/query/QueryContinuousPredicate.java   | 215 -----
 .../apache/ignite/cache/query/QueryCursor.java  |  22 +-
 .../apache/ignite/cache/query/QueryMetrics.java |  62 ++
 .../ignite/cache/query/QueryPredicate.java      |  76 --
 .../apache/ignite/cache/query/QueryReducer.java |  30 -
 .../ignite/cache/query/QuerySqlPredicate.java   | 118 ---
 .../ignite/cache/query/QueryTextPredicate.java  |  90 --
 .../ignite/cache/query/QueryTypeResolver.java   |  32 +
 .../apache/ignite/cache/query/ScanQuery.java    |  76 ++
 .../org/apache/ignite/cache/query/SpiQuery.java |  64 ++
 .../ignite/cache/query/SqlFieldsQuery.java      |  98 ++
 .../org/apache/ignite/cache/query/SqlQuery.java | 142 +++
 .../apache/ignite/cache/query/TextQuery.java    | 119 +++
 .../cache/query/annotations/QuerySqlField.java  |   8 +-
 .../query/annotations/QuerySqlFunction.java     |   4 +-
 .../cache/query/annotations/QueryTextField.java |   8 +-
 .../configuration/CacheConfiguration.java       |   6 +-
 .../configuration/CacheQueryConfiguration.java  | 182 ++++
 .../configuration/IgniteConfiguration.java      |  10 +-
 .../configuration/QueryConfiguration.java       |   3 +-
 .../ignite/events/CacheQueryExecutedEvent.java  |   9 +-
 .../ignite/events/CacheQueryReadEvent.java      |   9 +-
 .../org/apache/ignite/internal/IgnitionEx.java  |   5 +-
 .../managers/indexing/GridIndexingManager.java  |   4 +-
 .../processors/cache/CacheEntryEvent.java       |  78 --
 .../cache/CacheWeakQueryIteratorsHolder.java    |   2 +-
 .../processors/cache/GridCacheAdapter.java      |   1 -
 .../processors/cache/GridCacheContext.java      |   6 +-
 .../processors/cache/GridCacheMapEntry.java     |  26 +-
 .../processors/cache/GridCacheProcessor.java    |   8 +-
 .../processors/cache/GridCacheProjectionEx.java |   5 +
 .../cache/GridCacheProjectionImpl.java          |   1 -
 .../processors/cache/GridCacheProxyImpl.java    |   1 -
 .../processors/cache/IgniteCacheProxy.java      | 356 +++++++-
 .../CacheDataStructuresManager.java             |  81 +-
 .../processors/cache/query/CacheQueries.java    | 143 +++
 .../processors/cache/query/CacheQuery.java      | 296 +++++++
 .../cache/query/CacheQueryFuture.java           |  66 ++
 .../processors/cache/query/CacheQueryType.java  |  47 +
 .../query/GridCacheDistributedQueryManager.java |   1 -
 .../cache/query/GridCacheLocalQueryManager.java |   1 -
 .../cache/query/GridCacheQueriesEx.java         |   1 -
 .../cache/query/GridCacheQueriesImpl.java       |  11 +-
 .../cache/query/GridCacheQueriesProxy.java      |  14 +-
 .../cache/query/GridCacheQueryAdapter.java      |   2 +-
 .../cache/query/GridCacheQueryErrorFuture.java  |   1 -
 .../query/GridCacheQueryFutureAdapter.java      |   1 -
 .../cache/query/GridCacheQueryManager.java      |  36 +-
 .../query/GridCacheQueryMetricsAdapter.java     |   4 +-
 .../cache/query/GridCacheQueryType.java         |   4 +-
 .../cache/query/GridCacheSqlMetadata.java       |   2 +-
 .../processors/cache/query/QueryCursorImpl.java |  87 ++
 .../continuous/CacheContinuousQueryEntry.java   | 234 +++++
 .../continuous/CacheContinuousQueryEvent.java   |  87 ++
 .../CacheContinuousQueryFilterEx.java           |  31 +
 .../continuous/CacheContinuousQueryHandler.java | 490 ++++++++++
 .../CacheContinuousQueryListener.java           |  47 +
 .../continuous/CacheContinuousQueryManager.java | 664 ++++++++++++++
 .../GridCacheContinuousQueryAdapter.java        | 319 -------
 .../GridCacheContinuousQueryEntry.java          | 344 -------
 .../GridCacheContinuousQueryFilterEx.java       |  33 -
 .../GridCacheContinuousQueryHandler.java        | 570 ------------
 .../GridCacheContinuousQueryListener.java       |  41 -
 .../GridCacheContinuousQueryManager.java        | 784 ----------------
 .../query/jdbc/GridCacheQueryJdbcTask.java      |   1 -
 .../datastructures/GridCacheSetImpl.java        |   1 -
 .../processors/hadoop/GridHadoopJobId.java      |   3 +-
 .../processors/query/GridQueryIndexing.java     |  15 +-
 .../processors/query/GridQueryProcessor.java    | 151 +++-
 .../cache/GridCacheQueryCommandHandler.java     |   1 -
 .../service/GridServiceProcessor.java           |  75 +-
 .../visor/cache/VisorCacheQueryMetrics.java     |   2 +-
 .../internal/visor/query/VisorQueryTask.java    |   1 -
 .../internal/visor/query/VisorQueryUtils.java   |   2 +-
 .../optimized/optimized-classnames.properties   |   6 +-
 .../spi/indexing/GridIndexingQueryFilter.java   |  34 -
 .../ignite/spi/indexing/GridIndexingSpi.java    | 112 ---
 .../spi/indexing/GridNoopIndexingSpi.java       |  66 --
 .../spi/indexing/IndexingQueryFilter.java       |  34 +
 .../apache/ignite/spi/indexing/IndexingSpi.java | 113 +++
 .../spi/indexing/noop/NoopIndexingSpi.java      |  68 ++
 .../GridCacheConcurrentTxMultiNodeTest.java     |  23 +-
 .../GridCacheFieldsQueryNoDataSelfTest.java     |   2 +-
 ...CacheFullTextQueryMultithreadedSelfTest.java |   5 +-
 .../cache/GridCacheLuceneQueryIndexTest.java    |   6 +-
 .../cache/GridCacheOffHeapSelfTest.java         |   4 +-
 .../cache/GridCacheQueryEmbeddedValue.java      |  10 +-
 .../cache/GridCacheQueryIndexSelfTest.java      |   5 +-
 .../GridCacheQueryIndexingDisabledSelfTest.java |   2 +-
 .../processors/cache/GridCacheTestValue.java    |   4 +-
 .../processors/cache/GridCacheTestValue2.java   |   4 +-
 .../IgniteTxExceptionAbstractSelfTest.java      |   6 +-
 .../cache/IgniteTxMultiNodeAbstractTest.java    |   2 +-
 ...achePartitionedPreloadLifecycleSelfTest.java |   2 +-
 ...hePartitionedQueryMultiThreadedSelfTest.java |  11 +-
 ...CacheReplicatedPreloadLifecycleSelfTest.java |   2 +-
 .../GridCacheSwapScanQueryAbstractSelfTest.java |   1 -
 ...ridCacheContinuousQueryAbstractSelfTest.java | 888 ++++---------------
 ...dCacheContinuousQueryReplicatedSelfTest.java |  96 +-
 ...dCacheAbstractReduceFieldsQuerySelfTest.java |  13 +-
 ...cheReduceFieldsQueryPartitionedSelfTest.java |   2 +-
 .../GridContinuousOperationsLoadTest.java       |  54 +-
 .../loadtests/hashmap/GridCacheTestContext.java |   2 +-
 .../ignite/loadtests/mapper/TestObject.java     |   6 +-
 .../webapp/META-INF/ignite-webapp-config.xml    |   8 +-
 .../query/h2/GridH2IndexingGeoSelfTest.java     |   7 +-
 .../hadoop/jobtracker/GridHadoopJobTracker.java |  31 +-
 .../processors/query/h2/IgniteH2Indexing.java   |  34 +-
 .../query/h2/opt/GridH2IndexBase.java           |   6 +-
 .../query/h2/opt/GridH2TreeIndex.java           |   2 +-
 .../query/h2/opt/GridLuceneIndex.java           |   2 +-
 .../query/h2/twostep/GridMapQueryExecutor.java  |   2 +-
 .../GridCacheAbstractFieldsQuerySelfTest.java   |  14 +-
 .../cache/GridCacheAbstractQuerySelfTest.java   |  32 +-
 .../cache/GridCacheCrossCacheQuerySelfTest.java |  18 +-
 .../GridCacheCrossCacheQuerySelfTestNewApi.java | 410 +++++++++
 .../cache/GridCacheQueryLoadSelfTest.java       |   4 +-
 .../cache/GridCacheQueryMetricsSelfTest.java    |   5 +-
 .../GridCacheQueryMultiThreadedSelfTest.java    |   4 +-
 .../cache/GridCacheQueryTestValue.java          |  20 +-
 ...idCacheReduceQueryMultithreadedSelfTest.java |   2 +-
 .../GridCacheSqlQueryMultiThreadedSelfTest.java |   5 +-
 .../processors/cache/GridCacheSwapSelfTest.java |   4 +-
 .../cache/GridIndexingWithNoopSwapSelfTest.java |   2 +-
 .../GridCacheAtomicFieldsQuerySelfTest.java     |   2 +-
 ...GridCachePartitionedFieldsQuerySelfTest.java |   2 +-
 .../near/GridCachePartitionedQuerySelfTest.java |   2 +-
 .../near/GridCacheQueryNodeRestartSelfTest.java |   2 +-
 .../GridCacheReplicatedFieldsQuerySelfTest.java |   2 +-
 .../GridCacheReplicatedQuerySelfTest.java       |   4 +-
 .../local/GridCacheLocalQuerySelfTest.java      |   2 +-
 .../query/h2/GridH2IndexRebuildTest.java        |  15 +-
 .../query/h2/sql/GridQueryParsingTest.java      |  17 +-
 .../loadtests/h2indexing/GridTestEntity.java    |   6 +-
 .../tcp/GridOrderedMessageCancelSelfTest.java   |   1 -
 .../IgniteCacheQuerySelfTestSuite.java          |   1 +
 .../scala/org/apache/ignite/scalar/scalar.scala |  10 +-
 .../commands/cache/VisorCacheCommandSpec.scala  |  43 +-
 .../cache/IgniteSqlQueryBenchmark.java          |   2 +-
 .../cache/IgniteSqlQueryJoinBenchmark.java      |   2 +-
 .../cache/IgniteSqlQueryPutBenchmark.java       |   2 +-
 .../yardstick/cache/model/Organization.java     |   6 +-
 .../ignite/yardstick/cache/model/Person.java    |  12 +-
 pom.xml                                         |  19 +-
 179 files changed, 5462 insertions(+), 6168 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90e38c1f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90e38c1f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90e38c1f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index e8e524f,c61c1f6..af8d2cf
--- 
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
@@@ -1149,94 -1160,120 +1149,94 @@@ public abstract class GridCacheMapEntry
  
          IgniteBiTuple<Boolean, V> interceptRes = null;
  
 -        try {
 -            synchronized (this) {
 -                checkObsolete();
 -
 -                if (tx != null && tx.groupLock() && 
cctx.kernalContext().config().isCacheSanityCheckEnabled())
 -                    groupLockSanityCheck(tx);
 -                else
 -                    assert tx == null || (!tx.local() && tx.onePhaseCommit()) 
|| tx.ownsLock(this) :
 -                        "Transaction does not own lock for remove[entry=" + 
this + ", tx=" + tx + ']';
 -
 -                boolean startVer = isStartVersion();
 -
 -                if (startVer) {
 -                    if (tx != null && !tx.local() && tx.onePhaseCommit())
 -                        // Must promote to check version for one-phase commit 
tx.
 -                        unswap(true, retval);
 -                    else
 -                        // Release swap.
 -                        releaseSwap();
 -                }
 +        synchronized (this) {
 +            checkObsolete();
  
 -                newVer = explicitVer != null ? explicitVer : tx == null ? 
nextVersion() : tx.writeVersion();
 +            if (tx != null && tx.groupLock() && 
cctx.kernalContext().config().isCacheSanityCheckEnabled())
 +                groupLockSanityCheck(tx);
 +            else
 +                assert tx == null || (!tx.local() && tx.onePhaseCommit()) || 
tx.ownsLock(this) :
 +                    "Transaction does not own lock for remove[entry=" + this 
+ ", tx=" + tx + ']';
  
 -                if (tx != null && !tx.local() && tx.onePhaseCommit() && 
explicitVer == null) {
 -                    if (!startVer && ver.compareTo(newVer) > 0) {
 -                        if (log.isDebugEnabled())
 -                            log.debug("Skipping entry removal for one-phase 
commit since current entry version is " +
 -                                "greater than write version [entry=" + this + 
", newVer=" + newVer + ']');
 +            boolean startVer = isStartVersion();
  
 -                        return new GridCacheUpdateTxResult<>(false, null);
 -                    }
 +            if (startVer) {
 +                // Release swap.
 +                releaseSwap();
 +            }
  
 -                    if (!detached())
 -                        enqueueVer = newVer;
 -                }
 +            newVer = explicitVer != null ? explicitVer : tx == null ? 
nextVersion() : tx.writeVersion();
  
 -                old = (retval || intercept) ? 
rawGetOrUnmarshalUnlocked(!retval) : val;
 +            old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) 
: val;
  
 -                if (intercept) {
 -                    interceptRes = cctx.config().<K, 
V>getInterceptor().onBeforeRemove(key, old);
 +            if (intercept) {
 +                interceptRes = cctx.config().<K, 
V>getInterceptor().onBeforeRemove(key, old);
  
 -                    if (cctx.cancelRemove(interceptRes))
 -                        return new GridCacheUpdateTxResult<>(false, 
cctx.<V>unwrapTemporary(interceptRes.get2()));
 -                }
 +                if (cctx.cancelRemove(interceptRes))
 +                    return new GridCacheUpdateTxResult<>(false, 
cctx.<V>unwrapTemporary(interceptRes.get2()));
 +            }
  
 -                GridCacheValueBytes oldBytes = valueBytesUnlocked();
 +            GridCacheValueBytes oldBytes = valueBytesUnlocked();
  
 -                if (old == null)
 -                    old = saveValueForIndexUnlocked();
 +            if (old == null)
 +                old = saveValueForIndexUnlocked();
  
 -                // Clear indexes inside of synchronization since indexes
 -                // can be updated without actually holding entry lock.
 -                clearIndex(old);
 +            // Clear indexes inside of synchronization since indexes
 +            // can be updated without actually holding entry lock.
 +            clearIndex(old);
  
 -                boolean hadValPtr = valPtr != 0;
 +            boolean hadValPtr = valPtr != 0;
  
 -                update(null, null, 0, 0, newVer);
 +            update(null, null, 0, 0, newVer);
  
 -                if (cctx.offheapTiered() && hadValPtr) {
 -                    boolean rmv = cctx.swap().removeOffheap(key, 
getOrMarshalKeyBytes());
 +            if (cctx.offheapTiered() && hadValPtr) {
 +                boolean rmv = cctx.swap().removeOffheap(key, 
getOrMarshalKeyBytes());
  
 -                    assert rmv;
 -                }
 +                assert rmv;
 +            }
  
 -                if (cctx.deferredDelete() && !detached() && !isInternal()) {
 -                    if (!deletedUnlocked()) {
 -                        deletedUnlocked(true);
 +            if (cctx.deferredDelete() && !detached() && !isInternal()) {
 +                if (!deletedUnlocked()) {
 +                    deletedUnlocked(true);
  
 -                        if (tx != null) {
 -                            GridCacheMvcc<K> mvcc = mvccExtras();
 +                    if (tx != null) {
 +                        GridCacheMvcc<K> mvcc = mvccExtras();
  
 -                            if (mvcc == null || mvcc.isEmpty(tx.xidVersion()))
 -                                clearReaders();
 -                            else
 -                                clearReader(tx.originatingNodeId());
 -                        }
 +                        if (mvcc == null || mvcc.isEmpty(tx.xidVersion()))
 +                            clearReaders();
 +                        else
 +                            clearReader(tx.originatingNodeId());
                      }
                  }
 +            }
  
 -                drReplicate(drType, null, null, newVer);
 +            drReplicate(drType, null, null, newVer);
  
 -                if (metrics && 
cctx.cache().configuration().isStatisticsEnabled())
 -                    cctx.cache().metrics0().onRemove();
 +            if (metrics && cctx.cache().configuration().isStatisticsEnabled())
 +                cctx.cache().metrics0().onRemove();
  
 -                if (tx == null)
 -                    obsoleteVer = newVer;
 -                else {
 -                    // Only delete entry if the lock is not explicit.
 -                    if (tx.groupLock() || lockedBy(tx.xidVersion()))
 -                        obsoleteVer = tx.xidVersion();
 -                    else if (log.isDebugEnabled())
 -                        log.debug("Obsolete version was not set because lock 
was explicit: " + this);
 -                }
 +            if (tx == null)
 +                obsoleteVer = newVer;
 +            else {
 +                // Only delete entry if the lock is not explicit.
 +                if (tx.groupLock() || lockedBy(tx.xidVersion()))
 +                    obsoleteVer = tx.xidVersion();
 +                else if (log.isDebugEnabled())
 +                    log.debug("Obsolete version was not set because lock was 
explicit: " + this);
 +            }
  
 -                if (evt && newVer != null && 
cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) {
 -                    V evtOld = cctx.unwrapTemporary(old);
 +            if (evt && newVer != null && 
cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) {
 +                V evtOld = cctx.unwrapTemporary(old);
  
 -                    cctx.events().addEvent(partition(), key, evtNodeId, tx == 
null ? null : tx.xid(), newVer,
 -                        EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld 
!= null || hasValueUnlocked(), subjId,
 -                        null, taskName);
 -                }
 +                cctx.events().addEvent(partition(), key, evtNodeId, tx == 
null ? null : tx.xid(), newVer,
 +                    EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld != 
null || hasValueUnlocked(), subjId,
 +                    null, taskName);
 +            }
  
                  if (cctx.isLocal() || cctx.isReplicated() || (tx != null && 
tx.local() && !isNear()))
-                     cctx.continuousQueries().onEntryUpdate(this, key, null, 
null, old, oldBytes, false);
+                     cctx.continuousQueries().onEntryUpdated(this, key, null, 
null, old, oldBytes);
  
 -                cctx.dataStructures().onEntryUpdated(key, true);
 -            }
 -        }
 -        finally {
 -            if (enqueueVer != null) {
 -                assert cctx.deferredDelete();
 -
 -                cctx.onDeferredDelete(this, enqueueVer);
 -            }
 +            cctx.dataStructures().onEntryUpdated(key, true);
          }
  
          // Persist outside of synchronization. The correctness of the

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90e38c1f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
----------------------------------------------------------------------

Reply via email to