Package com.hazelcast.query

Examples of com.hazelcast.query.Predicate


        Set<Integer> plist = new HashSet<Integer>(partitionCount);
        final ClientEndpoint endpoint = getEndpoint();
        QueryResultSet result = new QueryResultSet(null, iterationType, true);
        try {
            List<Future> flist = new ArrayList<Future>();
            final Predicate predicate = getPredicate();
            for (MemberImpl member : members) {
                Future future = createInvocationBuilder(SERVICE_NAME, new QueryOperation(name, predicate), member.getAddress()).invoke();
                flist.add(future);
            }
            for (Future future : flist) {
View Full Code Here


    @ManagedAnnotation(value = "values", operation = true)
    public String values(String query){
        Collection coll;
        if (query != null && !query.isEmpty()){
            Predicate predicate = new SqlPredicate(query);
            coll = managedObject.values(predicate);
        }
        else {
            coll = managedObject.values();
        }
View Full Code Here

    @ManagedAnnotation(value = "entrySet", operation = true)
    public String entrySet(String query){
        Set<Map.Entry> entrySet;
        if (query != null && !query.isEmpty()){
            Predicate predicate = new SqlPredicate(query);
            entrySet = managedObject.entrySet(predicate);
        }
        else {
            entrySet = managedObject.entrySet();
        }
View Full Code Here

         return this;
      }

      @Override
      public QueryBuilder any(QueryBuilder... subqueries) {
         Predicate p = null;
         for (QueryBuilder subquery : subqueries) {
            if (p == null) {
               p = ((HazelcastQueryBuilder) subquery).predicate;
            } else {
               p = Predicates.or(p, ((HazelcastQueryBuilder) subquery).predicate);
View Full Code Here

         return this;
      }

      @Override
      public Query build() {
         Predicate finalPredicate;
         if (comparator == null) {
            if (limit < 0) finalPredicate = predicate;
            else finalPredicate = new PagingPredicate(predicate, limit);
         } else {
            if (limit < 0) finalPredicate = new PagingPredicate(predicate, comparator, Integer.MAX_VALUE);
View Full Code Here

        Set<Integer> plist = new HashSet<Integer>(partitionCount);
        final ClientEndpoint endpoint = getEndpoint();
        QueryResultSet result = new QueryResultSet(null, iterationType, true);
        try {
            List<Future> futures = new ArrayList<Future>();
            final Predicate predicate = getPredicate();
            createInvocations(members, futures, predicate);
            collectResults(plist, result, futures);
            if (hasMissingPartitions(partitionCount, plist)) {
                List<Integer> missingList = findMissingPartitions(partitionCount, plist);
                List<Future> missingFutures = new ArrayList<Future>(missingList.size());
View Full Code Here

        Set<Integer> plist = new HashSet<Integer>(partitionCount);
        final ClientEndpoint endpoint = getEndpoint();
        QueryResultSet result = new QueryResultSet(null, iterationType, true);
        try {
            List<Future> futures = new ArrayList<Future>();
            final Predicate predicate = getPredicate();
            createInvocations(members, futures, predicate);
            collectResults(plist, result, futures);
            if (hasMissingPartitions(partitionCount, plist)) {
                List<Integer> missingList = findMissingPartitions(partitionCount, plist);
                List<Future> missingFutures = new ArrayList<Future>(missingList.size());
View Full Code Here

        TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(2);
        HazelcastInstance h1 = nodeFactory.newHazelcastInstance();
        HazelcastInstance h2 = nodeFactory.newHazelcastInstance();

        EntryObject e = new PredicateBuilder().getEntryObject();
        Predicate predicate = e.is("active").and(e.get("name").equal(null).and(e.get("city").isNull()));

        IMap imap1 = h1.getMap("employees");
        IMap imap2 = h2.getMap("employees");

        for (int i = 0; i < 5000; i++) {
View Full Code Here

        final int expected = entryPerNode / modulo * nodes;

        for (HazelcastInstance hz : instances) {
            IMap<Object, Object> map = hz.getMap(name);
            EntryObject e = new PredicateBuilder().getEntryObject();
            Predicate p = e.get("name").equal(FIND_ME);
            for (int i = 0; i < 10; i++) {
                int size = map.values(p).size();
                Assert.assertEquals(expected, size);
                Thread.sleep(10);
            }
View Full Code Here

    @Test
    public void testPagingWithFilteringAndComparator() {
        final IMap<Integer, Integer> map = initMap();

        final Predicate lessEqual = Predicates.lessEqual("this", 8);
        final PagingPredicate predicate = new PagingPredicate(lessEqual, new TestComparator(false, IterationType.VALUE), pageSize);

        Collection<Integer> values = map.values(predicate);
        assertIterableEquals(values, 8, 7, 6, 5, 4);
View Full Code Here

TOP

Related Classes of com.hazelcast.query.Predicate

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.