Package com.netflix.eureka.cluster
Class PeerEurekaNode
- java.lang.Object
-
- com.netflix.eureka.cluster.PeerEurekaNode
-
public class PeerEurekaNode extends java.lang.ObjectThePeerEurekaNoderepresents a peer node to which information should be shared from this node.This class handles replicating all update operations like Register,Renew,Cancel,Expiration and Status Changes to the eureka node it represents.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBATCH_URL_PATHstatic java.lang.StringHEADER_REPLICATION
-
Constructor Summary
Constructors Constructor Description PeerEurekaNode(PeerAwareInstanceRegistry registry, java.lang.String targetHost, java.lang.String serviceUrl, HttpReplicationClient replicationClient, EurekaServerConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel(java.lang.String appName, java.lang.String id)Send the cancellation information of an instance to the node represented by this class.voiddeleteStatusOverride(java.lang.String appName, java.lang.String id, com.netflix.appinfo.InstanceInfo info)Delete instance status override.booleanequals(java.lang.Object obj)java.lang.StringgetBatcherName()java.lang.StringgetServiceUrl()Get the service Url of the peer eureka node.inthashCode()voidheartbeat(java.lang.String appName, java.lang.String id, com.netflix.appinfo.InstanceInfo info, com.netflix.appinfo.InstanceInfo.InstanceStatus overriddenStatus, boolean primeConnection)Send the heartbeat information of an instance to the node represented by this class.voidregister(com.netflix.appinfo.InstanceInfo info)Sends the registration information ofInstanceInforeceiving by this node to the peer node represented by this class.voidshutDown()Shuts down all resources used for peer replication.voidstatusUpdate(java.lang.String asgName, ASGResource.ASGStatus newStatus)Send the status information of of the ASG represented by the instance.voidstatusUpdate(java.lang.String appName, java.lang.String id, com.netflix.appinfo.InstanceInfo.InstanceStatus newStatus, com.netflix.appinfo.InstanceInfo info)Send the status update of the instance.
-
-
-
Field Detail
-
BATCH_URL_PATH
public static final java.lang.String BATCH_URL_PATH
- See Also:
- Constant Field Values
-
HEADER_REPLICATION
public static final java.lang.String HEADER_REPLICATION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PeerEurekaNode
public PeerEurekaNode(PeerAwareInstanceRegistry registry, java.lang.String targetHost, java.lang.String serviceUrl, HttpReplicationClient replicationClient, EurekaServerConfig config)
-
-
Method Detail
-
register
public void register(com.netflix.appinfo.InstanceInfo info) throws java.lang.ExceptionSends the registration information ofInstanceInforeceiving by this node to the peer node represented by this class.- Parameters:
info- the instance informationInstanceInfoof any instance that is send to this instance.- Throws:
java.lang.Exception
-
cancel
public void cancel(java.lang.String appName, java.lang.String id) throws java.lang.ExceptionSend the cancellation information of an instance to the node represented by this class.- Parameters:
appName- the application name of the instance.id- the unique identifier of the instance.- Throws:
java.lang.Exception
-
heartbeat
public void heartbeat(java.lang.String appName, java.lang.String id, com.netflix.appinfo.InstanceInfo info, com.netflix.appinfo.InstanceInfo.InstanceStatus overriddenStatus, boolean primeConnection) throws java.lang.ThrowableSend the heartbeat information of an instance to the node represented by this class. If the instance does not exist the node, the instance registration information is sent again to the peer node.- Parameters:
appName- the application name of the instance.id- the unique identifier of the instance.info- the instance infoInstanceInfoof the instance.overriddenStatus- the overridden status information if any of the instance.- Throws:
java.lang.Throwable
-
statusUpdate
public void statusUpdate(java.lang.String asgName, ASGResource.ASGStatus newStatus)Send the status information of of the ASG represented by the instance.ASG (Autoscaling group) names are available for instances in AWS and the ASG information is used for determining if the instance should be registered as
InstanceInfo.InstanceStatus.DOWNorInstanceInfo.InstanceStatus.UP.- Parameters:
asgName- the asg name if any of this instance.newStatus- the new status of the ASG.
-
statusUpdate
public void statusUpdate(java.lang.String appName, java.lang.String id, com.netflix.appinfo.InstanceInfo.InstanceStatus newStatus, com.netflix.appinfo.InstanceInfo info)Send the status update of the instance.- Parameters:
appName- the application name of the instance.id- the unique identifier of the instance.newStatus- the new status of the instance.info- the instance information of the instance.
-
deleteStatusOverride
public void deleteStatusOverride(java.lang.String appName, java.lang.String id, com.netflix.appinfo.InstanceInfo info)Delete instance status override.- Parameters:
appName- the application name of the instance.id- the unique identifier of the instance.info- the instance information of the instance.
-
getServiceUrl
public java.lang.String getServiceUrl()
Get the service Url of the peer eureka node.- Returns:
- the service Url of the peer eureka node.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
shutDown
public void shutDown()
Shuts down all resources used for peer replication.
-
getBatcherName
public java.lang.String getBatcherName()
-
-