Skip to content

Commit

Permalink
ignite-sql-tests - compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
S.Vladykin committed Mar 13, 2015
1 parent 8c4e322 commit 20afb30
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 41 deletions.
Expand Up @@ -73,9 +73,6 @@ public static IgniteConfiguration configure() throws IgniteException {
// Set atomicity as transaction, since we are showing transactions in example.
cacheCfg.setAtomicityMode(TRANSACTIONAL);

// Set query indexing enabled for use query in example.
cacheCfg.setQueryIndexEnabled(true);

CacheStore<Long, Person> store;

// Uncomment other cache stores to try them.
Expand Down
Expand Up @@ -580,27 +580,27 @@ public GridIoMessageFactory(MessageFactory[] ext) {

break;

case 90:
case 106:
msg = new GridQueryCancelRequest();

break;

case 91:
case 107:
msg = new GridQueryFailResponse();

break;

case 92:
case 108:
msg = new GridQueryNextPageRequest();

break;

case 93:
case 109:
msg = new GridQueryNextPageResponse();

break;

case 94:
case 110:
msg = new GridQueryRequest();

break;
Expand Down
Expand Up @@ -96,7 +96,7 @@ else if (id == 0)
if (ctx.isSwapOrOffheapEnabled()) {
if (ctx.swap().swapEnabled()) {
if (GridQueryProcessor.isEnabled(ctx.config())) {
Iterator<Map.Entry<K, V>> it = null;
Iterator<KeyCacheObject> it = null;

try {
it = ctx.swap().swapKeyIterator(true, true, -1L);
Expand Down
Expand Up @@ -24,6 +24,7 @@
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.query.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
Expand Down Expand Up @@ -273,7 +274,7 @@ protected CacheObject toCacheObject0(@Nullable Object obj, boolean userObj) {
return new CacheObjectContext(ctx,
new GridCacheDefaultAffinityKeyMapper(),
ccfg.isCopyOnRead() && memMode == ONHEAP_TIERED,
ctx.config().isPeerClassLoadingEnabled() || ccfg.isQueryIndexEnabled());
ctx.config().isPeerClassLoadingEnabled() || GridQueryProcessor.isEnabled(ccfg));
}
else
return new CacheObjectContext(
Expand Down
Expand Up @@ -125,7 +125,7 @@ public void initializeCache(CacheConfiguration<?, ?> ccfg) throws IgniteCheckedE
for (CacheTypeMetadata meta : ccfg.getTypeMetadata()) {
declaredTypes.put(new TypeName(ccfg.getName(), meta.getValueType()), meta);

int valTypeId = ctx.portable().typeId(meta.getValueType());
int valTypeId = ctx.cacheObjects().typeId(meta.getValueType());

portableIds.put(valTypeId, meta.getValueType());

Expand Down Expand Up @@ -351,8 +351,8 @@ public <K, V> void store(final String space, final K key, @Nullable byte[] keyBy

TypeId id;

if (ctx.portable().isPortableObject(val)) {
int typeId = ctx.portable().typeId(val);
if (ctx.cacheObjects().isPortableObject(val)) {
int typeId = ctx.cacheObjects().typeId(val);

String typeName = portableName(typeId);

Expand Down Expand Up @@ -1355,17 +1355,17 @@ private PortableProperty(String propName, PortableProperty parent, Class<?> type
if (obj == null)
return null;

if (!ctx.portable().isPortableObject(obj))
if (!ctx.cacheObjects().isPortableObject(obj))
throw new IgniteCheckedException("Non-portable object received as a result of property extraction " +
"[parent=" + parent + ", propName=" + propName + ", obj=" + obj + ']');
}
else {
int isKeyProp0 = isKeyProp;

if (isKeyProp0 == 0) {
if (ctx.portable().hasField(key, propName))
if (ctx.cacheObjects().hasField(key, propName))
isKeyProp = isKeyProp0 = 1;
else if (ctx.portable().hasField(val, propName))
else if (ctx.cacheObjects().hasField(val, propName))
isKeyProp = isKeyProp0 = -1;
else {
U.warn(log, "Neither key nor value have property " +
Expand All @@ -1378,7 +1378,7 @@ else if (ctx.portable().hasField(val, propName))
obj = isKeyProp0 == 1 ? key : val;
}

return ctx.portable().field(obj, propName);
return ctx.cacheObjects().field(obj, propName);
}

/** {@inheritDoc} */
Expand Down
Expand Up @@ -101,7 +101,7 @@ public long queryRequestId() {

/** {@inheritDoc} */
@Override public byte directType() {
return 90;
return 106;
}

/** {@inheritDoc} */
Expand Down
Expand Up @@ -130,7 +130,7 @@ public String error() {

/** {@inheritDoc} */
@Override public byte directType() {
return 91;
return 107;
}

/** {@inheritDoc} */
Expand Down
Expand Up @@ -157,7 +157,7 @@ public int pageSize() {

/** {@inheritDoc} */
@Override public byte directType() {
return 92;
return 108;
}

/** {@inheritDoc} */
Expand Down
Expand Up @@ -230,7 +230,7 @@ public byte[] rows() {

/** {@inheritDoc} */
@Override public byte directType() {
return 93;
return 109;
}

/** {@inheritDoc} */
Expand Down
Expand Up @@ -201,7 +201,7 @@ public Collection<GridCacheSqlQuery> queries(Marshaller m) throws IgniteCheckedE

/** {@inheritDoc} */
@Override public byte directType() {
return 94;
return 110;
}

/** {@inheritDoc} */
Expand Down
Expand Up @@ -25,14 +25,12 @@
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.query.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
import org.apache.ignite.testframework.junits.common.*;

import javax.cache.*;
import java.util.*;
import java.util.concurrent.*;

Expand Down Expand Up @@ -293,21 +291,6 @@ private static int i(List<?> l, int idx){
return ((Number)l.get(idx)).intValue();
}

/** @throws Exception If failed. */
public void testOnProjection() throws Exception {
CacheProjection<Integer, FactPurchase> prj = ((IgniteKernal)ignite)
.<Integer, FactPurchase>cache("partitioned").projection(
new IgnitePredicate<Cache.Entry<Integer, FactPurchase>>() {
@Override public boolean apply(Cache.Entry<Integer, FactPurchase> e) {
return e.getKey() > 12;
}
});

List<Map.Entry<Integer, FactPurchase>> res = body(prj);

check(res);
}

/**
* @throws IgniteCheckedException If failed.
*/
Expand Down
Expand Up @@ -40,7 +40,6 @@

import static org.apache.ignite.cache.CacheAtomicityMode.*;
import static org.apache.ignite.cache.CacheMode.*;
import static org.apache.ignite.cache.CachePreloadMode.*;

/**
* Tests for fields queries.
Expand Down Expand Up @@ -93,7 +92,7 @@ protected CacheConfiguration cache(@Nullable String name, boolean primitives) {
cache.setCacheMode(cacheMode());
cache.setAtomicityMode(atomicityMode());
cache.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cache.setPreloadMode(SYNC);
cache.setRebalanceMode(CacheRebalanceMode.SYNC);

List<Class<?>> indexedTypes = new ArrayList<>(F.<Class<?>>asList(
String.class, Organization.class
Expand Down
Expand Up @@ -34,6 +34,7 @@
import org.apache.ignite.testframework.junits.common.*;
import org.jetbrains.annotations.*;

import javax.cache.*;
import javax.cache.configuration.*;
import javax.cache.integration.*;
import java.io.*;
Expand Down

0 comments on commit 20afb30

Please sign in to comment.