public class AMRegistry extends Object
Possible enhancement is to put the registry in some well-known location, such as /drill-am,
Constructor and Description |
---|
AMRegistry(ZKClusterCoordinator zkCoord) |
Modifier and Type | Method and Description |
---|---|
void |
register(String amHost,
int amPort,
String amAppId)
Register this AM as an ephemeral znode in ZK.
|
void |
useLocalRegistry(String zkRoot,
String clusterId) |
public AMRegistry(ZKClusterCoordinator zkCoord)
public void register(String amHost, int amPort, String amAppId) throws ZKRuntimeException
/drill . <cluster-id> . . <Drillbit GUID> (Value is Proto-encoded drillbit info) . drill-on-yarn . . <cluster-id> (value: amHost:port)
The structure acknowledges that the cluster-id znode may be renamed, and there may be multiple cluster IDs for a single drill root node. (Odd, but supported.) To address this, we put the AM registrations in their own (persistent) znode: drill-on-yarn. Each is keyed by the cluster ID (so we can find it), and holds the host name, HTTP port and Application ID of the AM.
When the AM starts, it atomically checks and sets the AM registration. If another AM already is running, then this AM will fail, displaying a log error message with the host, port and (most importantly) app ID so the user can locate the problem.
ZKRuntimeException
Copyright © 1970 The Apache Software Foundation. All rights reserved.