Cleanup imports in kafka/client and kafka/consumer
This commit is contained in:
@@ -4,8 +4,8 @@ import copy
|
|||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
import kafka.common
|
|
||||||
|
|
||||||
|
import kafka.common
|
||||||
from kafka.common import (TopicAndPartition, BrokerMetadata,
|
from kafka.common import (TopicAndPartition, BrokerMetadata,
|
||||||
ConnectionError, FailedPayloadsError,
|
ConnectionError, FailedPayloadsError,
|
||||||
KafkaTimeoutError, KafkaUnavailableError,
|
KafkaTimeoutError, KafkaUnavailableError,
|
||||||
|
@@ -1,22 +1,21 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from collections import namedtuple
|
||||||
import logging
|
import logging
|
||||||
|
from multiprocessing import Process, Manager as MPManager
|
||||||
|
try:
|
||||||
|
from Queue import Empty, Full # python 3
|
||||||
|
except ImportError:
|
||||||
|
from queue import Empty, Full # python 2
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from collections import namedtuple
|
|
||||||
from multiprocessing import Process, Manager as MPManager
|
|
||||||
|
|
||||||
try:
|
|
||||||
from Queue import Empty, Full
|
|
||||||
except ImportError: # python 2
|
|
||||||
from queue import Empty, Full
|
|
||||||
|
|
||||||
from .base import (
|
from .base import (
|
||||||
|
Consumer,
|
||||||
AUTO_COMMIT_MSG_COUNT, AUTO_COMMIT_INTERVAL,
|
AUTO_COMMIT_MSG_COUNT, AUTO_COMMIT_INTERVAL,
|
||||||
NO_MESSAGES_WAIT_TIME_SECONDS,
|
NO_MESSAGES_WAIT_TIME_SECONDS,
|
||||||
FULL_QUEUE_WAIT_TIME_SECONDS
|
FULL_QUEUE_WAIT_TIME_SECONDS
|
||||||
)
|
)
|
||||||
from .simple import Consumer, SimpleConsumer
|
from .simple import SimpleConsumer
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@@ -2,25 +2,18 @@ from __future__ import absolute_import
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
from itertools import zip_longest as izip_longest, repeat # pylint: disable-msg=E0611
|
from itertools import zip_longest as izip_longest, repeat # pylint: disable-msg=E0611
|
||||||
except ImportError: # python 2
|
except ImportError:
|
||||||
from itertools import izip_longest as izip_longest, repeat
|
from itertools import izip_longest as izip_longest, repeat # python 2
|
||||||
import logging
|
import logging
|
||||||
|
try:
|
||||||
|
from Queue import Empty, Queue # python 3
|
||||||
|
except ImportError:
|
||||||
|
from queue import Empty, Queue # python 2
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import six
|
import six
|
||||||
import sys
|
|
||||||
|
|
||||||
try:
|
|
||||||
from Queue import Empty, Queue
|
|
||||||
except ImportError: # python 2
|
|
||||||
from queue import Empty, Queue
|
|
||||||
|
|
||||||
from kafka.common import (
|
|
||||||
FetchRequest, OffsetRequest,
|
|
||||||
ConsumerFetchSizeTooSmall, ConsumerNoMoreData,
|
|
||||||
UnknownTopicOrPartitionError, NotLeaderForPartitionError,
|
|
||||||
OffsetOutOfRangeError, FailedPayloadsError, check_error
|
|
||||||
)
|
|
||||||
from .base import (
|
from .base import (
|
||||||
Consumer,
|
Consumer,
|
||||||
FETCH_DEFAULT_BLOCK_TIMEOUT,
|
FETCH_DEFAULT_BLOCK_TIMEOUT,
|
||||||
@@ -33,6 +26,12 @@ from .base import (
|
|||||||
ITER_TIMEOUT_SECONDS,
|
ITER_TIMEOUT_SECONDS,
|
||||||
NO_MESSAGES_WAIT_TIME_SECONDS
|
NO_MESSAGES_WAIT_TIME_SECONDS
|
||||||
)
|
)
|
||||||
|
from ..common import (
|
||||||
|
FetchRequest, OffsetRequest,
|
||||||
|
ConsumerFetchSizeTooSmall, ConsumerNoMoreData,
|
||||||
|
UnknownTopicOrPartitionError, NotLeaderForPartitionError,
|
||||||
|
OffsetOutOfRangeError, FailedPayloadsError, check_error
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
Reference in New Issue
Block a user