Re: Error running contrib tests

2009-11-24 Thread Erik Holstad
Yeah, i like that approach better.

Will do.

Erik


Re: Error running contrib tests

2009-11-23 Thread Erik Holstad
Sorry that it took so long, but I ran into trouble when trying out trunk
instead of 3.2.1.
It has nothing to do with the zookeeper code, I think, but more with my
environment.
After switching to trunk, I got back the original error and have been
struggling with it
since.
I'm running on Fedora9.
So, to make sure that it works the line /usr/local/lib/ needs to be in the
/etc/ld.so.conf.
If it is but it is still not working you have to run /sbin/ldconfig.

What I previous wrote about the different versions of Python, doesn't seem
to apply
any more, works fine for python2,5.

On my laptop where I run Ubuntu9.4 I don't have this problem.

Regards Erik


Re: Error running contrib tests

2009-11-23 Thread Erik Holstad
Have been messing around to try to get it included in the setup.py script.
But not sure
if it is good to have it there since writing to /usr/ld.so.conf and
reloading the /sbin/ldconfig
requires sudo status. But on the other hand that is needed to install from
the beginning.

I could add something like this to the end of the setup file

print Setting up dependencies
try:
  f = open(/etc/ld.so.conf, 'r+')
  content = f.read()
  path = /usr/local/lib
  if content.find(path) == -1:
f.write(path)

except Exception, e:
  pass

import subprocess
subprocess.call(['sudo', '/sbin/ldconfig'])

Erik


Re: Error running contrib tests

2009-11-20 Thread Erik Holstad
Hey!
I have been working with the zkpython module for that last couple of weeks.
After the initial problem with


ImportError: libzookeeper_mt.so.2: cannot open shared object file: No such
file or directory

I just added LD_LIBRARY_PATH=/usr/local/lib to the .bashrc file and
everything worked fine. For pydev
I had to add it as an Environment variable, to make it work.

But when moving away from raw python to to using it in a fcgi context I was
not able to get it to work under any
circumstances.

We were running this using python 2.5, which seemed to be one of the
problems, the other one that I've found
was the build script in zookeeper_home/src/contrib/
zkpython. when running sudo ant install everyhing works fine
but when trying to import it in python 2.6 I still got the same error.

Changing the setup.py file to point to the correct libraries and running
sudo python setup.py install everything works
fine and no more errors.

Just wanted to share this with the community since I've spend quite some
time trying to ge this to work.

Regards Erik


Error running contrib tests

2009-09-22 Thread Erik Holstad
Hi!
I am trying out the python bindings and I followed the guide on
http://www.cloudera.com/blog/2009/05/28/building-a-distributed-concurrent-queue-with-apache-zookeeper/
Everything worked fine until the last step:

Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:56)
[GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2
Type help, copyright, credits or license for more information.
 import zookeeper
Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: libzookeeper_mt.so.2: cannot open shared object file: No such
file or directory

I figured that I did something wrong in my setup, so I tried to run the
contrib test and got:

python-test:
 [exec] Running src/test/clientid_test.py
 [exec] Traceback (most recent call last):
 [exec]   File src/test/clientid_test.py, line 21, in module
 [exec] import zookeeper, zktestbase
 [exec] ImportError: libzookeeper_mt.so.2: cannot open shared object
file: No such file or directory
 [exec] Running src/test/connection_test.py
 [exec] Traceback (most recent call last):
 [exec]   File src/test/connection_test.py, line 21, in module
 [exec] import zookeeper, zktestbase
 [exec] ImportError: libzookeeper_mt.so.2: cannot open shared object
file: No such file or directory
 [exec] Running src/test/create_test.py
 [exec] Traceback (most recent call last):
 [exec]   File src/test/create_test.py, line 19, in module
 [exec] import zookeeper, zktestbase, unittest, threading
 [exec] ImportError: libzookeeper_mt.so.2: cannot open shared object
file: No such file or directory
 [exec] Running src/test/delete_test.py
 [exec] Traceback (most recent call last):
 [exec]   File src/test/delete_test.py, line 19, in module
 [exec] import zookeeper, zktestbase, unittest, threading
 [exec] ImportError: libzookeeper_mt.so.2: cannot open shared object
file: No such file or directory
 [exec] Running src/test/exists_test.py
 [exec] Traceback (most recent call last):
 [exec]   File src/test/exists_test.py, line 19, in module
 [exec] import zookeeper, zktestbase, unittest, threading
 [exec] ImportError: libzookeeper_mt.so.2: cannot open shared object
file: No such file or directory
 [exec] Running src/test/get_set_test.py
 [exec] Traceback (most recent call last):
 [exec]   File src/test/get_set_test.py, line 19, in module
 [exec] import zookeeper, zktestbase, unittest, threading
 [exec] ImportError: libzookeeper_mt.so.2: cannot open shared object
file: No such file or directory

BUILD FAILED
/home/erik/src/zookeeper-3.2.1/src/contrib/build.xml:48: The following error
occurred while executing this line:
/home/erik/src/zookeeper-3.2.1/src/contrib/zkpython/build.xml:63: exec
returned: 1


I ran this test from zookeeper/src/contrib with ant test

Not sure if I'm doing something wrong or if this is a bug?

Regards Erik


Re: Question about the sequential flag on create.

2009-07-14 Thread Erik Holstad
Hey Patrik!
Thanks for the reply.
I understand all the reasons that you posted above and totally agree that
nodes should not be sorted since you then have to pay that overhead for
every node, even though you might not need or want it.
I just thought that it might be possible to create a sequential node
atomically, but I guess that is not how it works?

Regards Erik


Re: Question about the sequential flag on create.

2009-07-14 Thread Erik Holstad
Thanks Patrick!


Instantiating HashSet for DataNode?

2009-07-14 Thread Erik Holstad
I'm not sure if I've miss read the code for the DataNode, but to me it looks
like every node gets a set of children even though it might be an
ephemeral node which cannot have children, so we are wasting 240 B for every
one of those. Not sure if it makes a big difference, but just thinking
that since everything sits in memory and there is no reason to instantiate
it, maybe it would be possible just to add a check in the constructor?

Regards Erik


Re: Instantiating HashSet for DataNode?

2009-07-14 Thread Erik Holstad
Will file Jira and have a stab at it when I get a little time.

Thanks guys!


Question about the sequential flag on create.

2009-07-13 Thread Erik Holstad
Hey!
I have been playing around with the queue and barrier example found on the
home page and have some questions about the code.
First of all I had trouble getting the queue example to work since the code
turns the sequence number into an int and then try to get information
from it, missing out the padding, which caused some confusion at first. So I
changed it to compare the strings themselves so you didn't have to
add the padding back on.

So the fact that you have to sort the children every time you get them is a
little bit confusing to me, does anyone have simple answer to why that is?

Regards Erik


Re: Question about the sequential flag on create.

2009-07-13 Thread Erik Holstad
Hi Mahadev!
Thanks for the quick reply. Yeah, I saw that in the source, but was just
curious why that is, since it is a part of an internal
counter structure, right?

Regards Erik