Skip to content

Instantly share code, notes, and snippets.

@neilkod
Created January 10, 2012 11:40
Show Gist options
  • Save neilkod/1588596 to your computer and use it in GitHub Desktop.
Save neilkod/1588596 to your computer and use it in GitHub Desktop.
trouble with watch_znode_for_changes.py
zookeeper shell output below after python output
------------------------------------------------
nkodner@hadoop4 zookeeper$ python -v watch_znode_for_changes.py
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py
import site # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py
import os # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.pyc
import errno # builtin
import posix # builtin
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py
import posixpath # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.py
import stat # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py
import genericpath # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.py
import warnings # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.py
import linecache # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.py
import types # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py
import UserDict # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py
import _abcoll # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py
import abc # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.py
import _weakrefset # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.pyc
import _weakref # builtin
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.py
import copy_reg # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py
import sysconfig # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py
import re # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.py
import sre_compile # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.pyc
import _sre # builtin
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.py
import sre_parse # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.py
import sre_constants # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.pyc
# zipimport: found 29 names in /Library/Python/2.7/site-packages/tweepy-1.7.1-py2.7.egg
# zipimport: found 57 names in /Library/Python/2.7/site-packages/simplejson-2.1.6-py2.7.egg
# zipimport: found 20 names in /Library/Python/2.7/site-packages/oauth2-1.5.170-py2.7.egg
# zipimport: found 88 names in /Library/Python/2.7/site-packages/pymongo-2.0.1-py2.7-macosx-10.7-intel.egg
# zipimport: found 39 names in /Library/Python/2.7/site-packages/PyYAML-3.10-py2.7-macosx-10.7-intel.egg
# zipimport: found 9 names in /Library/Python/2.7/site-packages/BeautifulSoup-3.2.0-py2.7.egg
# zipimport: found 47 names in /Library/Python/2.7/site-packages/pika-0.9.5-py2.7.egg
# zipimport: found 37 names in /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg
# zipimport: found 60 names in /Library/Python/2.7/site-packages/requests-0.9.0-py2.7.egg
# zipimport: found 256 names in /Library/Python/2.7/site-packages/SQLAlchemy-0.7.4-py2.7-macosx-10.7-intel.egg
import encodings # directory /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.py
import encodings # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py
import codecs # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.pyc
import _codecs # builtin
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.py
import encodings.aliases # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py
import encodings.utf_8 # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.pyc
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import logging # directory /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py
import logging # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.pyc
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/time.so", 2);
import time # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/time.so
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cStringIO.so", 2);
import cStringIO # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cStringIO.so
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py
import traceback # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.py
import weakref # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.pyc
import thread # builtin
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py
import threading # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py
import collections # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.pyc
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so", 2);
import _collections # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so", 2);
import operator # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/keyword.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/keyword.py
import keyword # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/keyword.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/heapq.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/heapq.py
import heapq # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/heapq.pyc
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/itertools.so", 2);
import itertools # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/itertools.so
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/bisect.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/bisect.py
import bisect # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/bisect.pyc
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_bisect.so", 2);
import _bisect # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_bisect.so
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_heapq.so", 2);
import _heapq # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_heapq.so
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py
import atexit # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/handlers.pyc has bad mtime
import logging.handlers # from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/handlers.py
# can't create /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/handlers.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py
import socket # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.pyc
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so", 2);
import _socket # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py
import functools # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.pyc
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so", 2);
import _functools # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so", 2);
import _ssl # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cPickle.so", 2);
import cPickle # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cPickle.so
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/struct.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/struct.py
import struct # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/struct.pyc
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so", 2);
import _struct # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so
dlopen("/Library/Python/2.7/site-packages/zookeeper.so", 2);
import zookeeper # dynamically loaded from /Library/Python/2.7/site-packages/zookeeper.so
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py
import optparse # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/textwrap.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/textwrap.py
import textwrap # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/textwrap.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/string.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/string.py
import string # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/string.pyc
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/strop.so", 2);
import strop # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/strop.so
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/gettext.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/gettext.py
import gettext # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/gettext.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py
import locale # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.pyc
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so", 2);
import _locale # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py
import copy # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.pyc
2012-01-10 06:39:07,725 watch_znode_for_changes.py:193 - Starting Zookeeper python example: watch_znode_for_changes.py
2012-01-10 06:39:07,725:9837(0x7fff7b8b4960):ZOO_INFO@log_env@712: Client environment:zookeeper.version=zookeeper C client 3.4.1
2012-01-10 06:39:07,725:9837(0x7fff7b8b4960):ZOO_INFO@log_env@716: Client environment:host.name=hadoop4.local
2012-01-10 06:39:07,725:9837(0x7fff7b8b4960):ZOO_INFO@log_env@723: Client environment:os.name=Darwin
2012-01-10 06:39:07,725:9837(0x7fff7b8b4960):ZOO_INFO@log_env@724: Client environment:os.arch=11.2.0
2012-01-10 06:39:07,725:9837(0x7fff7b8b4960):ZOO_INFO@log_env@725: Client environment:os.version=Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64
2012-01-10 06:39:07,726:9837(0x7fff7b8b4960):ZOO_INFO@log_env@733: Client environment:user.name=nkodner
2012-01-10 06:39:07,726:9837(0x7fff7b8b4960):ZOO_INFO@log_env@741: Client environment:user.home=/Users/nkodner
2012-01-10 06:39:07,726:9837(0x7fff7b8b4960):ZOO_INFO@log_env@753: Client environment:user.dir=/Users/nkodner/Dropbox/development/python/zookeeper
2012-01-10 06:39:07,726:9837(0x7fff7b8b4960):ZOO_INFO@zookeeper_init@786: Initiating client connection, host=localhost:2181 sessionTimeout=10000 watcher=0x0 sessionId=0 sessionPasswd=<null> context=0x0 flags=0
2012-01-10 06:39:07,727:9837(0x103ec6000):ZOO_INFO@check_events@1701: initiated connection to server [::1:2181]
2012-01-10 06:39:07,729:9837(0x103ec6000):ZOO_INFO@check_events@1748: session establishment complete on server [::1:2181], sessionId=0x134be070e0c001e, negotiated timeout=10000
----- zookeeper shell output
[zk: 127.0.0.1:2181(CONNECTED) 43] create /watch-test dummy-data
Created /watch-test
[zk: 127.0.0.1:2181(CONNECTED) 44] set /watch-test new-data
cZxid = 0xe26
ctime = Tue Jan 10 06:37:53 EST 2012
mZxid = 0xe28
mtime = Tue Jan 10 06:37:59 EST 2012
pZxid = 0xe26
cversion = 0
dataVersion = 1
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 8
numChildren = 0
[zk: 127.0.0.1:2181(CONNECTED) 45] set /watch-test new-data2
cZxid = 0xe26
ctime = Tue Jan 10 06:37:53 EST 2012
mZxid = 0xe2b
mtime = Tue Jan 10 06:38:51 EST 2012
pZxid = 0xe26
cversion = 0
dataVersion = 2
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 9
numChildren = 0
[zk: 127.0.0.1:2181(CONNECTED) 46] set /watch-test new-data3
cZxid = 0xe26
ctime = Tue Jan 10 06:37:53 EST 2012
mZxid = 0xe2c
mtime = Tue Jan 10 06:38:54 EST 2012
pZxid = 0xe26
cversion = 0
dataVersion = 3
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 9
numChildren = 0
[zk: 127.0.0.1:2181(CONNECTED) 47] set /watch-test new-data4
cZxid = 0xe26
ctime = Tue Jan 10 06:37:53 EST 2012
mZxid = 0xe2d
mtime = Tue Jan 10 06:38:57 EST 2012
pZxid = 0xe26
cversion = 0
dataVersion = 4
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 9
numChildren = 0
[zk: 127.0.0.1:2181(CONNECTED) 48] set /watch-test new-data3
cZxid = 0xe26
ctime = Tue Jan 10 06:37:53 EST 2012
mZxid = 0xe30
mtime = Tue Jan 10 06:39:14 EST 2012
pZxid = 0xe26
cversion = 0
dataVersion = 5
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 9
numChildren = 0
[zk: 127.0.0.1:2181(CONNECTED) 49]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment