You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2016/07/19 14:40:42 UTC
[1/3] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-1232
Repository: ignite
Updated Branches:
refs/heads/1232-1 [created] 81c586583
Merge remote-tracking branch 'remotes/origin/master' into ignite-1232
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d6846ffa
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d6846ffa
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d6846ffa
Branch: refs/heads/1232-1
Commit: d6846ffab680bc065a013f305317ac38ea4e3f4f
Parents: 6c55558 054b4eb
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jul 19 11:19:14 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jul 19 11:19:14 2016 +0300
----------------------------------------------------------------------
.../store/jdbc/CacheAbstractJdbcStore.java | 101 ++++------------
.../cache/store/jdbc/CacheJdbcPojoStore.java | 7 +-
.../store/jdbc/CacheJdbcPojoStoreFactory.java | 26 +++++
.../store/jdbc/JdbcTypesDefaultTransformer.java | 117 +++++++++++++++++++
.../cache/store/jdbc/JdbcTypesTransformer.java | 39 +++++++
5 files changed, 207 insertions(+), 83 deletions(-)
----------------------------------------------------------------------
[3/3] ignite git commit: ignite-1232
Posted by sb...@apache.org.
ignite-1232
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/81c58658
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/81c58658
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/81c58658
Branch: refs/heads/1232-1
Commit: 81c58658310f875843561ebb4e836e54ba6515e0
Parents: 5579048
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jul 19 16:21:36 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jul 19 17:07:50 2016 +0300
----------------------------------------------------------------------
.../cache/query/GridCacheTwoStepQuery.java | 36 ++++++++
.../processors/query/h2/IgniteH2Indexing.java | 31 ++++++-
.../query/h2/twostep/GridMapQueryExecutor.java | 53 ++++++------
.../h2/twostep/GridReduceQueryExecutor.java | 87 +++++++++-----------
.../h2/twostep/msg/GridH2QueryRequest.java | 12 +--
5 files changed, 134 insertions(+), 85 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/81c58658/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
index eacf59c..8dcba2f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
@@ -60,6 +60,12 @@ public class GridCacheTwoStepQuery {
/** */
private boolean skipMergeTbl;
+ /** */
+ private List<Integer> caches;
+
+ /** */
+ private List<Integer> extraCaches;
+
/**
* @param schemas Schema names in query.
* @param tbls Tables in query.
@@ -162,6 +168,34 @@ public class GridCacheTwoStepQuery {
}
/**
+ * @return Caches.
+ */
+ public List<Integer> caches() {
+ return caches;
+ }
+
+ /**
+ * @param caches Caches.
+ */
+ public void caches(List<Integer> caches) {
+ this.caches = caches;
+ }
+
+ /**
+ * @return Caches.
+ */
+ public List<Integer> extraCaches() {
+ return extraCaches;
+ }
+
+ /**
+ * @param extraCaches Caches.
+ */
+ public void extraCaches(List<Integer> extraCaches) {
+ this.extraCaches = extraCaches;
+ }
+
+ /**
* @return Spaces.
*/
public Collection<String> spaces() {
@@ -191,6 +225,8 @@ public class GridCacheTwoStepQuery {
GridCacheTwoStepQuery cp = new GridCacheTwoStepQuery(schemas, tbls);
+ cp.caches = caches;
+ cp.extraCaches = extraCaches;
cp.spaces = spaces;
cp.rdc = rdc.copy(args);
cp.skipMergeTbl = skipMergeTbl;
http://git-wip-us.apache.org/repos/asf/ignite/blob/81c58658/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 2153c18..3012f79 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -107,6 +107,7 @@ import org.apache.ignite.internal.util.lang.IgniteInClosure2X;
import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeGuard;
import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.LT;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.SB;
@@ -1147,15 +1148,41 @@ public class IgniteH2Indexing implements GridQueryIndexing {
twoStepQry = GridSqlQuerySplitter.split((JdbcPreparedStatement)stmt, qry.getArgs(), grpByCollocated,
distributedJoins);
+ List<Integer> caches;
+ List<Integer> extraCaches = null;
+
// Setup spaces from schemas.
if (!twoStepQry.schemas().isEmpty()) {
Collection<String> spaces = new ArrayList<>(twoStepQry.schemas().size());
+ caches = new ArrayList<>(twoStepQry.schemas().size() + 1);
+ caches.add(cctx.cacheId());
+
+ for (String schema : twoStepQry.schemas()) {
+ String space0 = space(schema);
+
+ spaces.add(space0);
- for (String schema : twoStepQry.schemas())
- spaces.add(space(schema));
+ if (!F.eq(space0, space)) {
+ int cacheId = CU.cacheId(space0);
+
+ caches.add(cacheId);
+
+ if (extraCaches == null)
+ extraCaches = new ArrayList<>();
+
+ extraCaches.add(cacheId);
+ }
+ }
twoStepQry.spaces(spaces);
}
+ else {
+ caches = Collections.singletonList(cctx.cacheId());
+ extraCaches = null;
+ }
+
+ twoStepQry.caches(caches);
+ twoStepQry.extraCaches(extraCaches);
meta = meta(stmt.getMetaData());
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/81c58658/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index 3238134..d7b6cb0 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -70,6 +70,7 @@ import org.apache.ignite.internal.util.typedef.CI1;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.X;
+import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.plugin.extensions.communication.Message;
@@ -265,19 +266,6 @@ public class GridMapQueryExecutor {
}
/**
- * @param cacheName Cache name.
- * @return Cache context or {@code null} if none.
- */
- @Nullable private GridCacheContext<?,?> cacheContext(String cacheName) {
- GridCacheAdapter<?,?> cache = ctx.cache().internalCache(cacheName);
-
- if (cache == null)
- return null;
-
- return cache.context();
- }
-
- /**
* @param cctx Cache context.
* @param p Partition ID.
* @return Partition.
@@ -287,7 +275,7 @@ public class GridMapQueryExecutor {
}
/**
- * @param cacheNames Cache names.
+ * @param cacheIds Cache IDs.
* @param topVer Topology version.
* @param explicitParts Explicit partitions list.
* @param reserved Reserved list.
@@ -295,7 +283,7 @@ public class GridMapQueryExecutor {
* @throws IgniteCheckedException If failed.
*/
private boolean reservePartitions(
- Collection<String> cacheNames,
+ List<Integer> cacheIds,
AffinityTopologyVersion topVer,
final int[] explicitParts,
List<GridReservable> reserved
@@ -304,8 +292,8 @@ public class GridMapQueryExecutor {
Collection<Integer> partIds = wrap(explicitParts);
- for (String cacheName : cacheNames) {
- GridCacheContext<?, ?> cctx = cacheContext(cacheName);
+ for (int i = 0; i < cacheIds.size(); i++) {
+ GridCacheContext<?, ?> cctx = ctx.cache().context().cacheContext(cacheIds.get(i));
if (cctx == null) // Cache was not found, probably was not deployed yet.
return false;
@@ -427,12 +415,23 @@ public class GridMapQueryExecutor {
* @param req Query request.
*/
private void onQueryRequest(ClusterNode node, GridQueryRequest req) {
- List<String> caches = (List<String>)F.concat(true, req.space(), req.extraSpaces());
+ List<Integer> cacheIds;
+
+ if (req.extraSpaces() != null) {
+ cacheIds = new ArrayList<>(req.extraSpaces().size() + 1);
+
+ cacheIds.add(CU.cacheId(req.space()));
+
+ for (String extraSpace : req.extraSpaces())
+ cacheIds.add(CU.cacheId(extraSpace));
+ }
+ else
+ cacheIds = Collections.singletonList(CU.cacheId(req.space()));
onQueryRequest0(node,
req.requestId(),
req.queries(),
- caches,
+ cacheIds,
req.topologyVersion(),
null,
req.partitions(),
@@ -465,7 +464,7 @@ public class GridMapQueryExecutor {
* @param node Node authored request.
* @param reqId Request ID.
* @param qrys Queries to execute.
- * @param caches Caches which will be affected by these queries.
+ * @param cacheIds Caches which will be affected by these queries.
* @param topVer Topology version.
* @param partsMap Partitions map for unstable topology.
* @param parts Explicit partitions for current node.
@@ -477,7 +476,7 @@ public class GridMapQueryExecutor {
ClusterNode node,
long reqId,
Collection<GridCacheSqlQuery> qrys,
- List<String> caches,
+ List<Integer> cacheIds,
AffinityTopologyVersion topVer,
Map<UUID, int[]> partsMap,
int[] parts,
@@ -494,20 +493,18 @@ public class GridMapQueryExecutor {
try {
if (topVer != null) {
// Reserve primary for topology version or explicit partitions.
- if (!reservePartitions(caches, topVer, parts, reserved)) {
+ if (!reservePartitions(cacheIds, topVer, parts, reserved)) {
sendRetry(node, reqId);
return;
}
}
- String mainCache = caches.get(0);
-
// Prepare to run queries.
- GridCacheContext<?,?> mainCctx = cacheContext(mainCache);
+ GridCacheContext<?, ?> mainCctx = ctx.cache().context().cacheContext(cacheIds.get(0));
if (mainCctx == null)
- throw new CacheException("Failed to find cache: " + mainCache);
+ throw new CacheException("Failed to find cache.");
qr = new QueryResults(reqId, qrys.size(), mainCctx);
@@ -542,7 +539,7 @@ public class GridMapQueryExecutor {
}
}
- Connection conn = h2.connectionForSpace(mainCache);
+ Connection conn = h2.connectionForSpace(mainCctx.name());
// Here we enforce join order to have the same behavior on all the nodes.
h2.setupConnection(conn, distributedJoins, true);
@@ -569,7 +566,7 @@ public class GridMapQueryExecutor {
int i = 0;
for (GridCacheSqlQuery qry : qrys) {
- ResultSet rs = h2.executeSqlQueryWithTimer(mainCache, conn, qry.query(),
+ ResultSet rs = h2.executeSqlQueryWithTimer(mainCctx.name(), conn, qry.query(),
F.asList(qry.parameters()), true);
if (ctx.event().isRecordable(EVT_CACHE_QUERY_EXECUTED)) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/81c58658/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 5c2ff29..7727b46 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -362,13 +362,13 @@ public class GridReduceQueryExecutor {
* @param extraSpaces Extra spaces.
* @return {@code true} If preloading is active.
*/
- private boolean isPreloadingActive(final GridCacheContext<?,?> cctx, List<String> extraSpaces) {
+ private boolean isPreloadingActive(final GridCacheContext<?,?> cctx, List<Integer> extraSpaces) {
if (hasMovingPartitions(cctx))
return true;
if (extraSpaces != null) {
- for (String extraSpace : extraSpaces) {
- if (hasMovingPartitions(cacheContext(extraSpace)))
+ for (int i = 0; i < extraSpaces.size(); i++) {
+ if (hasMovingPartitions(cacheContext(extraSpaces.get(i))))
return true;
}
}
@@ -392,11 +392,11 @@ public class GridReduceQueryExecutor {
}
/**
- * @param name Cache name.
+ * @param cacheId Cache ID.
* @return Cache context.
*/
- private GridCacheContext<?,?> cacheContext(String name) {
- return ctx.cache().internalCache(name).context();
+ private GridCacheContext<?,?> cacheContext(Integer cacheId) {
+ return ctx.cache().context().cacheContext(cacheId);
}
/**
@@ -407,19 +407,19 @@ public class GridReduceQueryExecutor {
*/
private Collection<ClusterNode> stableDataNodes(
AffinityTopologyVersion topVer,
- final GridCacheContext<?,?> cctx,
- List<String> extraSpaces
+ final GridCacheContext<?, ?> cctx,
+ List<Integer> extraSpaces
) {
- String space = cctx.name();
-
Set<ClusterNode> nodes = new HashSet<>(cctx.affinity().assignment(topVer).primaryPartitionNodes());
if (F.isEmpty(nodes))
- throw new CacheException("Failed to find data nodes for cache: " + space);
+ throw new CacheException("Failed to find data nodes for cache: " + cctx.name());
if (!F.isEmpty(extraSpaces)) {
- for (String extraSpace : extraSpaces) {
- GridCacheContext<?,?> extraCctx = cacheContext(extraSpace);
+ for (int i = 0; i < extraSpaces.size(); i++) {
+ GridCacheContext<?,?> extraCctx = cacheContext(extraSpaces.get(i));
+
+ String extraSpace = extraCctx.name();
if (extraCctx.isLocal())
continue; // No consistency guaranties for local caches.
@@ -503,7 +503,7 @@ public class GridReduceQueryExecutor {
* @return Cursor.
*/
public Iterator<List<?>> query(
- GridCacheContext<?,?> cctx,
+ GridCacheContext<?, ?> cctx,
GridCacheTwoStepQuery qry,
boolean keepPortable,
boolean enforceJoinOrder
@@ -528,7 +528,7 @@ public class GridReduceQueryExecutor {
AffinityTopologyVersion topVer = h2.readyTopologyVersion();
- List<String> extraSpaces = extraSpaces(space, qry.spaces());
+ List<Integer> extraSpaces = qry.extraCaches();
Collection<ClusterNode> nodes;
@@ -619,12 +619,18 @@ public class GridReduceQueryExecutor {
if (send(nodes,
oldStyle ?
- new GridQueryRequest(qryReqId, r.pageSize, space, mapQrys, topVer, extraSpaces, null) :
+ new GridQueryRequest(qryReqId,
+ r.pageSize,
+ space,
+ mapQrys,
+ topVer,
+ extraSpaces(space, qry.spaces()),
+ null) :
new GridH2QueryRequest()
.requestId(qryReqId)
.topologyVersion(topVer)
.pageSize(r.pageSize)
- .caches(join(space, extraSpaces))
+ .caches(qry.caches())
.tables(distributedJoins ? qry.tables() : null)
.partitions(convert(partsMap))
.queries(mapQrys)
@@ -851,8 +857,8 @@ public class GridReduceQueryExecutor {
* @param extraSpaces Extra spaces.
* @return Collection of all data nodes owning all the caches or {@code null} for retry.
*/
- private Collection<ClusterNode> replicatedUnstableDataNodes(final GridCacheContext<?,?> cctx,
- List<String> extraSpaces) {
+ private Collection<ClusterNode> replicatedUnstableDataNodes(final GridCacheContext<?, ?> cctx,
+ List<Integer> extraSpaces) {
assert cctx.isReplicated() : cctx.name() + " must be replicated";
Set<ClusterNode> nodes = replicatedUnstableDataNodes(cctx);
@@ -861,15 +867,15 @@ public class GridReduceQueryExecutor {
return null; // Retry.
if (!F.isEmpty(extraSpaces)) {
- for (String extraSpace : extraSpaces) {
- GridCacheContext<?,?> extraCctx = cacheContext(extraSpace);
+ for (int i = 0; i < extraSpaces.size(); i++) {
+ GridCacheContext<?, ?> extraCctx = cacheContext(extraSpaces.get(i));
if (extraCctx.isLocal())
continue;
if (!extraCctx.isReplicated())
throw new CacheException("Queries running on replicated cache should not contain JOINs " +
- "with tables in partitioned caches [rCache=" + cctx.name() + ", pCache=" + extraSpace + "]");
+ "with tables in partitioned caches [rCache=" + cctx.name() + ", pCache=" + extraCctx.name() + "]");
Set<ClusterNode> extraOwners = replicatedUnstableDataNodes(extraCctx);
@@ -938,14 +944,14 @@ public class GridReduceQueryExecutor {
*/
@SuppressWarnings("unchecked")
private Map<ClusterNode, IntArray> partitionedUnstableDataNodes(final GridCacheContext<?,?> cctx,
- List<String> extraSpaces) {
+ List<Integer> extraSpaces) {
assert !cctx.isReplicated() && !cctx.isLocal() : cctx.name() + " must be partitioned";
final int partsCnt = cctx.affinity().partitions();
if (extraSpaces != null) { // Check correct number of partitions for partitioned caches.
- for (String extraSpace : extraSpaces) {
- GridCacheContext<?,?> extraCctx = cacheContext(extraSpace);
+ for (int i = 0; i < extraSpaces.size(); i++) {
+ GridCacheContext<?, ?> extraCctx = cacheContext(extraSpaces.get(i));
if (extraCctx.isReplicated() || extraCctx.isLocal())
continue;
@@ -954,7 +960,7 @@ public class GridReduceQueryExecutor {
if (parts != partsCnt)
throw new CacheException("Number of partitions must be the same for correct collocation [cache1=" +
- cctx.name() + ", parts1=" + partsCnt + ", cache2=" + extraSpace + ", parts2=" + parts + "]");
+ cctx.name() + ", parts1=" + partsCnt + ", cache2=" + extraCctx.name() + ", parts2=" + parts + "]");
}
}
@@ -977,8 +983,8 @@ public class GridReduceQueryExecutor {
if (extraSpaces != null) {
// Find owner intersections for each participating partitioned cache partition.
// We need this for logical collocation between different partitioned caches with the same affinity.
- for (String extraSpace : extraSpaces) {
- GridCacheContext<?,?> extraCctx = cacheContext(extraSpace);
+ for (int i = 0; i < extraSpaces.size(); i++) {
+ GridCacheContext<?, ?> extraCctx = cacheContext(extraSpaces.get(i));
if (extraCctx.isReplicated() || extraCctx.isLocal())
continue;
@@ -987,10 +993,10 @@ public class GridReduceQueryExecutor {
List<ClusterNode> owners = extraCctx.topology().owners(p);
if (F.isEmpty(owners)) {
- if (!F.isEmpty(dataNodes(extraSpace, NONE)))
+ if (!F.isEmpty(dataNodes(extraCctx.name(), NONE)))
return null; // Retry.
- throw new CacheException("Failed to find data nodes [cache=" + extraSpace + ", part=" + p + "]");
+ throw new CacheException("Failed to find data nodes [cache=" + extraCctx.name() + ", part=" + p + "]");
}
if (partLocs[p] == null)
@@ -1005,8 +1011,8 @@ public class GridReduceQueryExecutor {
}
// Filter nodes where not all the replicated caches loaded.
- for (String extraSpace : extraSpaces) {
- GridCacheContext<?,?> extraCctx = cacheContext(extraSpace);
+ for (int i = 0; i < extraSpaces.size(); i++) {
+ GridCacheContext<?,?> extraCctx = cacheContext(extraSpaces.get(i));
if (!extraCctx.isReplicated())
continue;
@@ -1161,23 +1167,6 @@ public class GridReduceQueryExecutor {
}
/**
- * @param first First element.
- * @param rest Other elements.
- * @return New joined list.
- */
- private static <Z> List<Z> join(Z first, List<Z> rest) {
- if (F.isEmpty(rest))
- return Collections.singletonList(first);
-
- List<Z> res = new ArrayList<>(rest.size() + 1);
-
- res.add(first);
- res.addAll(rest);
-
- return res;
- }
-
- /**
* @param ints Ints.
* @return Array.
*/
http://git-wip-us.apache.org/repos/asf/ignite/blob/81c58658/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2QueryRequest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2QueryRequest.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2QueryRequest.java
index 3b200c5..dc82b2c 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2QueryRequest.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2QueryRequest.java
@@ -55,8 +55,8 @@ public class GridH2QueryRequest implements Message, GridCacheQueryMarshallable {
/** */
@GridToStringInclude
- @GridDirectCollection(String.class)
- private List<String> caches;
+ @GridDirectCollection(Integer.class)
+ private List<Integer> caches;
/** Topology version. */
private AffinityTopologyVersion topVer;
@@ -120,7 +120,7 @@ public class GridH2QueryRequest implements Message, GridCacheQueryMarshallable {
* @param caches Caches.
* @return {@code this}.
*/
- public GridH2QueryRequest caches(List<String> caches) {
+ public GridH2QueryRequest caches(List<Integer> caches) {
this.caches = caches;
return this;
@@ -129,7 +129,7 @@ public class GridH2QueryRequest implements Message, GridCacheQueryMarshallable {
/**
* @return Caches.
*/
- public List<String> caches() {
+ public List<Integer> caches() {
return caches;
}
@@ -250,7 +250,7 @@ public class GridH2QueryRequest implements Message, GridCacheQueryMarshallable {
switch (writer.state()) {
case 0:
- if (!writer.writeCollection("caches", caches, MessageCollectionItemType.STRING))
+ if (!writer.writeCollection("caches", caches, MessageCollectionItemType.INT))
return false;
writer.incrementState();
@@ -311,7 +311,7 @@ public class GridH2QueryRequest implements Message, GridCacheQueryMarshallable {
switch (reader.state()) {
case 0:
- caches = reader.readCollection("caches", MessageCollectionItemType.STRING);
+ caches = reader.readCollection("caches", MessageCollectionItemType.INT);
if (!reader.isLastRead())
return false;
[2/3] ignite git commit: ignite-1232
Posted by sb...@apache.org.
ignite-1232
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5579048b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5579048b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5579048b
Branch: refs/heads/1232-1
Commit: 5579048b10ef9b720f8f2244ab981e6215e70628
Parents: d6846ff
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jul 19 11:20:29 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jul 19 11:20:29 2016 +0300
----------------------------------------------------------------------
...iteCacheDistributedJoinQueryConditionsTest.java | 16 ++++++++++++++++
.../cache/IgniteCrossCachesJoinsQueryTest.java | 17 ++++++++++++++++-
.../query/IgniteSqlSchemaIndexingTest.java | 3 ++-
3 files changed, 34 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5579048b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinQueryConditionsTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinQueryConditionsTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinQueryConditionsTest.java
index 934e16b..af56c91 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinQueryConditionsTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinQueryConditionsTest.java
@@ -23,6 +23,7 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheMemoryMode;
import org.apache.ignite.cache.QueryEntity;
import org.apache.ignite.cache.QueryIndex;
import org.apache.ignite.cache.affinity.Affinity;
@@ -39,6 +40,8 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.PRIMARY;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
+import static org.apache.ignite.cache.CacheMemoryMode.ONHEAP_TIERED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
/**
@@ -60,6 +63,9 @@ public class IgniteCacheDistributedJoinQueryConditionsTest extends GridCommonAbs
/** */
private int total;
+ /** */
+ private CacheMemoryMode memMode = ONHEAP_TIERED;
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -99,6 +105,15 @@ public class IgniteCacheDistributedJoinQueryConditionsTest extends GridCommonAbs
}
/**
+ * @throws Exception If failed.
+ */
+ public void testJoinQuery1Offheap() throws Exception {
+ memMode = OFFHEAP_TIERED;
+
+ testJoinQuery1();
+ }
+
+ /**
* @param idx Use index flag.
* @throws Exception If failed.
*/
@@ -567,6 +582,7 @@ public class IgniteCacheDistributedJoinQueryConditionsTest extends GridCommonAbs
ccfg.setAtomicWriteOrderMode(PRIMARY);
ccfg.setAtomicityMode(ATOMIC);
ccfg.setBackups(0);
+ ccfg.setMemoryMode(memMode);
return ccfg;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5579048b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCrossCachesJoinsQueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCrossCachesJoinsQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCrossCachesJoinsQueryTest.java
index 4633df7..0dd9281 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCrossCachesJoinsQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCrossCachesJoinsQueryTest.java
@@ -35,6 +35,7 @@ import java.util.concurrent.Callable;
import javax.cache.CacheException;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheMemoryMode;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.QueryEntity;
import org.apache.ignite.cache.QueryIndex;
@@ -55,6 +56,8 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.testframework.GridTestUtils;
+import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
+import static org.apache.ignite.cache.CacheMemoryMode.ONHEAP_TIERED;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
@@ -97,6 +100,9 @@ public class IgniteCrossCachesJoinsQueryTest extends AbstractH2CompareQueryTest
/** */
private static Random rnd;
+ /** */
+ private CacheMemoryMode memMode = ONHEAP_TIERED;
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -334,6 +340,15 @@ public class IgniteCrossCachesJoinsQueryTest extends AbstractH2CompareQueryTest
/**
* @throws Exception If failed.
*/
+ public void testDistributedJoins1Offheap() throws Exception {
+ memMode = OFFHEAP_TIERED;
+
+ testDistributedJoins1();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testDistributedJoins2() throws Exception {
distributedJoins = true;
@@ -727,7 +742,7 @@ public class IgniteCrossCachesJoinsQueryTest extends AbstractH2CompareQueryTest
CacheConfiguration ccfg = new CacheConfiguration();
ccfg.setName(cacheName);
-
+ ccfg.setMemoryMode(memMode);
ccfg.setCacheMode(cacheMode);
if (cacheMode == PARTITIONED)
http://git-wip-us.apache.org/repos/asf/ignite/blob/5579048b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemaIndexingTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemaIndexingTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemaIndexingTest.java
index 0cd8d13..88f1f1e 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemaIndexingTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemaIndexingTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.query;
import java.util.List;
import java.util.concurrent.Callable;
+import javax.cache.CacheException;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteLogger;
@@ -185,7 +186,7 @@ public class IgniteSqlSchemaIndexingTest extends GridCommonAbstractTest {
cache.query(qryWrong);
return null;
}
- }, IgniteException.class, "Failed to parse query");
+ }, CacheException.class, "Failed to parse query");
SqlFieldsQuery qryCorrect = new SqlFieldsQuery("select f.\"id\", f.\"name\" " +
"from \""+schemaName+"\".\"Fact\" f");