Skip to content

Commit 1d6fb53

Browse files
authored
Merge pull request confluentinc#2 from mapr/mapr-26494
Mapr 26494
2 parents 4b0f968 + 96dc364 commit 1d6fb53

25 files changed

+49
-49
lines changed

confluent_kafka/kafkatest/README

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/consumer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Example high-level Kafka 0.9 balanced Consumer
2020
#
2121

22-
from confluent_kafka import Consumer, KafkaException, KafkaError
22+
from mapr_streams_python import Consumer, KafkaException, KafkaError
2323
import sys
2424

2525
if __name__ == '__main__':

examples/integration_test.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
""" Test script for confluent_kafka module """
2121

22-
import confluent_kafka
22+
import mapr_streams_python
2323
import re
2424
import time
2525
import uuid
@@ -83,7 +83,7 @@ def verify_producer():
8383
'default.topic.config':{'produce.offset.report': True}}
8484

8585
# Create producer
86-
p = confluent_kafka.Producer(**conf)
86+
p = mapr_streams_python.Producer(**conf)
8787
print('producer at %s' % p)
8888

8989
# Produce some messages
@@ -117,7 +117,7 @@ def verify_producer_performance(with_dr_cb=True):
117117
""" Time how long it takes to produce and delivery X messages """
118118
conf = {'error_cb': error_cb}
119119

120-
p = confluent_kafka.Producer(**conf)
120+
p = mapr_streams_python.Producer(**conf)
121121

122122
topic = '/test_stream:topic3'
123123
msgcnt = 1000000
@@ -216,7 +216,7 @@ def verify_consumer():
216216
}}
217217

218218
# Create consumer
219-
c = confluent_kafka.Consumer(**conf)
219+
c = mapr_streams_python.Consumer(**conf)
220220

221221
# Subscribe to a list of topics
222222
c.subscribe(["test"])
@@ -233,7 +233,7 @@ def verify_consumer():
233233
raise Exception('Got timeout from poll() without a timeout set: %s' % msg)
234234

235235
if msg.error():
236-
if msg.error().code() == confluent_kafka.KafkaError._PARTITION_EOF:
236+
if msg.error().code() == mapr_streams_python.KafkaError._PARTITION_EOF:
237237
print('Reached end of %s [%d] at offset %d' % \
238238
(msg.topic(), msg.partition(), msg.offset()))
239239
break
@@ -263,8 +263,8 @@ def verify_consumer():
263263

264264

265265
# Start a new client and get the committed offsets
266-
c = confluent_kafka.Consumer(**conf)
267-
offsets = c.committed(list(map(lambda p: confluent_kafka.TopicPartition("test", p), range(0,3))))
266+
c = mapr_streams_python.Consumer(**conf)
267+
offsets = c.committed(list(map(lambda p: mapr_streams_python.TopicPartition("test", p), range(0, 3))))
268268
for tp in offsets:
269269
print(tp)
270270

@@ -283,7 +283,7 @@ def verify_consumer_performance():
283283
'auto.offset.reset': 'earliest'
284284
}}
285285

286-
c = confluent_kafka.Consumer(**conf)
286+
c = mapr_streams_python.Consumer(**conf)
287287

288288
def my_on_assign (consumer, partitions):
289289
print('on_assign:', len(partitions), 'partitions:')
@@ -318,11 +318,11 @@ def my_on_revoke (consumer, partitions):
318318
(msgcnt, max_msgcnt))
319319

320320
if msg.error():
321-
if msg.error().code() == confluent_kafka.KafkaError._PARTITION_EOF:
321+
if msg.error().code() == mapr_streams_python.KafkaError._PARTITION_EOF:
322322
# Reached EOF for a partition, ignore.
323323
continue
324324
else:
325-
raise confluent_kafka.KafkaException(msg.error())
325+
raise mapr_streams_python.KafkaException(msg.error())
326326

327327

328328
bytecnt += len(msg)
@@ -355,8 +355,8 @@ def my_on_revoke (consumer, partitions):
355355
if len(sys.argv) > 1:
356356
bootstrap_servers = sys.argv[1]
357357

358-
print('Using confluent_kafka module version %s (0x%x)' % confluent_kafka.version())
359-
print('Using librdkafka version %s (0x%x)' % confluent_kafka.libversion())
358+
print('Using confluent_kafka module version %s (0x%x)' % mapr_streams_python.version())
359+
print('Using librdkafka version %s (0x%x)' % mapr_streams_python.libversion())
360360

361361
print('=' * 30, 'Verifying Producer performance (with dr_cb)', '=' * 30)
362362
verify_producer_performance(with_dr_cb=True)

examples/producer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Reads lines from stdin and sends to Kafka.
2121
#
2222

23-
from confluent_kafka import Producer
23+
from mapr_streams_python import Producer
2424
import sys
2525

2626
if __name__ == '__main__':
File renamed without changes.

mapr_streams_python/kafkatest/README

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FIXME: Instructions on how to use this.
2+
3+
4+
Usage:
5+
6+
python -m mapr_streams_python.kafkatest.verifiable_consumer <options>
7+
8+
python -m mapr_streams_python.kafkatest.verifiable_producer <options>

confluent_kafka/kafkatest/verifiable_consumer.py renamed to mapr_streams_python/kafkatest/verifiable_consumer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
import argparse, sys
19-
from confluent_kafka import Consumer, KafkaError, KafkaException
19+
from mapr_streams_python import Consumer, KafkaError, KafkaException
2020
from verifiable_client import VerifiableClient
2121

2222
class VerifiableConsumer(VerifiableClient):

confluent_kafka/kafkatest/verifiable_producer.py renamed to mapr_streams_python/kafkatest/verifiable_producer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
import argparse, time
19-
from confluent_kafka import Producer, KafkaError, KafkaException
19+
from mapr_streams_python import Producer, KafkaError, KafkaException
2020
from verifiable_client import VerifiableClient
2121

2222
class VerifiableProducer(VerifiableClient):

0 commit comments

Comments
 (0)