Package org.apache.kafka.clients

Examples of org.apache.kafka.clients.ClientRequest


            produceRecordsByPartition.put(tp, recordsBuffer);
            recordsByPartition.put(tp, batch);
        }
        ProduceRequest request = new ProduceRequest(acks, timeout, produceRecordsByPartition);
        RequestSend send = new RequestSend(destination, this.client.nextRequestHeader(ApiKeys.PRODUCE), request.toStruct());
        return new ClientRequest(now, acks != 0, send, recordsByPartition);
    }
View Full Code Here


        }

        public void updateProduceRequestMetrics(List<ClientRequest> requests) {
            long now = time.milliseconds();
            for (int i = 0; i < requests.size(); i++) {
                ClientRequest request = requests.get(i);
                int records = 0;

                if (request.attachment() != null) {
                    Map<TopicPartition, RecordBatch> responseBatches = (Map<TopicPartition, RecordBatch>) request.attachment();
                    for (RecordBatch batch : responseBatches.values()) {

                        // register all per-topic metrics at once
                        String topic = batch.topicPartition.topic();
                        maybeRegisterTopicMetrics(topic);
View Full Code Here

TOP

Related Classes of org.apache.kafka.clients.ClientRequest

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.