Package com.hazelcast.map

Examples of com.hazelcast.map.QueryResult


            for (MemberImpl member : members) {
                Future future = createInvocationBuilder(SERVICE_NAME, new QueryOperation(name, predicate), member.getAddress()).invoke();
                flist.add(future);
            }
            for (Future future : flist) {
                QueryResult queryResult = (QueryResult) future.get();
                if (queryResult != null) {
                    final List<Integer> partitionIds = queryResult.getPartitionIds();
                    if (partitionIds != null) {
                        plist.addAll(partitionIds);
                        result.addAll(queryResult.getResult());
                    }
                }
            }
            if (plist.size() != partitionCount) {
                List<Integer> missingList = new ArrayList<Integer>();
                for (int i = 0; i < partitionCount; i++) {
                    if (!plist.contains(i)) {
                        missingList.add(i);
                    }
                }
                List<Future> futures = new ArrayList<Future>(missingList.size());
                for (Integer pid : missingList) {
                    QueryPartitionOperation queryPartitionOperation = new QueryPartitionOperation(name, predicate);
                    queryPartitionOperation.setPartitionId(pid);
                    try {
                        Future f = createInvocationBuilder(SERVICE_NAME, queryPartitionOperation, pid).invoke();
                        futures.add(f);
                    } catch (Throwable t) {
                        throw ExceptionUtil.rethrow(t);
                    }
                }
                for (Future future : futures) {
                    QueryResult queryResult = (QueryResult) future.get();
                    result.addAll(queryResult.getResult());
                }
            }
        } catch (Throwable t) {
            throw ExceptionUtil.rethrow(t);
        }
View Full Code Here


        Set<QueryableEntry> entries = null;
        // TODO: fix
        if (!getNodeEngine().getPartitionService().hasOnGoingMigration()) {
            entries = indexService.query(predicate);
        }
        result = new QueryResult();
        if (entries != null) {
            for (QueryableEntry entry : entries) {
                result.add(new QueryResultEntryImpl(entry.getKeyData(), entry.getKeyData(), entry.getValueData()));
            }
        } else {
View Full Code Here

    }

    private void collectResultsFromMissingPartitions(QueryResultSet result, List<Future> futures)
            throws InterruptedException, java.util.concurrent.ExecutionException {
        for (Future future : futures) {
            QueryResult queryResult = (QueryResult) future.get();
            result.addAll(queryResult.getResult());
        }
    }
View Full Code Here

    }

    private void collectResults(Set<Integer> plist, QueryResultSet result, List<Future> flist)
            throws InterruptedException, java.util.concurrent.ExecutionException {
        for (Future future : flist) {
            QueryResult queryResult = (QueryResult) future.get();
            if (queryResult != null) {
                final List<Integer> partitionIds = queryResult.getPartitionIds();
                if (partitionIds != null) {
                    plist.addAll(partitionIds);
                    result.addAll(queryResult.getResult());
                }
            }
        }
    }
View Full Code Here

        Set<QueryableEntry> entries = null;
        // TODO: fix
        if (!getNodeEngine().getPartitionService().hasOnGoingMigration()) {
            entries = indexService.query(predicate);
        }
        result = new QueryResult();
        if (entries != null) {
            for (QueryableEntry entry : entries) {
                result.add(new QueryResultEntryImpl(entry.getKeyData(), entry.getKeyData(), entry.getValueData()));
            }
        } else {
View Full Code Here

    }

    public void run() {
        Collection<QueryableEntry> queryableEntries = mapService.getMapServiceContext().getMapContextQuerySupport()
                .queryOnPartition(name, predicate, getPartitionId());
        result = new QueryResult();
        for (QueryableEntry entry : queryableEntries) {
            result.add(new QueryResultEntryImpl(entry.getKeyData(), entry.getIndexKey(), entry.getValueData()));
        }
        final List<Integer> partitions = Collections.singletonList(getPartitionId());
        result.setPartitionIds(partitions);
View Full Code Here

    }

    private void collectResultsFromMissingPartitions(QueryResultSet result, List<Future> futures)
            throws InterruptedException, java.util.concurrent.ExecutionException {
        for (Future future : futures) {
            QueryResult queryResult = (QueryResult) future.get();
            result.addAll(queryResult.getResult());
        }
    }
View Full Code Here

    }

    private void collectResults(Set<Integer> plist, QueryResultSet result, List<Future> futures)
            throws InterruptedException, java.util.concurrent.ExecutionException {
        for (Future future : futures) {
            QueryResult queryResult = (QueryResult) future.get();
            if (queryResult != null) {
                final List<Integer> partitionIds = queryResult.getPartitionIds();
                if (partitionIds != null) {
                    plist.addAll(partitionIds);
                    result.addAll(queryResult.getResult());
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.map.QueryResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.