Merge branch 'master' into ignite-3443.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fc0917b5 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fc0917b5 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fc0917b5 Branch: refs/heads/ignite-3443 Commit: fc0917b53b5a42375d7b203274aebcf2ea717487 Parents: aef905a 8f69787 Author: Alexey Kuznetsov <[email protected]> Authored: Wed Aug 31 13:33:02 2016 +0700 Committer: Alexey Kuznetsov <[email protected]> Committed: Wed Aug 31 13:33:02 2016 +0700 ---------------------------------------------------------------------- .../java/org/apache/ignite/IgniteCache.java | 15 + .../processors/cache/CacheLazyEntry.java | 2 + .../EntryProcessorResourceInjectorProxy.java | 105 ++++ .../processors/cache/GridCacheMapEntry.java | 13 +- .../processors/cache/IgniteCacheProxy.java | 112 +++- .../GridNearAtomicSingleUpdateFuture.java | 17 +- .../dht/atomic/GridNearAtomicUpdateFuture.java | 8 +- .../local/atomic/GridLocalAtomicCache.java | 18 +- .../processors/cache/query/CacheQuery.java | 11 +- .../query/GridCacheDistributedQueryManager.java | 22 +- .../cache/query/GridCacheLocalQueryManager.java | 3 +- .../cache/query/GridCacheQueryAdapter.java | 69 ++- .../cache/query/GridCacheQueryBean.java | 8 +- .../cache/query/GridCacheQueryInfo.java | 8 +- .../cache/query/GridCacheQueryManager.java | 122 ++-- .../cache/query/GridCacheQueryRequest.java | 6 +- .../transactions/IgniteTxLocalAdapter.java | 5 +- .../processors/odbc/escape/OdbcEscapeUtils.java | 115 ++-- .../processors/resource/GridResourceIoc.java | 438 ++++++++++---- .../resource/GridResourceProcessor.java | 396 ++++++------- .../cache/GridCacheAbstractFullApiSelfTest.java | 393 +++++++++++-- .../cache/GridCacheAbstractSelfTest.java | 140 ++++- .../GridCacheTransformEventSelfTest.java | 66 ++- ...ePartitionedBasicStoreMultiNodeSelfTest.java | 2 + .../GridCacheQueryTransformerSelfTest.java | 570 +++++++++++++++++++ .../odbc/OdbcEscapeSequenceSelfTest.java | 164 +++++- .../multijvm/IgniteCacheProcessProxy.java | 6 + .../IgniteCacheQuerySelfTestSuite.java | 2 + .../odbc-test/config/queries-test-noodbc.xml | 48 +- .../cpp/odbc-test/config/queries-test.xml | 50 +- .../cpp/odbc-test/project/vs/odbc-test.vcxproj | 1 + .../project/vs/odbc-test.vcxproj.filters | 3 + .../cpp/odbc-test/src/queries_test.cpp | 64 +-- .../odbc-test/src/sql_test_suite_fixture.cpp | 14 +- .../GridTransformSpringInjectionSelfTest.java | 186 ++++++ .../testsuites/IgniteSpringTestSuite.java | 7 +- .../commands/cache/VisorCacheStopCommand.scala | 5 +- .../IgniteInvokeWithInjectionBenchmark.java | 74 +++ .../IgniteInvokeWithInjectionTxBenchmark.java | 30 + 39 files changed, 2631 insertions(+), 687 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/fc0917b5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java ---------------------------------------------------------------------- diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 9e7d0e1,2f0a944..ddadcf4 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@@ -480,39 -483,58 +486,58 @@@ public class IgniteCacheProxy<K, V> ext boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary(); - if (filter instanceof ScanQuery) { - IgniteBiPredicate<K, V> p = ((ScanQuery)filter).getFilter(); + IgniteBiPredicate<K, V> p = scanQry.getFilter(); - qry = ctx.queries().createScanQuery(p, ((ScanQuery)filter).getPartition(), isKeepBinary); + qry = ctx.queries().createScanQuery(p, transformer, scanQry.getPartition(), isKeepBinary); - if (grp != null) - qry.projection(grp); + if (grp != null) + qry.projection(grp); - final GridCloseableIterator<Entry<K, V>> iter = ctx.kernalContext().query().executeQuery(CacheQueryType.SCAN, - ctx.name(), ctx, new IgniteOutClosureX<GridCloseableIterator<Entry<K, V>>>() { - @Override public GridCloseableIterator<Entry<K, V>> applyx() throws IgniteCheckedException { - final GridCloseableIterator<Map.Entry> iter0 = qry.executeScanQuery(); - final GridCloseableIterator<R> iter = ctx.kernalContext().query().executeQuery(ctx, ++ final GridCloseableIterator<R> iter = ctx.kernalContext().query().executeQuery(CacheQueryType.SCAN, ctx.name(), ctx, + new IgniteOutClosureX<GridCloseableIterator<R>>() { + @Override public GridCloseableIterator<R> applyx() throws IgniteCheckedException { + final GridCloseableIterator iter0 = qry.executeScanQuery(); - return new GridCloseableIteratorAdapter<Cache.Entry<K, V>>() { - @Override protected Cache.Entry<K, V> onNext() throws IgniteCheckedException { - Map.Entry<K, V> next = iter0.nextX(); + final boolean needToConvert = transformer == null; - return new CacheEntryImpl<>(next.getKey(), next.getValue()); - } + return new GridCloseableIteratorAdapter<R>() { + @Override protected R onNext() throws IgniteCheckedException { + Object next = iter0.nextX(); - @Override protected boolean onHasNext() throws IgniteCheckedException { - return iter0.hasNextX(); - } + if (needToConvert) { + Map.Entry<K, V> entry = (Map.Entry<K, V>)next; - @Override protected void onClose() throws IgniteCheckedException { - iter0.close(); + return (R) new CacheEntryImpl<>(entry.getKey(), entry.getValue()); } - }; - } - }, false); - return new QueryCursorImpl<>(iter); - } + return (R)next; + } + + @Override protected boolean onHasNext() throws IgniteCheckedException { + return iter0.hasNextX(); + } + + @Override protected void onClose() throws IgniteCheckedException { + iter0.close(); + } + }; + } + }, false); + + return new QueryCursorImpl<>(iter); + } + + /** + * @param filter Filter. + * @param grp Optional cluster group. + * @return Cursor. + */ + @SuppressWarnings("unchecked") + private QueryCursor<Cache.Entry<K, V>> query(final Query filter, @Nullable ClusterGroup grp) + throws IgniteCheckedException { + final CacheQuery<Map.Entry<K, V>> qry; + + boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary(); final CacheQueryFuture<Map.Entry<K, V>> fut; http://git-wip-us.apache.org/repos/asf/ignite/blob/fc0917b5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/fc0917b5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java ----------------------------------------------------------------------
