mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31: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;
|
package io.ray.streaming.runtime.core.common;
|
||||||
|
|
||||||
import com.google.common.base.MoreObjects;
|
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.io.Serializable;
|
||||||
import java.util.UUID;
|
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;
|
private UUID id;
|
||||||
|
|
||||||
public AbstractID() {
|
public AbstractId() {
|
||||||
this.id = UUID.randomUUID();
|
this.id = UUID.randomUUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
return id.equals(((AbstractID) obj).getId());
|
return id.equals(((AbstractId) obj).getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getId() {
|
|
@ -7,7 +7,7 @@ import io.ray.streaming.api.Language;
|
||||||
import io.ray.streaming.jobgraph.VertexType;
|
import io.ray.streaming.jobgraph.VertexType;
|
||||||
import io.ray.streaming.operator.StreamOperator;
|
import io.ray.streaming.operator.StreamOperator;
|
||||||
import io.ray.streaming.runtime.config.master.ResourceConfig;
|
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 io.ray.streaming.runtime.core.resource.ResourceType;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
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.
|
* The id of the container which this vertex's worker actor belongs to.
|
||||||
*/
|
*/
|
||||||
private ContainerID containerId;
|
private ContainerId containerId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Worker actor handle.
|
* Worker actor handle.
|
||||||
|
@ -211,15 +211,15 @@ public class ExecutionVertex implements Serializable {
|
||||||
return buildTime;
|
return buildTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContainerID getContainerId() {
|
public ContainerId getContainerId() {
|
||||||
return containerId;
|
return containerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setContainerId(ContainerID containerId) {
|
public void setContainerId(ContainerId containerId) {
|
||||||
this.containerId = containerId;
|
this.containerId = containerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setContainerIfNotExist(ContainerID containerId) {
|
public void setContainerIfNotExist(ContainerId containerId) {
|
||||||
if (null == this.containerId) {
|
if (null == this.containerId) {
|
||||||
this.containerId = containerId;
|
this.containerId = containerId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class Container implements Serializable {
|
||||||
/**
|
/**
|
||||||
* container id
|
* container id
|
||||||
*/
|
*/
|
||||||
private ContainerID id;
|
private ContainerId id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Container address
|
* Container address
|
||||||
|
@ -64,7 +64,7 @@ public class Container implements Serializable {
|
||||||
UniqueId nodeId, String hostname,
|
UniqueId nodeId, String hostname,
|
||||||
Map<String, Double> availableResources) {
|
Map<String, Double> availableResources) {
|
||||||
|
|
||||||
this.id = new ContainerID();
|
this.id = new ContainerId();
|
||||||
this.address = address;
|
this.address = address;
|
||||||
this.hostname = hostname;
|
this.hostname = hostname;
|
||||||
this.nodeId = nodeId;
|
this.nodeId = nodeId;
|
||||||
|
@ -80,11 +80,11 @@ public class Container implements Serializable {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContainerID getId() {
|
public ContainerId getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(ContainerID id) {
|
public void setId(ContainerId id) {
|
||||||
this.id = 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;
|
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.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -8,9 +8,9 @@ import java.util.Map;
|
||||||
/**
|
/**
|
||||||
* Cluster resource allocation view, used to statically view cluster resource information.
|
* 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();
|
ResourceAssignmentView view = new ResourceAssignmentView();
|
||||||
view.putAll(assignmentView);
|
view.putAll(assignmentView);
|
||||||
return view;
|
return view;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.ray.streaming.runtime.master.resourcemanager;
|
package io.ray.streaming.runtime.master.resourcemanager;
|
||||||
|
|
||||||
import io.ray.streaming.runtime.core.resource.Container;
|
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.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ public class ViewBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResourceAssignmentView buildResourceAssignmentView(List<Container> containers) {
|
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,
|
containers.stream().collect(java.util.stream.Collectors.toMap(Container::getId,
|
||||||
Container::getExecutionVertexIds));
|
Container::getExecutionVertexIds));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue