-
Notifications
You must be signed in to change notification settings - Fork 10
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
README sample program compile error #24
Comments
package com.ibm.jnvmf.utils; import com.ibm.jnvmf.*; import java.io.IOException; public class NvmfClientHelloworld {
} |
Please let me know what the compilation error is, there might have been some small changes to the API that are not reflected in the example. |
man, I have fixed the compile error. now I suffer the null pointer error. |
looks like we did not specify response callback, then it is null final void post(Command command, SVCPostSend postSend, Response response) throws IOException { |
I work around the null pointer exception like this, the null pointer gone, but I never see the response is get back. the done flag is never set. Could you please help? I will paste my test code below. final void post(Command command, SVCPostSend postSend, Response response) throws IOException {
} |
my test code: import com.ibm.jnvmf.*; import java.io.IOException; public class NvmfClientHelloworld {
} |
You need to also set the callback for the response. It intentionally does not check if it is set for performance reasons. (We are counting cycles here) |
Just for your information. The code you pasted (resp. the example in the README) does not work as intended anymore. We now differentiate between command and response completion, i.e. when the command completes it just means the command was successfully send to the other side. For the whole operation to complete your response has to complete. So please move the callback code from the command to the response for it to work again. |
ok, I will try. but I found the command complete callback is not invoked at all. can you also try work out the simple sample and try from your side and share me too? I will try at my morning |
I double check benchmark sample, it also create callback for command. 476 do { |
I follow your suggestion. move the callback from request to the response. but the application still hanging there, no callback is invoked. ==below is application hang there=== ===below is code=== import com.ibm.jnvmf.*; import java.io.IOException; public class NvmfClientHelloworld {
} |
hello man, I create another sample application based on your benchmark code. it works on the flow. I am not hanging any more. but I like to confirm the NVMe read do really read things back. but when I try to dump things in the bytebuffer after read response is done. I find the string are still all 0. could you please help? maybe you can show me read and write works from your side. and share me your checking code. package com.ibm.jnvmf.utils; import com.ibm.jnvmf.*; import java.io.IOException; public class NvmfClientTest {
} |
I recommend writing and then reading something. If the device has been e.g. trimmed then all the data will be zero so you would not see anything. Alternatively write some random data to the buffer before doing the read such that you know it would have been overwritten with zeros. |
I am pretty sure there is no trim on my disk. I will try write random data to buffer before doing read. |
hello buddy,
===this part cannot compile well even after I put done into my class member. I am just using one simple example. I will paste you all the code.
volatile boolean done = false;
sqe.setNumberOfLogicalBlocks(1);
sqe.setNamespaceIdentifier(new NamespaceIdentifier(1));
volatile boolean done = false;
/* set callback */
command.setCallback(new OperationCallback() {
@OverRide
public void onStart() {
}
});
command.execute(response);
/* wait until command is done */
while (!done);
The text was updated successfully, but these errors were encountered: