protected static class PiDistributed.Node extends RemoteOperationExecutor implements Comparable<PiDistributed.Node>
| Constructor and Description |
|---|
Node(String host,
int port,
int weight)
Construct a Node with the specified parameters and one processor.
|
Node(String host,
int port,
int weight,
int numberOfProcessors)
Construct a Node with the specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(PiDistributed.Node that)
Compare this Node to another Node.
|
<T> T |
execute(Operation<T> operation)
Execute an operation remotely.
|
<T> BackgroundOperation<T> |
executeBackground(Operation<T> operation)
Execute an operation remotely.
|
int |
getNumberOfProcessors()
Get the number of processors.
|
int |
getWeight()
Returns the relative weight of this executor.
|
void |
setNumberOfProcessors(int numberOfProcessors)
Set the number of processors.
|
void |
setWeight(int weight)
Set the weight.
|
String |
toString()
Convert to String.
|
getHost, getPortpublic Node(String host, int port, int weight)
host - The remote host.port - The remote port.weight - The weight.public Node(String host, int port, int weight, int numberOfProcessors)
host - The remote host.port - The remote port.weight - The weight.numberOfProcessors - The number of processors.public <T> T execute(Operation<T> operation)
RemoteOperationExecutorexecute in interface OperationExecutorexecute in class RemoteOperationExecutorT - Return value type of the operation.operation - The operation to execute remotely.public <T> BackgroundOperation<T> executeBackground(Operation<T> operation)
RemoteOperationExecutorexecuteBackground in interface OperationExecutorexecuteBackground in class RemoteOperationExecutorT - Return value type of the operation.operation - The operation to execute remotely.BackgroundOperation for retrieving the result of the operation later.public void setWeight(int weight)
weight - The weight.public int getWeight()
OperationExecutorgetWeight in interface OperationExecutorgetWeight in class RemoteOperationExecutorpublic void setNumberOfProcessors(int numberOfProcessors)
numberOfProcessors - The number of processors.public int getNumberOfProcessors()
public int compareTo(PiDistributed.Node that)
compareTo in interface Comparable<PiDistributed.Node>that - The other node to compare to.Copyright © 2024. All rights reserved.