ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [27/29] incubator-ignite git commit: Merge branch 'ignite-575' into sprint-2
Date Wed, 25 Mar 2015 06:54:11 GMT
Merge branch 'ignite-575' into sprint-2

Conflicts:
	examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java


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

Branch: refs/heads/ignite-341
Commit: 952962b869b84d6231227b53adf3741b32bd49cf
Parents: 56fea8c 25b4703
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Tue Mar 24 23:35:14 2015 -0700
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Tue Mar 24 23:35:14 2015 -0700

----------------------------------------------------------------------
 .../examples/datagrid/CacheQueryExample.java    |  44 +-
 .../examples/ScalarCacheQueryExample.scala      |  12 +-
 .../ClientAbstractMultiThreadedSelfTest.java    |   2 +-
 .../ClientAbstractMultiNodeSelfTest.java        |   2 +-
 .../ignite/jdbc/JdbcComplexQuerySelfTest.java   |  13 +-
 .../ignite/jdbc/JdbcMetadataSelfTest.java       |  13 +-
 .../src/test/resources/spring-server-node.xml   |   2 +-
 .../test/resources/spring-server-ssl-node.xml   |   2 +-
 .../src/main/java/org/apache/ignite/Ignite.java |   2 +-
 .../java/org/apache/ignite/IgniteCache.java     |   2 +-
 .../java/org/apache/ignite/IgniteCluster.java   |   4 +-
 .../org/apache/ignite/IgniteJdbcDriver.java     |   3 +-
 .../apache/ignite/cache/CacheMemoryMode.java    |   6 +-
 .../java/org/apache/ignite/cache/CacheMode.java |   5 +-
 .../apache/ignite/cache/CacheRebalanceMode.java |   3 +-
 .../apache/ignite/cache/affinity/Affinity.java  | 246 ++++++
 .../affinity/AffinityCentralizedFunction.java   |  31 +
 .../ignite/cache/affinity/AffinityFunction.java | 110 +++
 .../cache/affinity/AffinityFunctionContext.java |  72 ++
 .../ignite/cache/affinity/AffinityKey.java      | 189 +++++
 .../cache/affinity/AffinityKeyMapped.java       | 110 +++
 .../cache/affinity/AffinityKeyMapper.java       |  62 ++
 .../AffinityNodeAddressHashResolver.java        |  39 +
 .../affinity/AffinityNodeHashResolver.java      |  43 +
 .../affinity/AffinityNodeIdHashResolver.java    |  40 +
 .../ignite/cache/affinity/CacheAffinity.java    | 246 ------
 .../cache/affinity/CacheAffinityFunction.java   | 110 ---
 .../affinity/CacheAffinityFunctionContext.java  |  72 --
 .../ignite/cache/affinity/CacheAffinityKey.java | 189 -----
 .../cache/affinity/CacheAffinityKeyMapped.java  | 110 ---
 .../cache/affinity/CacheAffinityKeyMapper.java  |  62 --
 .../CacheAffinityNodeAddressHashResolver.java   |  39 -
 .../affinity/CacheAffinityNodeHashResolver.java |  43 -
 .../CacheAffinityNodeIdHashResolver.java        |  40 -
 .../CacheCentralizedAffinityFunction.java       |  31 -
 .../fair/CachePartitionFairAffinity.java        | 777 -------------------
 .../affinity/fair/FairAffinityFunction.java     | 777 +++++++++++++++++++
 .../CacheRendezvousAffinityFunction.java        | 501 ------------
 .../rendezvous/RendezvousAffinityFunction.java  | 500 ++++++++++++
 .../cache/eviction/CacheEvictableEntry.java     |  96 ---
 .../cache/eviction/CacheEvictionFilter.java     |  43 -
 .../cache/eviction/CacheEvictionPolicy.java     |  50 --
 .../ignite/cache/eviction/EvictableEntry.java   |  96 +++
 .../ignite/cache/eviction/EvictionFilter.java   |  43 +
 .../ignite/cache/eviction/EvictionPolicy.java   |  54 ++
 .../eviction/fifo/CacheFifoEvictionPolicy.java  | 192 -----
 .../fifo/CacheFifoEvictionPolicyMBean.java      |  50 --
 .../cache/eviction/fifo/FifoEvictionPolicy.java | 191 +++++
 .../eviction/fifo/FifoEvictionPolicyMBean.java  |  50 ++
 .../eviction/igfs/CacheIgfsEvictionFilter.java  |  38 -
 .../CacheIgfsPerBlockLruEvictionPolicy.java     | 378 ---------
 ...acheIgfsPerBlockLruEvictionPolicyMXBean.java |  93 ---
 .../cache/eviction/igfs/IgfsEvictionFilter.java |  38 +
 .../igfs/IgfsPerBlockLruEvictionPolicy.java     | 376 +++++++++
 .../IgfsPerBlockLruEvictionPolicyMXBean.java    |  93 +++
 .../eviction/lru/CacheLruEvictionPolicy.java    | 199 -----
 .../lru/CacheLruEvictionPolicyMBean.java        |  50 --
 .../cache/eviction/lru/LruEvictionPolicy.java   | 198 +++++
 .../eviction/lru/LruEvictionPolicyMBean.java    |  50 ++
 .../random/CacheRandomEvictionPolicy.java       | 115 ---
 .../random/CacheRandomEvictionPolicyMBean.java  |  42 -
 .../eviction/random/RandomEvictionPolicy.java   | 114 +++
 .../random/RandomEvictionPolicyMBean.java       |  42 +
 .../configuration/CacheConfiguration.java       |  36 +-
 .../configuration/NearCacheConfiguration.java   |   6 +-
 .../apache/ignite/internal/IgniteKernal.java    |   2 +-
 .../org/apache/ignite/internal/IgnitionEx.java  |   4 +-
 .../affinity/GridAffinityAssignmentCache.java   |  14 +-
 .../GridAffinityFunctionContextImpl.java        |  83 ++
 .../affinity/GridAffinityProcessor.java         |  22 +-
 .../processors/affinity/GridAffinityUtils.java  |   7 +-
 .../GridCacheAffinityFunctionContextImpl.java   |  83 --
 .../cache/CacheEvictableEntryImpl.java          |   2 +-
 .../processors/cache/CacheObjectContext.java    |   6 +-
 .../processors/cache/CacheProjection.java       |   6 +-
 .../internal/processors/cache/GridCache.java    |   7 +-
 .../processors/cache/GridCacheAdapter.java      |   4 +-
 .../processors/cache/GridCacheAttributes.java   |  12 +-
 .../processors/cache/GridCacheContext.java      |  12 +-
 .../GridCacheDefaultAffinityKeyMapper.java      |  14 +-
 .../processors/cache/GridCacheEntryEx.java      |   2 +-
 .../cache/GridCacheEvictionManager.java         |   4 +-
 .../processors/cache/GridCacheMapEntry.java     |   4 +-
 .../cache/GridCachePreloaderAdapter.java        |   2 +-
 .../processors/cache/GridCacheProcessor.java    |  36 +-
 .../processors/cache/GridCacheProxyImpl.java    |   4 +-
 .../processors/cache/GridCacheUtils.java        |   4 +-
 .../cache/affinity/GridCacheAffinityImpl.java   |   2 +-
 .../cache/affinity/GridCacheAffinityProxy.java  |   6 +-
 .../GridDhtPartitionsExchangeFuture.java        |   4 +-
 .../processors/cache/query/CacheQuery.java      |   3 +-
 .../GridCacheInternalKeyImpl.java               |   2 +-
 .../datastructures/GridCacheQueueAdapter.java   |   2 +-
 .../datastructures/GridCacheSetImpl.java        |   2 +-
 .../processors/igfs/IgfsDataManager.java        |   2 +-
 .../processors/igfs/IgfsHelperImpl.java         |  16 +-
 .../internal/processors/igfs/IgfsImpl.java      |   8 +-
 .../internal/processors/igfs/IgfsProcessor.java |   4 +-
 .../cache/VisorCacheAffinityConfiguration.java  |   6 +-
 .../cache/VisorCacheEvictionConfiguration.java  |   2 +-
 .../visor/cache/VisorCacheSwapBackupsTask.java  |   2 +-
 .../internal/visor/util/VisorTaskUtils.java     |  14 +-
 .../resources/META-INF/classnames.properties    |  32 +-
 .../core/src/test/config/discovery-stress.xml   |   2 +-
 .../config/load/dsi-49-server-production.xml    |   4 +-
 .../src/test/config/load/dsi-load-server.xml    |   2 +-
 .../core/src/test/config/spring-cache-swap.xml  |   2 +-
 .../src/test/config/spring-cache-teststore.xml  |   2 +-
 .../core/src/test/config/spring-multicache.xml  |  16 +-
 .../GridCacheAffinityBackupsSelfTest.java       |   8 +-
 .../ignite/IgniteCacheAffinitySelfTest.java     |  20 +-
 ...CachePartitionFairAffinityNodesSelfTest.java | 242 ------
 .../GridCachePartitionFairAffinitySelfTest.java | 264 -------
 .../GridFairAffinityFunctionNodesSelfTest.java  | 242 ++++++
 .../fair/GridFairAffinityFunctionSelfTest.java  | 264 +++++++
 .../ignite/internal/GridAffinityMappedTest.java |   4 +-
 .../internal/GridAffinityP2PSelfTest.java       |   4 +-
 .../GridJobMasterLeaveAwareSelfTest.java        |   6 +-
 .../internal/GridMultipleJobsSelfTest.java      |   2 +-
 .../GridAffinityProcessorAbstractSelfTest.java  |   2 +-
 ...GridAffinityProcessorRendezvousSelfTest.java |   4 +-
 ...cheNearUpdateTopologyChangeAbstractTest.java |   2 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java |   6 +-
 ...acheAbstractUsersAffinityMapperSelfTest.java |   4 +-
 .../cache/GridCacheAffinityApiSelfTest.java     |  48 +-
 .../cache/GridCacheAffinityMapperSelfTest.java  |  14 +-
 .../cache/GridCacheAffinityRoutingSelfTest.java |   2 +-
 .../cache/GridCacheAlwaysEvictionPolicy.java    |   4 +-
 .../GridCacheAtomicMessageCountSelfTest.java    |   2 +-
 .../GridCacheConcurrentTxMultiNodeTest.java     |  28 +-
 ...idCacheConfigurationConsistencySelfTest.java |  56 +-
 ...ridCacheConfigurationValidationSelfTest.java |   6 +-
 .../GridCacheInterceptorAbstractSelfTest.java   |   6 +-
 .../processors/cache/GridCacheLeakTest.java     |   2 +-
 .../cache/GridCacheLifecycleAwareSelfTest.java  |  12 +-
 .../cache/GridCacheMemoryModeSelfTest.java      |   3 +-
 .../cache/GridCacheObjectToStringSelfTest.java  |  18 +-
 .../processors/cache/GridCacheOffHeapTest.java  |   2 +-
 .../GridCachePartitionedAffinitySpreadTest.java |   4 +-
 .../cache/GridCacheReloadSelfTest.java          |   2 +-
 .../processors/cache/GridCacheTestEntryEx.java  |   2 +-
 .../cache/IgniteCachePeekModesAbstractTest.java |  10 +-
 .../cache/IgniteCacheTxPreloadNoWriteTest.java  |   4 +-
 .../IgniteClientAffinityAssignmentSelfTest.java |   8 +-
 .../processors/cache/IgniteTxAbstractTest.java  |   4 +-
 .../cache/IgniteTxMultiNodeAbstractTest.java    |   2 +-
 ...GridCachePartitionedNodeRestartSelfTest.java |   2 +-
 ...dCachePartitionedQueueEntryMoveSelfTest.java |   8 +-
 .../GridCacheAtomicTimeoutSelfTest.java         |   2 +-
 .../GridCacheClientModesAbstractSelfTest.java   |   2 +-
 .../GridCacheModuloAffinityFunction.java        |   4 +-
 ...dCachePartitionedAffinityFilterSelfTest.java |   6 +-
 ...chePartitionedReloadAllAbstractSelfTest.java |   2 +-
 ...GridCachePreloadRestartAbstractSelfTest.java |   4 +-
 .../GridCacheTransformEventSelfTest.java        |   4 +-
 ...heAbstractTransformWriteThroughSelfTest.java |   2 +-
 .../dht/GridCacheAtomicNearCacheSelfTest.java   |  18 +-
 .../dht/GridCacheColocatedDebugTest.java        |   2 +-
 .../dht/GridCacheDhtEntrySelfTest.java          |   4 +-
 ...GridCacheDhtEvictionNearReadersSelfTest.java |   4 +-
 .../dht/GridCacheDhtEvictionSelfTest.java       |   4 +-
 .../dht/GridCacheDhtInternalEntrySelfTest.java  |   5 +-
 .../dht/GridCacheDhtPreloadBigDataSelfTest.java |   2 +-
 .../dht/GridCacheDhtPreloadDelayedSelfTest.java |   4 +-
 .../GridCacheDhtPreloadDisabledSelfTest.java    |   2 +-
 .../GridCacheDhtPreloadMessageCountTest.java    |   2 +-
 ...ridCacheDhtPreloadMultiThreadedSelfTest.java |   2 +-
 .../dht/GridCacheDhtPreloadSelfTest.java        |   8 +-
 .../GridCacheDhtPreloadStartStopSelfTest.java   |   6 +-
 .../dht/GridCacheDhtPreloadUnloadSelfTest.java  |   2 +-
 .../distributed/dht/GridCacheDhtTestUtils.java  |   9 +-
 ...idCachePartitionedPreloadEventsSelfTest.java |   6 +-
 ...dCachePartitionedTopologyChangeSelfTest.java |   6 +-
 ...ridCachePartitionedUnloadEventsSelfTest.java |   2 +-
 ...eAtomicInvalidPartitionHandlingSelfTest.java |   2 +-
 .../atomic/GridCacheAtomicPreloadSelfTest.java  |   2 +-
 ...unctionExcludeNeighborsAbstractSelfTest.java |   6 +-
 ...eAtomicNearOnlyMultiNodeFullApiSelfTest.java |   2 +-
 .../near/GridCacheNearMultiGetSelfTest.java     |   2 +-
 .../near/GridCacheNearMultiNodeSelfTest.java    |   6 +-
 .../near/GridCacheNearTxMultiNodeSelfTest.java  |   2 +-
 ...AffinityExcludeNeighborsPerformanceTest.java |  10 +-
 ...rtitionedAffinityHashIdResolverSelfTest.java |   6 +-
 .../GridCachePartitionedAffinitySelfTest.java   |   6 +-
 .../GridCachePartitionedEvictionSelfTest.java   |   6 +-
 .../GridCachePartitionedFullApiSelfTest.java    |   2 +-
 .../GridCachePartitionedLoadCacheSelfTest.java  |   2 +-
 ...achePartitionedMultiNodeCounterSelfTest.java |   6 +-
 ...achePartitionedMultiNodeFullApiSelfTest.java |   6 +-
 ...ePartitionedMultiThreadedPutGetSelfTest.java |   2 +-
 .../GridCachePartitionedNodeRestartTest.java    |   2 +-
 ...ePartitionedOptimisticTxNodeRestartTest.java |   2 +-
 .../GridCachePartitionedTxSalvageSelfTest.java  |   2 +-
 ...idCacheRendezvousAffinityClientSelfTest.java |   4 +-
 ...ffinityFunctionExcludeNeighborsSelfTest.java |   4 +-
 ...dezvousAffinityMultiNodeFullApiSelfTest.java |   4 +-
 .../GridCacheReplicatedPreloadSelfTest.java     |   4 +-
 .../GridCacheBatchEvictUnswapSelfTest.java      |   2 +-
 ...heConcurrentEvictionConsistencySelfTest.java |  26 +-
 .../GridCacheConcurrentEvictionsSelfTest.java   |   6 +-
 .../GridCacheDistributedEvictionsSelfTest.java  |   2 +-
 .../GridCacheEmptyEntriesAbstractSelfTest.java  |   8 +-
 .../eviction/GridCacheEvictionAbstractTest.java |  12 +-
 .../GridCacheEvictionFilterSelfTest.java        |  12 +-
 .../GridCacheEvictionLockUnlockSelfTest.java    |   4 +-
 .../GridCacheEvictionTouchSelfTest.java         |  24 +-
 .../cache/eviction/GridCacheMockEntry.java      |   3 +-
 ...cheSynchronousEvictionsFailoverSelfTest.java |   4 +-
 .../GridCacheFifoEvictionPolicySelfTest.java    |  20 +-
 .../lru/GridCacheLruEvictionPolicySelfTest.java |  22 +-
 .../GridCacheLruNearEvictionPolicySelfTest.java |   2 +-
 ...heNearOnlyLruNearEvictionPolicySelfTest.java |   2 +-
 .../GridCacheRandomEvictionPolicySelfTest.java  |  12 +-
 .../IgniteCacheLoadAllAbstractTest.java         |   2 +-
 .../DataStreamProcessorSelfTest.java            |   2 +-
 ...sCachePerBlockLruEvictionPolicySelfTest.java |   4 +-
 ...idOffHeapPartitionedMapAbstractSelfTest.java |   2 +-
 ...apPartitionedMapPerformanceAbstractTest.java |   2 +-
 ...GridUnsafePartitionedMapPerformanceTest.java |   2 +-
 .../loadtests/GridCacheMultiNodeLoadTest.java   |   2 +-
 .../capacity/spring-capacity-cache.xml          |   2 +-
 .../loadtests/colocation/GridTestKey.java       |   2 +-
 .../loadtests/colocation/spring-colocation.xml  |   2 +-
 .../GridCachePartitionedAtomicLongLoadTest.java |   4 +-
 .../ignite/loadtests/dsi/GridDsiPerfJob.java    |   2 +-
 .../ignite/loadtests/dsi/GridDsiRequest.java    |   2 +-
 .../ignite/loadtests/dsi/GridDsiResponse.java   |   4 +-
 .../ignite/loadtests/dsi/GridDsiSession.java    |   2 +-
 ...apPartitionedMapPerformanceAbstractTest.java |   2 +-
 ...GridUnsafePartitionedMapPerformanceTest.java |   2 +-
 .../swap/GridSwapEvictAllBenchmark.java         |   2 +-
 .../ignite/testframework/junits/IgniteMock.java |   2 +-
 .../junits/common/GridCommonAbstractTest.java   |  14 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |   2 +-
 .../tests/p2p/GridExternalAffinityFunction.java |   4 +-
 .../p2p/GridExternalAffinityKeyMapper.java      |   2 +-
 .../hibernate/HibernateL2CacheSelfTest.java     |   6 +-
 .../GridCacheAbstractFieldsQuerySelfTest.java   |  34 +-
 .../cache/GridIndexingWithNoopSwapSelfTest.java |   2 +-
 .../IgniteCacheAbstractFieldsQuerySelfTest.java |  26 +-
 .../IgniteCacheQueryMultiThreadedSelfTest.java  |   2 +-
 ...GridCachePartitionedFieldsQuerySelfTest.java |   6 +-
 ...dCacheAbstractReduceFieldsQuerySelfTest.java |  22 +-
 .../ignite/schema/generator/CodeGenerator.java  |   2 +-
 .../ignite/schema/ui/SchemaImportApp.java       |   4 +-
 .../org/apache/ignite/IgniteSpringBean.java     |   2 +-
 .../org/apache/ignite/yardstick/IgniteNode.java |   2 +-
 247 files changed, 4805 insertions(+), 4813 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/952962b8/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
