mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[Streaming] Change ID caption (#10523)
This commit is contained in:
parent
2f03bb5100
commit
2597b56f48
7 changed files with 29 additions and 29 deletions
|
@ -1,24 +1,24 @@
|
|||
package io.ray.streaming.runtime.core.common;
|
||||
|
||||
import com.google.common.base.MoreObjects;
|
||||
import io.ray.streaming.runtime.core.resource.ContainerID;
|
||||
import io.ray.streaming.runtime.core.resource.ContainerId;
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Streaming system unique identity base class. For example, ${@link ContainerID }
|
||||
* Streaming system unique identity base class. For example, ${@link ContainerId }
|
||||
*/
|
||||
public class AbstractID implements Serializable {
|
||||
public class AbstractId implements Serializable {
|
||||
|
||||
private UUID id;
|
||||
|
||||
public AbstractID() {
|
||||
public AbstractId() {
|
||||
this.id = UUID.randomUUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return id.equals(((AbstractID) obj).getId());
|
||||
return id.equals(((AbstractId) obj).getId());
|
||||
}
|
||||
|
||||
public UUID getId() {
|
|
@ -7,7 +7,7 @@ import io.ray.streaming.api.Language;
|
|||
import io.ray.streaming.jobgraph.VertexType;
|
||||
import io.ray.streaming.operator.StreamOperator;
|
||||
import io.ray.streaming.runtime.config.master.ResourceConfig;
|
||||
import io.ray.streaming.runtime.core.resource.ContainerID;
|
||||
import io.ray.streaming.runtime.core.resource.ContainerId;
|
||||
import io.ray.streaming.runtime.core.resource.ResourceType;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
@ -58,7 +58,7 @@ public class ExecutionVertex implements Serializable {
|
|||
/**
|
||||
* The id of the container which this vertex's worker actor belongs to.
|
||||
*/
|
||||
private ContainerID containerId;
|
||||
private ContainerId containerId;
|
||||
|
||||
/**
|
||||
* Worker actor handle.
|
||||
|
@ -211,15 +211,15 @@ public class ExecutionVertex implements Serializable {
|
|||
return buildTime;
|
||||
}
|
||||
|
||||
public ContainerID getContainerId() {
|
||||
public ContainerId getContainerId() {
|
||||
return containerId;
|
||||
}
|
||||
|
||||
public void setContainerId(ContainerID containerId) {
|
||||
public void setContainerId(ContainerId containerId) {
|
||||
this.containerId = containerId;
|
||||
}
|
||||
|
||||
public void setContainerIfNotExist(ContainerID containerId) {
|
||||
public void setContainerIfNotExist(ContainerId containerId) {
|
||||
if (null == this.containerId) {
|
||||
this.containerId = containerId;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public class Container implements Serializable {
|
|||
/**
|
||||
* container id
|
||||
*/
|
||||
private ContainerID id;
|
||||
private ContainerId id;
|
||||
|
||||
/**
|
||||
* Container address
|
||||
|
@ -64,7 +64,7 @@ public class Container implements Serializable {
|
|||
UniqueId nodeId, String hostname,
|
||||
Map<String, Double> availableResources) {
|
||||
|
||||
this.id = new ContainerID();
|
||||
this.id = new ContainerId();
|
||||
this.address = address;
|
||||
this.hostname = hostname;
|
||||
this.nodeId = nodeId;
|
||||
|
@ -80,11 +80,11 @@ public class Container implements Serializable {
|
|||
);
|
||||
}
|
||||
|
||||
public ContainerID getId() {
|
||||
public ContainerId getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(ContainerID id) {
|
||||
public void setId(ContainerId id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
package io.ray.streaming.runtime.core.resource;
|
||||
|
||||
import io.ray.streaming.runtime.core.common.AbstractID;
|
||||
|
||||
/**
|
||||
* Container unique identifier.
|
||||
*/
|
||||
public class ContainerID extends AbstractID {
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package io.ray.streaming.runtime.core.resource;
|
||||
|
||||
import io.ray.streaming.runtime.core.common.AbstractId;
|
||||
|
||||
/**
|
||||
* Container unique identifier.
|
||||
*/
|
||||
public class ContainerId extends AbstractId {
|
||||
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package io.ray.streaming.runtime.master.resourcemanager;
|
||||
|
||||
import io.ray.streaming.runtime.core.resource.ContainerID;
|
||||
import io.ray.streaming.runtime.core.resource.ContainerId;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -8,9 +8,9 @@ import java.util.Map;
|
|||
/**
|
||||
* Cluster resource allocation view, used to statically view cluster resource information.
|
||||
*/
|
||||
public class ResourceAssignmentView extends HashMap<ContainerID, List<Integer>> {
|
||||
public class ResourceAssignmentView extends HashMap<ContainerId, List<Integer>> {
|
||||
|
||||
public static ResourceAssignmentView of(Map<ContainerID, List<Integer>> assignmentView) {
|
||||
public static ResourceAssignmentView of(Map<ContainerId, List<Integer>> assignmentView) {
|
||||
ResourceAssignmentView view = new ResourceAssignmentView();
|
||||
view.putAll(assignmentView);
|
||||
return view;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package io.ray.streaming.runtime.master.resourcemanager;
|
||||
|
||||
import io.ray.streaming.runtime.core.resource.Container;
|
||||
import io.ray.streaming.runtime.core.resource.ContainerID;
|
||||
import io.ray.streaming.runtime.core.resource.ContainerId;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -15,7 +15,7 @@ public class ViewBuilder {
|
|||
}
|
||||
|
||||
public static ResourceAssignmentView buildResourceAssignmentView(List<Container> containers) {
|
||||
Map<ContainerID, List<Integer>> assignmentView =
|
||||
Map<ContainerId, List<Integer>> assignmentView =
|
||||
containers.stream().collect(java.util.stream.Collectors.toMap(Container::getId,
|
||||
Container::getExecutionVertexIds));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue