Package com.linkedin.venice.d2
Class D2Server
java.lang.Object
com.linkedin.venice.d2.D2Server
- All Implemented Interfaces:
ServiceDiscoveryAnnouncer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidManually start the d2 server.Get a ID string consists of the attributes that uniquely define the announcing target, which are: 1) doNotStart 2) zkHosts 3) zk announcers (clusterName + nodeUri) -- Note that there should be exactly one announcer according to the current usage inD2ServerFactory.com.linkedin.d2.balancer.servers.ZooKeeperAnnouncer[]booleanbooleanCompare D2Server to another one to check quality.booleanvoidvoidvoidregister()Register the instance with the service discovery system.toString()voidUnregister the instance from the service discovery system.
-
Constructor Details
-
D2Server
-
-
Method Details
-
notifyShutdown
public void notifyShutdown() -
notifyStartup
public void notifyStartup() -
forceStart
public void forceStart()Manually start the d2 server. This method will only take effects when automatic start up is disabled by _delayStart. -
getZkAnnouncers
public com.linkedin.d2.balancer.servers.ZooKeeperAnnouncer[] getZkAnnouncers() -
getNodeUris
-
isStarted
public boolean isStarted() -
isDelayStart
public boolean isDelayStart() -
isEqual
Compare D2Server to another one to check quality. When ALL of the following conditions are met, two d2 servers are considered equal: 1. having the same value in doNotStart. 2. having the same zk connect string (connecting to the same zk cluster). 3. having the same number of announcers. Note there should be exactly one announcer according to the current usage inD2ServerFactory. 4. Announcers are the same with the same cluster name (announcing to the same cluster) AND same node uri (announcing for the same host).- Parameters:
other- the other D2Server to check against.- Returns:
- true, if equal; false, if not.
-
getAnnouncingTargetID
Get a ID string consists of the attributes that uniquely define the announcing target, which are: 1) doNotStart 2) zkHosts 3) zk announcers (clusterName + nodeUri) -- Note that there should be exactly one announcer according to the current usage inD2ServerFactory. Sample ID string: { doNotStart=false, zkHosts=zk.prod-lor1, zkAnnouncers=[ {clusterName=cluster1, nodeUri=uri1} ]}- Returns:
- a ID string of the announcing target.
-
register
public void register()Description copied from interface:ServiceDiscoveryAnnouncerRegister the instance with the service discovery system.- Specified by:
registerin interfaceServiceDiscoveryAnnouncer
-
unregister
public void unregister()Description copied from interface:ServiceDiscoveryAnnouncerUnregister the instance from the service discovery system.- Specified by:
unregisterin interfaceServiceDiscoveryAnnouncer
-
toString
-