Details
Description
The current C code in libhdfs is written using C99 conventions and also uses a few POSIX specific functions such as hcreate, hsearch, and pthread mutex locks. To compile it using Visual Studio would require a conversion of the code in hdfsJniHelper.c and hdfs.c to C89 and replacement/reimplementation of the POSIX functions. The code also uses the stdint.h header, which is not part of the original C89, but there exists what appears to be a BSD licensed reimplementation written to be compatible with MSVC floating around. I have already done the other necessary conversions, as well as created a simplistic hash bucket for use with hcreate and hsearch and successfully built a DLL of libhdfs. Further testing is needed to see if it is usable by other programs to actually access hdfs, which will likely happen in the next few weeks as the Condor Project continues with its file transfer work.
In the process, I've removed a few what I believe are extraneous consts and also fixed an incorrect array initialization where someone was attempting to initialize with something like this: JavaVMOption options[noArgs]; where noArgs was being incremented in the code above. This was in the hdfsJniHelper.c file, in the getJNIEnv function.
Attachments
Attachments
Issue Links
- breaks
-
HDFS-8346 libwebhdfs build fails during link due to unresolved external symbols.
-
- Resolved
-
- duplicates
-
HDFS-5642 libhdfs Windows compatibility.
-
- Resolved
-
- is related to
-
HDFS-7879 hdfs.dll does not export functions of the public libhdfs API
-
- Closed
-
-
HDFS-6979 hdfs.dll does not produce .pdb files
-
- Closed
-
- relates to
-
HADOOP-10903 Enhance hadoop classpath command to expand wildcards or write classpath into jar manifest.
-
- Closed
-