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

-8
This file was deleted.

examples/consumer.py

+1-1
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

+12-12
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

+1-1
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

+8
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

+1-1
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

+1-1
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):

confluent_kafka/src/Consumer.c renamed to mapr_streams_python/src/Consumer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "confluent_kafka.h"
17+
#include "mapr_streams_python.h"
1818

1919

2020
/****************************************************************************

confluent_kafka/src/Producer.c renamed to mapr_streams_python/src/Producer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "confluent_kafka.h"
17+
#include "mapr_streams_python.h"
1818

1919

2020
/**

confluent_kafka/src/confluent_kafka.c renamed to mapr_streams_python/src/mapr_streams_python.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "confluent_kafka.h"
17+
#include "mapr_streams_python.h"
1818

1919
#include <stdarg.h>
2020

setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
from distutils.core import Extension
55

66

7-
module = Extension('confluent_kafka.cimpl',
7+
module = Extension('mapr_streams_python.cimpl',
88
libraries= ['rdkafka'],
9-
sources=['confluent_kafka/src/confluent_kafka.c',
10-
'confluent_kafka/src/Producer.c',
11-
'confluent_kafka/src/Consumer.c'])
9+
sources=['mapr_streams_python/src/mapr_streams_python.c',
10+
'mapr_streams_python/src/Producer.c',
11+
'mapr_streams_python/src/Consumer.c'])
1212

1313
setup(name='mapr-streams-python',
1414
version='0.9.2',

tests/test_Consumer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
from confluent_kafka import Consumer, TopicPartition, KafkaError, KafkaException
3+
from mapr_streams_python import Consumer, TopicPartition, KafkaError, KafkaException
44
import pytest
55
import subprocess
66
import utils as u

tests/test_KafkaError.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
from confluent_kafka import Producer, KafkaError, KafkaException
3+
from mapr_streams_python import Producer, KafkaError, KafkaException
44
import time
55

66
seen_all_brokers_down = False

tests/test_Producer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
from confluent_kafka import Producer, Consumer, KafkaError, KafkaException, TopicPartition
3+
from mapr_streams_python import Producer, KafkaError, KafkaException
44
import mock
55
import pytest
66
import subprocess

tests/test_TopicPartition.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
from confluent_kafka import TopicPartition
3+
from mapr_streams_python import TopicPartition
44

55
def test_sort():
66
""" TopicPartition sorting (rich comparator) """

tests/test_bahavior.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from confluent_kafka import Consumer, Producer, TopicPartition, KafkaError, KafkaException
1+
from mapr_streams_python import Consumer, Producer, TopicPartition, KafkaError, KafkaException
22
import pytest
33
import utils as u
44

tests/test_consumer_streams.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
from confluent_kafka import Consumer, Producer, TopicPartition, KafkaError, KafkaException
2+
from mapr_streams_python import Consumer, Producer, TopicPartition, KafkaError, KafkaException
33
import subprocess
44
import pytest
55
import mock

tests/test_docs.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
import confluent_kafka
3+
import mapr_streams_python
44
import re
55
from types import ModuleType
66

@@ -9,12 +9,12 @@ def test_verify_docs():
99
"""
1010
fails = 0
1111

12-
for n in dir(confluent_kafka):
12+
for n in dir(mapr_streams_python):
1313
if n.startswith('__'):
1414
# Skip internals
1515
continue
1616

17-
o = confluent_kafka.__dict__.get(n)
17+
o = mapr_streams_python.__dict__.get(n)
1818
d = o.__doc__
1919
if not d:
2020
print('Missing __doc__ for: %s (type %s)' % (n, type(o)))

tests/test_enums.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python
22

3-
import confluent_kafka
3+
import mapr_streams_python
44

55
def test_enums():
66
""" Make sure librdkafka error enums are reachable directly from the
77
KafkaError class without an instantiated object. """
8-
print(confluent_kafka.KafkaError._NO_OFFSET)
9-
print(confluent_kafka.KafkaError.REBALANCE_IN_PROGRESS)
8+
print(mapr_streams_python.KafkaError._NO_OFFSET)
9+
print(mapr_streams_python.KafkaError.REBALANCE_IN_PROGRESS)

tests/test_misc.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/usr/bin/env python
22

3-
import confluent_kafka
3+
import mapr_streams_python
44

55

66
def test_version():
7-
print('Using confluent_kafka module version %s (0x%x)' % confluent_kafka.version())
8-
sver, iver = confluent_kafka.version()
7+
print('Using confluent_kafka module version %s (0x%x)' % mapr_streams_python.version())
8+
sver, iver = mapr_streams_python.version()
99
assert len(sver) > 0
1010
assert iver > 0
1111

12-
print('Using librdkafka version %s (0x%x)' % confluent_kafka.libversion())
13-
sver, iver = confluent_kafka.libversion()
12+
print('Using librdkafka version %s (0x%x)' % mapr_streams_python.libversion())
13+
sver, iver = mapr_streams_python.libversion()
1414
assert len(sver) > 0
1515
assert iver > 0
1616

tests/test_threads.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
from confluent_kafka import Producer, KafkaError, KafkaException
3+
from mapr_streams_python import Producer, KafkaError, KafkaException
44
import threading
55
import time
66
try:

0 commit comments

Comments
 (0)