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, getPort
public 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)
RemoteOperationExecutor
execute
in interface OperationExecutor
execute
in class RemoteOperationExecutor
T
- Return value type of the operation.operation
- The operation to execute remotely.public <T> BackgroundOperation<T> executeBackground(Operation<T> operation)
RemoteOperationExecutor
executeBackground
in interface OperationExecutor
executeBackground
in class RemoteOperationExecutor
T
- 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()
OperationExecutor
getWeight
in interface OperationExecutor
getWeight
in class RemoteOperationExecutor
public 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 © 2018. All rights reserved.