----------------------------------------------------------------------
diff --cc examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
index c29de9d,75c5b7e..4ef9fa2
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
@@@ -73,22 -69,16 +73,22 @@@ public class CacheQueryExample 
              System.out.println();
              System.out.println(">>> Cache query example started.");
  
 -            CacheConfiguration<?, ?> cfg = new CacheConfiguration<>();
 +            CacheConfiguration<?, ?> orgCacheCfg = new CacheConfiguration<>();
 +
 +            orgCacheCfg.setCacheMode(CacheMode.PARTITIONED);
 +            orgCacheCfg.setName(ORGANIZATIONS_CACHE_NAME);
 +            orgCacheCfg.setIndexedTypes(UUID.class, Organization.class);
  
 -            cfg.setCacheMode(CacheMode.PARTITIONED);
 -            cfg.setName(CACHE_NAME);
 -            cfg.setIndexedTypes(
 -                UUID.class, Organization.class,
 -                AffinityKey.class, Person.class
 -            );
 +            CacheConfiguration<?, ?> personCacheCfg = new CacheConfiguration<>();
  
 -            try (IgniteCache<?, ?> cache = ignite.createCache(cfg)) {
 +            personCacheCfg.setCacheMode(CacheMode.PARTITIONED);
 +            personCacheCfg.setName(PERSONS_CACHE_NAME);
-             personCacheCfg.setIndexedTypes(CacheAffinityKey.class, Person.class);
++            personCacheCfg.setIndexedTypes(AffinityKey.class, Person.class);
 +
 +            try (
 +                IgniteCache<?, ?> orgCache = ignite.createCache(orgCacheCfg);
 +                IgniteCache<?, ?> personCache = ignite.createCache(personCacheCfg)
 +            ) {
                  // Populate cache.
                  initialize();
  
@@@ -120,47 -107,33 +120,47 @@@
      }
  
      /**
 +     * Example for scan query based on a predicate.
 +     */
 +    private static void scanQuery() {
-         IgniteCache<CacheAffinityKey<UUID>, Person> cache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
++        IgniteCache<AffinityKey<UUID>, Person> cache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
 +
-         ScanQuery<CacheAffinityKey<UUID>, Person> scan = new ScanQuery<>(
-             new IgniteBiPredicate<CacheAffinityKey<UUID>, Person>() {
-                 @Override public boolean apply(CacheAffinityKey<UUID> key, Person
person) {
++        ScanQuery<AffinityKey<UUID>, Person> scan = new ScanQuery<>(
++            new IgniteBiPredicate<AffinityKey<UUID>, Person>() {
++                @Override public boolean apply(AffinityKey<UUID> key, Person person)
{
 +                    return person.salary <= 1000;
 +                }
 +            }
 +        );
 +
 +        // Execute queries for salary ranges.
 +        print("People with salaries between 0 and 1000 (queried with SCAN query): ", cache.query(scan).getAll());
 +    }
 +
 +    /**
       * Example for SQL queries based on salary ranges.
       */
      private static void sqlQuery() {
-         IgniteCache<CacheAffinityKey<UUID>, Person> cache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
 -        IgniteCache<AffinityKey<UUID>, Person> cache = Ignition.ignite().cache(CACHE_NAME);
++        IgniteCache<AffinityKey<UUID>, Person> cache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
  
          // SQL clause which selects salaries based on range.
          String sql = "salary > ? and salary <= ?";
  
          // Execute queries for salary ranges.
 -        print("People with salaries between 0 and 1000: ",
 +        print("People with salaries between 0 and 1000 (queried with SQL query): ",
-             cache.query(new SqlQuery<CacheAffinityKey<UUID>, Person>(Person.class,
sql).
+             cache.query(new SqlQuery<AffinityKey<UUID>, Person>(Person.class,
sql).
                  setArgs(0, 1000)).getAll());
  
 -        print("People with salaries between 1000 and 2000: ",
 +        print("People with salaries between 1000 and 2000 (queried with SQL query): ",
-             cache.query(new SqlQuery<CacheAffinityKey<UUID>, Person>(Person.class,
sql).
+             cache.query(new SqlQuery<AffinityKey<UUID>, Person>(Person.class,
sql).
                  setArgs(1000, 2000)).getAll());
 -
 -        print("People with salaries greater than 2000: ",
 -            cache.query(new SqlQuery<AffinityKey<UUID>, Person>(Person.class,
sql).
 -                setArgs(2000, Integer.MAX_VALUE)).getAll());
      }
  
      /**
       * Example for SQL queries based on all employees working for a specific organization.
       */
      private static void sqlQueryWithJoin() {
-         IgniteCache<CacheAffinityKey<UUID>, Person> cache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
 -        IgniteCache<AffinityKey<UUID>, Person> cache = Ignition.ignite().cache(CACHE_NAME);
++        IgniteCache<AffinityKey<UUID>, Person> cache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
  
          // SQL clause query which joins on 2 types to select people for a specific organization.
          String joinSql =
@@@ -170,11 -143,10 +170,11 @@@
  
          // Execute queries for find employees for different organizations.
          print("Following people are 'GridGain' employees: ",
-             cache.query(new SqlQuery<CacheAffinityKey<UUID>, Person>(Person.class,
joinSql).
+             cache.query(new SqlQuery<AffinityKey<UUID>, Person>(Person.class,
joinSql).
                  setArgs("GridGain")).getAll());
 +
          print("Following people are 'Other' employees: ",
-             cache.query(new SqlQuery<CacheAffinityKey<UUID>, Person>(Person.class,
joinSql).
+             cache.query(new SqlQuery<AffinityKey<UUID>, Person>(Person.class,
joinSql).
                  setArgs("Other")).getAll());
      }
  
@@@ -182,15 -154,15 +182,15 @@@
       * Example for TEXT queries using LUCENE-based indexing of people's resumes.
       */
      private static void textQuery() {
-         IgniteCache<CacheAffinityKey<UUID>, Person> cache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
 -        IgniteCache<AffinityKey<UUID>, Person> cache = Ignition.ignite().cache(CACHE_NAME);
++        IgniteCache<AffinityKey<UUID>, Person> cache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
  
          //  Query for all people with "Master Degree" in their resumes.
-         QueryCursor<Cache.Entry<CacheAffinityKey<UUID>, Person>> masters
=
-             cache.query(new TextQuery<CacheAffinityKey<UUID>, Person>(Person.class,
"Master"));
+         QueryCursor<Cache.Entry<AffinityKey<UUID>, Person>> masters =
+             cache.query(new TextQuery<AffinityKey<UUID>, Person>(Person.class,
"Master"));
  
          // Query for all people with "Bachelor Degree" in their resumes.
-         QueryCursor<Cache.Entry<CacheAffinityKey<UUID>, Person>> bachelors
=
-             cache.query(new TextQuery<CacheAffinityKey<UUID>, Person>(Person.class,
"Bachelor"));
+         QueryCursor<Cache.Entry<AffinityKey<UUID>, Person>> bachelors
=
+             cache.query(new TextQuery<AffinityKey<UUID>, Person>(Person.class,
"Bachelor"));
  
          print("Following people have 'Master Degree' in their resumes: ", masters.getAll());
          print("Following people have 'Bachelor Degree' in their resumes: ", bachelors.getAll());
@@@ -200,19 -172,15 +200,19 @@@
       * Example for SQL queries to calculate average salary for a specific organization.
       */
      private static void sqlQueryWithAggregation() {
-         IgniteCache<CacheAffinityKey<UUID>, Person> cache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
 -        IgniteCache<AffinityKey<UUID>, Person> cache = Ignition.ignite().cache(CACHE_NAME);
++        IgniteCache<AffinityKey<UUID>, Person> cache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
  
          // Calculate average of salary of all persons in GridGain.
 -        QueryCursor<List<?>> cursor = cache.query(new SqlFieldsQuery("select
avg(salary) from Person, " +
 -            "Organization where Person.orgId = Organization.id and " + "lower(Organization.name)
= lower(?)"
 -        ).setArgs("GridGain"));
 +        String sql =
 +            "select avg(salary) " +
 +            "from Person, \"" + ORGANIZATIONS_CACHE_NAME + "\".Organization as org " +
 +            "where Person.orgId = org.id " +
 +            "and lower(org.name) = lower(?)";
 +
 +        QueryCursor<List<?>> cursor = cache.query(new SqlFieldsQuery(sql).setArgs("GridGain"));
  
          // Calculate average salary for a specific organization.
 -        print("Average salary for 'GridGain' employees: " + cursor.getAll());
 +        print("Average salary for 'GridGain' employees: ", cursor.getAll());
      }
  
      /**
@@@ -265,11 -230,6 +265,11 @@@
          Organization org1 = new Organization("GridGain");
          Organization org2 = new Organization("Other");
  
 +        orgCache.put(org1.id, org1);
 +        orgCache.put(org2.id, org2);
 +
-         IgniteCache<CacheAffinityKey<UUID>, Person> personCache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
++        IgniteCache<AffinityKey<UUID>, Person> personCache = Ignition.ignite().cache(PERSONS_CACHE_NAME);
 +
          // People.
          Person p1 = new Person(org1, "John", "Doe", 2000, "John Doe has Master Degree.");
          Person p2 = new Person(org1, "Jane", "Doe", 1000, "Jane Doe has Bachelor Degree.");

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

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/952962b8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/952962b8/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
----------------------------------------------------------------------


Mime
View raw message