[Java] Fix return of java doc (#13601)

This commit is contained in:
Kai Yang
2021-01-21 23:57:20 +08:00
committed by GitHub
parent 587f207c2f
commit 92f1e0902e
67 changed files with 350 additions and 229 deletions
@@ -71,7 +71,7 @@ public abstract class NativeActorHandle implements BaseActorHandle, Externalizab
/**
* Serialize this actor handle to bytes.
*
* <p>Returns the bytes of the actor handle
* @return the bytes of the actor handle
*/
public byte[] toBytes() {
return nativeSerialize(actorId);
@@ -80,7 +80,7 @@ public abstract class NativeActorHandle implements BaseActorHandle, Externalizab
/**
* Deserialize an actor handle from bytes.
*
* <p>Returns the bytes of an actor handle
* @return the bytes of an actor handle
*/
public static NativeActorHandle fromBytes(byte[] bytes) {
byte[] actorId = nativeDeserialize(bytes);
@@ -69,7 +69,8 @@ public class FunctionManager {
* Get the RayFunction from a RayFunc instance (a lambda).
*
* @param jobId current job id.
* @param func The lambda. Returns A RayFunction object.
* @param func The lambda.
* @return A RayFunction object.
*/
public RayFunction getFunction(JobId jobId, RayFunc func) {
JavaFunctionDescriptor functionDescriptor = RAY_FUNC_CACHE.get().get(func.getClass());
@@ -90,7 +91,8 @@ public class FunctionManager {
* Get the RayFunction from a function descriptor.
*
* @param jobId Current job id.
* @param functionDescriptor The function descriptor. Returns A RayFunction object.
* @param functionDescriptor The function descriptor.
* @return A RayFunction object.
*/
public RayFunction getFunction(JobId jobId, JavaFunctionDescriptor functionDescriptor) {
JobFunctionTable jobFunctionTable = jobFunctionTables.get(jobId);
@@ -35,7 +35,8 @@ public class GcsClient {
/**
* Get placement group by {@link PlacementGroupId}.
*
* @param placementGroupId Id of placement group. Returns The placement group.
* @param placementGroupId Id of placement group.
* @return The placement group.
*/
public PlacementGroup getPlacementGroupInfo(PlacementGroupId placementGroupId) {
byte[] result = globalStateAccessor.getPlacementGroupInfo(placementGroupId);
@@ -45,7 +46,7 @@ public class GcsClient {
/**
* Get all placement groups in this cluster.
*
* <p>Returns All placement groups.
* @return All placement groups.
*/
public List<PlacementGroup> getAllPlacementGroupInfo() {
List<byte[]> results = globalStateAccessor.getAllPlacementGroupInfo();
@@ -88,7 +88,7 @@ public class RedisClient {
/**
* Return the specified elements of the list stored at the specified key.
*
* <p>Returns Multi bulk reply, specifically a list of elements in the specified range.
* @return Multi bulk reply, specifically a list of elements in the specified range.
*/
public List<byte[]> lrange(byte[] key, long start, long end) {
try (Jedis jedis = jedisPool.getResource()) {
@@ -54,7 +54,7 @@ public abstract class Metric {
/**
* Get the value to record and then reset.
*
* <p>Returns latest updating value.
* @return latest updating value.
*/
protected abstract double getAndReset();
@@ -111,7 +111,7 @@ public final class Metrics {
/**
* Creates a metric by sub-class.
*
* <p>Returns a metric
* @return a metric
*/
protected abstract M create();
@@ -55,7 +55,8 @@ public class ObjectSerializer {
* Deserialize an object from an {@link NativeRayObject} instance.
*
* @param nativeRayObject The object to deserialize.
* @param objectId The associated object ID of the object. Returns The deserialized object.
* @param objectId The associated object ID of the object.
* @return The deserialized object.
*/
public static Object deserialize(
NativeRayObject nativeRayObject, ObjectId objectId, Class<?> objectType) {
@@ -110,7 +111,8 @@ public class ObjectSerializer {
/**
* Serialize an Java object to an {@link NativeRayObject} instance.
*
* @param object The object to serialize. Returns The serialized object.
* @param object The object to serialize.
* @return The serialized object.
*/
public static NativeRayObject serialize(Object object) {
if (object instanceof NativeRayObject) {
@@ -26,7 +26,8 @@ public abstract class ObjectStore {
/**
* Put a raw object into object store.
*
* @param obj The ray object. Returns Generated ID of the object.
* @param obj The ray object.
* @return Generated ID of the object.
*/
public abstract ObjectId putRaw(NativeRayObject obj);
@@ -41,7 +42,8 @@ public abstract class ObjectStore {
/**
* Serialize and put an object to the object store.
*
* @param object The object to put. Returns Id of the object.
* @param object The object to put.
* @return Id of the object.
*/
public ObjectId put(Object object) {
if (object instanceof NativeRayObject) {
@@ -71,8 +73,8 @@ public abstract class ObjectStore {
* Get a list of raw objects from the object store.
*
* @param objectIds IDs of the objects to get.
* @param timeoutMs Timeout in milliseconds, wait infinitely if it's negative. Returns Result list
* of objects data.
* @param timeoutMs Timeout in milliseconds, wait infinitely if it's negative.
* @return Result list of objects data.
*/
public abstract List<NativeRayObject> getRaw(List<ObjectId> objectIds, long timeoutMs);
@@ -80,7 +82,8 @@ public abstract class ObjectStore {
* Get a list of objects from the object store.
*
* @param ids List of the object ids.
* @param <T> Type of these objects. Returns A list of GetResult objects.
* @param <T> Type of these objects.
* @return A list of GetResult objects.
*/
@SuppressWarnings("unchecked")
public <T> List<T> get(List<ObjectId> ids, Class<?> elementType) {
@@ -118,8 +121,8 @@ public abstract class ObjectStore {
*
* @param objectIds IDs of the objects to wait for.
* @param numObjects Number of objects that should appear.
* @param timeoutMs Timeout in milliseconds, wait infinitely if it's negative. Returns A bitset
* that indicates each object has appeared or not.
* @param timeoutMs Timeout in milliseconds, wait infinitely if it's negative.
* @return A bitset that indicates each object has appeared or not.
*/
public abstract List<Boolean> wait(List<ObjectId> objectIds, int numObjects, long timeoutMs);
@@ -129,8 +132,8 @@ public abstract class ObjectStore {
*
* @param waitList A list of object references to wait for.
* @param numReturns The number of objects that should be returned.
* @param timeoutMs The maximum time in milliseconds to wait before returning. Returns Two lists,
* one containing locally available objects, one containing the rest.
* @param timeoutMs The maximum time in milliseconds to wait before returning.
* @return Two lists, one containing locally available objects, one containing the rest.
*/
public <T> WaitResult<T> wait(List<ObjectRef<T>> waitList, int numReturns, int timeoutMs) {
Preconditions.checkNotNull(waitList);
@@ -185,7 +188,8 @@ public abstract class ObjectStore {
/**
* Promote the given object to the underlying object store, and get the ownership info.
*
* @param objectId The ID of the object to promote Returns the serialized ownership address
* @param objectId The ID of the object to promote
* @return the serialized ownership address
*/
public abstract byte[] promoteAndGetOwnershipInfo(ObjectId objectId);
@@ -53,8 +53,8 @@ public class PlacementGroupImpl implements PlacementGroup {
/**
* Wait for the placement group to be ready within the specified time.
*
* @param timeoutSeconds Timeout in seconds. Returns True if the placement group is created. False
* otherwise.
* @param timeoutSeconds Timeout in seconds.
* @return True if the placement group is created. False otherwise.
*/
public boolean wait(int timeoutSeconds) {
return Ray.internal().waitPlacementGroupReady(id, timeoutSeconds);
@@ -71,7 +71,8 @@ public class PlacementGroupImpl implements PlacementGroup {
/**
* Set the Id of the placement group.
*
* @param id Id of the placement group. Returns self.
* @param id Id of the placement group.
* @return self.
*/
public Builder setId(PlacementGroupId id) {
this.id = id;
@@ -81,7 +82,8 @@ public class PlacementGroupImpl implements PlacementGroup {
/**
* Set the name of the placement group.
*
* @param name Name of the placement group. Returns self.
* @param name Name of the placement group.
* @return self.
*/
public Builder setName(String name) {
this.name = name;
@@ -91,7 +93,8 @@ public class PlacementGroupImpl implements PlacementGroup {
/**
* Set the bundles of the placement group.
*
* @param bundles the bundles of the placement group. Returns self.
* @param bundles the bundles of the placement group.
* @return self.
*/
public Builder setBundles(List<Map<String, Double>> bundles) {
this.bundles = bundles;
@@ -101,7 +104,8 @@ public class PlacementGroupImpl implements PlacementGroup {
/**
* Set the placement strategy of the placement group.
*
* @param strategy the placement strategy of the placement group. Returns self.
* @param strategy the placement strategy of the placement group.
* @return self.
*/
public Builder setStrategy(PlacementStrategy strategy) {
this.strategy = strategy;
@@ -111,7 +115,8 @@ public class PlacementGroupImpl implements PlacementGroup {
/**
* Set the placement state of the placement group.
*
* @param state the state of the placement group. Returns self.
* @param state the state of the placement group.
* @return self.
*/
public Builder setState(PlacementGroupState state) {
this.state = state;
@@ -61,8 +61,8 @@ public class PlacementGroupUtils {
/**
* Generate a PlacementGroupImpl from placementGroupTableData protobuf data.
*
* @param placementGroupTableData protobuf data. Returns placement group info {@link
* PlacementGroupImpl}
* @param placementGroupTableData protobuf data.
* @return placement group info {@link PlacementGroupImpl}
*/
private static PlacementGroupImpl generatePlacementGroupFromPbData(
PlacementGroupTableData placementGroupTableData) {
@@ -90,8 +90,8 @@ public class PlacementGroupUtils {
/**
* Generate a PlacementGroupImpl from byte array.
*
* @param placementGroupByteArray bytes array from native method. Returns placement group info
* {@link PlacementGroupImpl}
* @param placementGroupByteArray bytes array from native method.
* @return placement group info {@link PlacementGroupImpl}
*/
public static PlacementGroupImpl generatePlacementGroupFromByteArray(
byte[] placementGroupByteArray) {
@@ -21,7 +21,8 @@ public interface TaskSubmitter {
* @param functionDescriptor The remote function to execute.
* @param args Arguments of this task.
* @param numReturns Return object count.
* @param options Options for this task. Returns Ids of the return objects.
* @param options Options for this task.
* @return Ids of the return objects.
*/
List<ObjectId> submitTask(
FunctionDescriptor functionDescriptor,
@@ -34,7 +35,8 @@ public interface TaskSubmitter {
*
* @param functionDescriptor The remote function that generates the actor object.
* @param args Arguments of this task.
* @param options Options for this actor creation task. Returns Handle to the actor.
* @param options Options for this actor creation task.
* @return Handle to the actor.
* @throws IllegalArgumentException if actor of specified name exists
*/
BaseActorHandle createActor(
@@ -48,7 +50,8 @@ public interface TaskSubmitter {
* @param functionDescriptor The remote function to execute.
* @param args Arguments of this task.
* @param numReturns Return object count.
* @param options Options for this task. Returns Ids of the return objects.
* @param options Options for this task.
* @return Ids of the return objects.
*/
List<ObjectId> submitActorTask(
BaseActorHandle actor,
@@ -62,7 +65,8 @@ public interface TaskSubmitter {
*
* @param name Name of the placement group.
* @param bundles Pre-allocated resource list.
* @param strategy Actor placement strategy. Returns A handle to the created placement group.
* @param strategy Actor placement strategy.
* @return A handle to the created placement group.
*/
PlacementGroup createPlacementGroup(
String name, List<Map<String, Double>> bundles, PlacementStrategy strategy);
@@ -78,8 +82,8 @@ public interface TaskSubmitter {
* Wait for the placement group to be ready within the specified time.
*
* @param id Id of placement group.
* @param timeoutMs Timeout in milliseconds. Returns True if the placement group is created. False
* otherwise.
* @param timeoutMs Timeout in milliseconds.
* @return True if the placement group is created. False otherwise.
*/
boolean waitPlacementGroupReady(PlacementGroupId id, int timeoutMs);
@@ -21,7 +21,8 @@ public class BinaryFileUtil {
* will be protected by a file lock.
*
* @param destDir a directory to extract resource file to
* @param fileName resource file name Returns extracted resource file
* @param fileName resource file name
* @return extracted resource file
*/
public static File getNativeFile(String destDir, String fileName) {
final File dir = new File(destDir);
@@ -13,7 +13,7 @@ public class IdUtil {
/**
* Compute the actor ID of the task which created this object.
*
* <p>Returns The actor ID of the task which created this object.
* @return The actor ID of the task which created this object.
*/
public static ActorId getActorIdFromObjectId(ObjectId objectId) {
byte[] taskIdBytes = new byte[TaskId.LENGTH];
@@ -11,8 +11,8 @@ public class ResourceUtil {
* Convert resources map to a string that is used for the command line argument of starting
* raylet.
*
* @param resources The resources map to be converted. Returns The starting-raylet command line
* argument, like "CPU,4,GPU,0".
* @param resources The resources map to be converted.
* @return The starting-raylet command line argument, like "CPU,4,GPU,0".
*/
public static String getResourcesStringFromMap(Map<String, Double> resources) {
StringBuilder builder = new StringBuilder();
@@ -32,8 +32,9 @@ public class ResourceUtil {
/**
* Parse the static resources configure field and convert to the resources map.
*
* @param resources The static resources string to be parsed. Returns The map whose key represents
* the resource name and the value represents the resource quantity.
* @param resources The static resources string to be parsed.
* @return The map whose key represents the resource name and the value represents the resource
* quantity.
* @throws IllegalArgumentException If the resources string's format does match, it will throw an
* IllegalArgumentException.
*/