New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDFS-15151 Use TransmitFile for file to socket data transfer #1825
base: trunk
Are you sure you want to change the base?
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
"The function transmitFile is not supported on Unix"); | ||
#endif | ||
|
||
#ifdef WINDOWS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#elseif WINDOWS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was following the way this was done just above for Windows_extendWorkingSetSize
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/NativeIO.java
Show resolved
Hide resolved
@@ -819,6 +849,12 @@ public static boolean access(String path, AccessRight desiredAccess) | |||
} | |||
} | |||
} | |||
|
|||
public static void setConf(Configuration conf) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we name this a little bit more specific and not only setConf? initTransmitFileEnabledConf()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not meant to be only for enabling transmitfile, but generally for reloading/resetting the configuration
* Set the configuration to be used by this object. | ||
* @param conf configuration to be used | ||
*/ | ||
public static void setConf(Configuration conf) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name this more specifically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
int nTransfered = (int) fileCh.transferTo(position, count, getChannel()); | ||
int nTransfered = (int) NativeIO.transferTo(fileCh, | ||
fileInputStream.getFD(), getChannel(), | ||
((SelChImpl) getChannel()).getFD(), position, count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot find an easy way out but can you see if we can remove:
SelChImpl is internal proprietary API and may be removed in a future release
throw_ioe(env, WSAGetLastError()); | ||
} | ||
return numberOfBytesToWrite; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway to rewrite this so we don't get:
NativeIO.c:1413:1: warning: control reaches end of non-void function [-Wreturn-type]
NOTICE
Please create an issue in ASF JIRA before opening a pull request,
and you need to set the title of the pull request which starts with
the corresponding JIRA issue number. (e.g. HADOOP-XXXXX. Fix a typo in YYY.)
For more details, please see https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute