Examples of CountRequest


Examples of com.hazelcast.multimap.impl.client.CountRequest

                return new ContainsRequest();
            }
        };
        constructors[COUNT] = new ConstructorFunction<Integer, Portable>() {
            public Portable createNew(Integer arg) {
                return new CountRequest();
            }
        };
        constructors[ENTRY_SET] = new ConstructorFunction<Integer, Portable>() {
            public Portable createNew(Integer arg) {
                return new EntrySetRequest();
View Full Code Here

Examples of com.hazelcast.multimap.impl.client.CountRequest

    public int valueCount(K key) {
        checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);

        Data keyData = toData(key);
        CountRequest request = new CountRequest(name, keyData, ThreadUtil.getThreadId());
        Integer result = invoke(request, keyData);
        return result;
    }
View Full Code Here

Examples of com.hazelcast.multimap.operations.client.CountRequest

        invoke(request);
    }

    public int valueCount(K key) {
        Data keyData = toData(key);
        CountRequest request = new CountRequest(name, keyData);
        Integer result = invoke(request, keyData);
        return result;
    }
View Full Code Here

Examples of com.hazelcast.multimap.operations.client.CountRequest

                return new ContainsEntryRequest();
            }
        };
        constructors[COUNT] = new ConstructorFunction<Integer, Portable>() {
            public Portable createNew(Integer arg) {
                return new CountRequest();
            }
        };
        constructors[ENTRY_SET] = new ConstructorFunction<Integer, Portable>() {
            public Portable createNew(Integer arg) {
                return new EntrySetRequest();
View Full Code Here

Examples of com.hazelcast.multimap.operations.client.CountRequest

        invoke(request);
    }

    public int valueCount(K key) {
        Data keyData = toData(key);
        CountRequest request = new CountRequest(name, keyData);
        Integer result = invoke(request, keyData);
        return result;
    }
View Full Code Here

Examples of org.elasticsearch.action.count.CountRequest

        this.c = node.client();
        this.deflector = deflector;
    }

    public long total() {
        return c.count(new CountRequest(deflector.getAllDeflectorIndexNames())).actionGet().getCount();
    }
View Full Code Here

Examples of org.elasticsearch.action.count.CountRequest

        return isr.actionGet().getIndices();
    }

    public long getTotalNumberOfMessages() {
        return c.count(new CountRequest(allIndicesAlias())).actionGet().getCount();
    }
View Full Code Here

Examples of org.elasticsearch.action.count.CountRequest

     * @param indices The indices to count matched documents against a query. Use <tt>null</tt> or <tt>_all</tt> to execute against all indices
     * @return The count request
     * @see org.elasticsearch.client.Client#count(org.elasticsearch.action.count.CountRequest)
     */
    public static CountRequest countRequest(String... indices) {
        return new CountRequest(indices);
    }
View Full Code Here

Examples of org.elasticsearch.action.count.CountRequest

* @author kimchy (shay.banon)
*/
public class CountRequestBuilder extends BaseRequestBuilder<CountRequest, CountResponse> {

    public CountRequestBuilder(Client client) {
        super(client, new CountRequest());
    }
View Full Code Here

Examples of org.elasticsearch.action.count.CountRequest

        controller.registerHandler(POST, "/{index}/{type}/_count", this);
        controller.registerHandler(GET, "/{index}/{type}/_count", this);
    }

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        CountRequest countRequest = new CountRequest(RestActions.splitIndices(request.param("index")));
        // we just send back a response, no need to fork a listener
        countRequest.listenerThreaded(false);
        try {
            BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
            if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
                // since we don't spawn, don't allow no_threads, but change it to a single thread
                operationThreading = BroadcastOperationThreading.SINGLE_THREAD;
            }
            countRequest.operationThreading(operationThreading);
            if (request.hasContent()) {
                countRequest.query(request.contentByteArray(), request.contentByteArrayOffset(), request.contentLength(), true);
            } else {
                String source = request.param("source");
                if (source != null) {
                    countRequest.query(source);
                } else {
                    countRequest.query(RestActions.parseQuerySource(request));
                }
            }
            countRequest.queryHint(request.param("query_hint"));
            countRequest.routing(request.param("routing"));
            countRequest.minScore(request.paramAsFloat("min_score", DEFAULT_MIN_SCORE));
            countRequest.types(splitTypes(request.param("type")));
        } catch (Exception e) {
            try {
                XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                channel.sendResponse(new XContentRestResponse(request, BAD_REQUEST, builder.startObject().field("error", e.getMessage()).endObject()));
            } catch (IOException e1) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.