-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4529 from petro-rudenko/jucx/request-close
JUCX: ucp_request functionality.
- Loading branch information
Showing
15 changed files
with
177 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
bindings/java/src/main/java/org/openucx/jucx/UcxRequest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
bindings/java/src/main/java/org/openucx/jucx/ucp/UcpRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (C) Mellanox Technologies Ltd. 2019. ALL RIGHTS RESERVED. | ||
* See file LICENSE for terms. | ||
*/ | ||
|
||
package org.openucx.jucx.ucp; | ||
|
||
import org.openucx.jucx.UcxNativeStruct; | ||
|
||
import java.io.Closeable; | ||
|
||
/** | ||
* Request object, that returns by ucp operations (GET, PUT, SEND, etc.). | ||
* Call {@link UcpRequest#isCompleted()} to monitor completion of request. | ||
*/ | ||
public class UcpRequest extends UcxNativeStruct implements Closeable { | ||
|
||
private UcpRequest(long nativeId) { | ||
setNativeId(nativeId); | ||
} | ||
|
||
/** | ||
* @return whether this request is completed. | ||
*/ | ||
public boolean isCompleted() { | ||
return (getNativeId() == null) || isCompletedNative(getNativeId()); | ||
} | ||
|
||
/** | ||
* This routine releases the non-blocking request back to the library, regardless | ||
* of its current state. Communications operations associated with this request | ||
* will make progress internally, however no further notifications or callbacks | ||
* will be invoked for this request. | ||
*/ | ||
@Override | ||
public void close() { | ||
if (getNativeId() != null) { | ||
closeRequestNative(getNativeId()); | ||
} | ||
} | ||
|
||
private static native boolean isCompletedNative(long ucpRequest); | ||
|
||
private static native void closeRequestNative(long ucpRequest); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.