[
https://issues.apache.org/jira/browse/HDFS-7188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14326634#comment-14326634
]
Thanh Do commented on HDFS-7188:
--------------------------------
{code}
if (syscalls::getpeername(sock, &peer,
reinterpret_cast<int*>(&len))) {
{code}
Good catch. I will use {{socklen_t}} for {{len}} in the next patch.
{code}
49 #ifdef _WIN32
50 memcpy(&clientId[0], &id, sizeof(uuid_t));
51 #else
52 memcpy(&clientId[0], id, sizeof(uuid_t));
53 #endif
{code}
The reason for this is that in Windows, {{uuid_t}} is defined differently from
in Linux. In particular, in windows {{uuid_t}} is a real struct:
{code}
typedef struct _GUID {
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
typedef uuid_t GUID;
{code}
while in linux, it is defined as char array:
{code}
typedef unsigned char uuid_t[16];
{code}
Fortunately, size of {{uuid_t}} in both platforms are 16 bytes.
{{GetInitNamenodeIndex}}: my patch did have this function defined in
{{os/windows/platform.cc}}. I agree that getting it from the configuration is a
cleaner and preferable way. But for the scope if this JIRA, I just want to get
the windows build in asap. We should definitely open follow-on JIRAs to address
dangling issues. There are few dangling issues I could think of:
1) get HA info from configuration,
2) revisit socket error handling code for windows because socket error code is
somewhat different between windows and posix (e.g., perror() exists but does
not work as expected),
3) bootstrap windows socket api with WSAStartup.
and so on.
What do you think?
> support build libhdfs3 on windows
> ---------------------------------
>
> Key: HDFS-7188
> URL: https://issues.apache.org/jira/browse/HDFS-7188
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: hdfs-client
> Environment: Windows System, Visual Studio 2010
> Reporter: Zhanwei Wang
> Assignee: Thanh Do
> Attachments: HDFS-7188-branch-HDFS-6994-0.patch,
> HDFS-7188-branch-HDFS-6994-1.patch, HDFS-7188-branch-HDFS-6994-2.patch
>
>
> libhdfs3 should work on windows
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)