use of org.apache.geode.cache.query.TypeMismatchException in project geode by apache.
the class PartitionedRegionQueryDUnitTest method testReevaluationDueToUpdateInProgress.
@Test
public void testReevaluationDueToUpdateInProgress() {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
// VM vm2 = host.getVM(2);
createPR(vm0);
createPR(vm1);
createIndex(vm0, "compactRangeIndex", "entry.value", "/region.entrySet entry");
// Do Puts
vm0.invoke(new SerializableRunnable("putting data") {
public void run() {
Cache cache = getCache();
Region region = cache.getRegion("region");
for (int i = 0; i < 100; i++) {
region.put(i, new TestObject(i));
}
}
});
vm0.invoke(new SerializableRunnable("resetting sqt") {
public void run() {
IndexManager.setIndexBufferTime(Long.MAX_VALUE, Long.MAX_VALUE);
}
});
vm1.invoke(new SerializableRunnable("resetting sqt") {
public void run() {
IndexManager.setIndexBufferTime(Long.MAX_VALUE, Long.MAX_VALUE);
}
});
vm0.invoke(new SerializableRunnable("query") {
public void run() {
try {
QueryService qs = getCache().getQueryService();
qs.newQuery("SELECT DISTINCT entry.key, entry.value FROM /region.entrySet entry WHERE entry.value.score >= 5 AND entry.value.score <= 10 ORDER BY value asc").execute();
} catch (QueryInvocationTargetException e) {
e.printStackTrace();
fail(e.toString());
} catch (NameResolutionException e) {
fail(e.toString());
} catch (TypeMismatchException e) {
fail(e.toString());
} catch (FunctionDomainException e) {
fail(e.toString());
}
}
});
}
Aggregations