This patch implements passing overwrite = false when we're creating a file with O_EXCL.
I also took the liberty of cleaning up a few other things. The exception matching logic was busted, since it was looking for class names with slashes in them, whereas classNameOfObject returns class names with dots (ultimately this comes from GetMethodID). I wrote this logic originally, and I don't know what I was thinking. Fixing this also lets us get rid of the hack in hdfs_json_parser.c where we convert dots to slashes.
EIO is also a better error code to return if we don't know the exception we were given than EINTERNAL. The latter should be reserved for things like JNI internal errors, not exceptions.
I added FileAlreadyExistsException to the list of exceptions we're catching and translating. It translates to EEXIST.
I added a unit test for O_EXCL in test_libhdfs_threaded. I fixed a few cases where we were printing out test errors without prefixing them with TEST_ERROR (if we don't do this, they get lost in the noise).
This patch implements passing overwrite = false when we're creating a file with O_EXCL.
I also took the liberty of cleaning up a few other things. The exception matching logic was busted, since it was looking for class names with slashes in them, whereas classNameOfObject returns class names with dots (ultimately this comes from GetMethodID). I wrote this logic originally, and I don't know what I was thinking. Fixing this also lets us get rid of the hack in hdfs_json_parser.c where we convert dots to slashes.
EIO is also a better error code to return if we don't know the exception we were given than EINTERNAL. The latter should be reserved for things like JNI internal errors, not exceptions.
I added FileAlreadyExistsException to the list of exceptions we're catching and translating. It translates to EEXIST.
I added a unit test for O_EXCL in test_libhdfs_threaded. I fixed a few cases where we were printing out test errors without prefixing them with TEST_ERROR (if we don't do this, they get lost in the noise).