Skip to content

YARN-2571 RM to support YARN registry #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static void main(String[] args) throws Exception {
* After this call is made, no operations may be made of this
* object, <i>or of a YARN registry instance used when constructing
* this object. </i>
* @throws IOException
* @throws IOException IO problems
*/
@Override
public void close() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public interface BindFlags {

/**
* Create the entry.. This is just "0" and can be "or"ed with anything
* Create the entry.. This is just "0" and can be "or"ed with anything.
*/
int CREATE = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ public interface RegistryConstants {
/**
* prefix for registry configuration options: {@value}.
* Why <code>hadoop.</code> and not YARN? It can
* live outside YARN
* live outside YARN.
*/
String REGISTRY_PREFIX = "hadoop.registry.";

/**
* Prefix for zookeeper-specific options: {@value}
* Prefix for zookeeper-specific options: {@value}.
* <p>
* For clients using other protocols, these options are not supported.
*/
String ZK_PREFIX = REGISTRY_PREFIX + "zk.";

/**
* flag to indicate whether or not the registry should
* be enabled in the RM: {@value}
* be enabled in the RM: {@value}.
*/
String KEY_REGISTRY_ENABLED = REGISTRY_PREFIX + "rm.enabled";

/**
* Defaut value for enabling the registry in the RM: {@value}
* Default value for enabling the registry in the RM: {@value}.
*/
boolean DEFAULT_REGISTRY_ENABLED = false;

Expand All @@ -69,12 +69,12 @@ public interface RegistryConstants {
boolean DEFAULT_REGISTRY_SECURE = false;

/**
* Root path in the ZK tree for the registry: {@value}
* Root path in the ZK tree for the registry: {@value}.
*/
String KEY_REGISTRY_ZK_ROOT = ZK_PREFIX + "root";

/**
* Default root of the yarn registry: {@value}
* Default root of the yarn registry: {@value}.
*/
String DEFAULT_ZK_REGISTRY_ROOT = "/registry";

Expand All @@ -92,7 +92,7 @@ public interface RegistryConstants {

/**
* Registry client uses Kerberos: authentication is automatic from
* logged in user
* logged in user.
*/
String REGISTRY_CLIENT_AUTH_KERBEROS = "kerberos";

Expand All @@ -104,12 +104,12 @@ public interface RegistryConstants {
String REGISTRY_CLIENT_AUTH_DIGEST = "digest";

/**
* No authentication; client is anonymous
* No authentication; client is anonymous.
*/
String REGISTRY_CLIENT_AUTH_ANONYMOUS = "";

/**
* Registry client authentication ID
* Registry client authentication ID.
* <p>
* This is only used in secure clusters with
* {@link #KEY_REGISTRY_CLIENT_AUTH} set to
Expand All @@ -134,24 +134,24 @@ public interface RegistryConstants {

/**
* List of hostname:port pairs defining the
* zookeeper quorum binding for the registry {@value}
* zookeeper quorum binding for the registry {@value}.
*/
String KEY_REGISTRY_ZK_QUORUM = ZK_PREFIX + "quorum";

/**
* The default zookeeper quorum binding for the registry: {@value}
* The default zookeeper quorum binding for the registry: {@value}.
*/
String DEFAULT_REGISTRY_ZK_QUORUM = "localhost:2181";

/**
* Zookeeper session timeout in milliseconds: {@value}
* Zookeeper session timeout in milliseconds: {@value}.
*/
String KEY_REGISTRY_ZK_SESSION_TIMEOUT =
ZK_PREFIX + "session.timeout.ms";

/**
* The default ZK session timeout: {@value}.
*/
* The default ZK session timeout: {@value}.
*/
int DEFAULT_ZK_SESSION_TIMEOUT = 60000;

/**
Expand Down Expand Up @@ -224,9 +224,9 @@ public interface RegistryConstants {

/**
* A comma separated list of Zookeeper ACL identifiers with
* system access to the registry in a secure cluster: {@value}.
* user access to the registry in a secure cluster: {@value}.
*
* These are given full access to all entries.
* These are given full access to entries under the user account.
*
* If there is an "@" at the end of an entry it
* instructs the registry client to append the default kerberos domain.
Expand Down Expand Up @@ -259,7 +259,7 @@ public interface RegistryConstants {
String KEY_REGISTRY_CLIENT_JAAS_CONTEXT = REGISTRY_PREFIX + "jaas.context";

/**
* default client-side registry JAAS context: {@value}
* default client-side registry JAAS context: {@value}.
*/
String DEFAULT_REGISTRY_CLIENT_JAAS_CONTEXT = "Client";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.util.List;

/**
* Registry Operations
* Registry Operations.
*/
@InterfaceAudience.Public
@InterfaceStability.Evolving
Expand Down Expand Up @@ -63,7 +63,7 @@ boolean mknode(String path, boolean createParents)
IOException;

/**
* Bind a path in the registry to a service record
* Bind a path in the registry to a service record.
* @param path path to service record
* @param record service record service record to create/update
* @param flags bind flags
Expand All @@ -80,7 +80,7 @@ void bind(String path, ServiceRecord record, int flags)
IOException;

/**
* Resolve the record at a path
* Resolve the record at a path.
* @param path path to an entry containing a {@link ServiceRecord}
* @return the record
* @throws PathNotFoundException path is not in the registry.
Expand All @@ -97,7 +97,7 @@ ServiceRecord resolve(String path)
IOException;

/**
* Get the status of a path
* Get the status of a path.
* @param path path to query
* @return the status of the path
* @throws PathNotFoundException path is not in the registry.
Expand All @@ -115,7 +115,7 @@ RegistryPathStatus stat(String path)
* any failure downgraded to a
* @param path path to query
* @return true if the path was found
* @throws IOException
* @throws IOException IO problems
*/
boolean exists(String path) throws IOException;

Expand All @@ -125,9 +125,9 @@ RegistryPathStatus stat(String path)
* @param path path to query
* @return a possibly empty list of the short path names of
* child entries.
* @throws PathNotFoundException
* @throws InvalidPathnameException
* @throws IOException
* @throws PathNotFoundException path is not in the registry.
* @throws InvalidPathnameException the path is invalid.
* @throws IOException IO problems
*/
List<String> list(String path) throws
PathNotFoundException,
Expand Down Expand Up @@ -178,5 +178,5 @@ void delete(String path, boolean recursive)
* Only accessors added via {@link #addWriteAccessor(String, String)}
* are removed.
*/
public void clearWriteAccessors();
void clearWriteAccessors();
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* <i>Each created instance will be returned initialized.</i>
* <p>
* That is, the service will have had <code>Service.init(conf)</code> applied
* to itpossibly after the configuration has been modified to
* to it, possibly after the configuration has been modified to
* support the specific binding/security mechanism used
*/
public final class RegistryOperationsFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
* which use the mapper
* @param <T> Type to marshal.
*/
@InterfaceAudience.Private()
@InterfaceAudience.Private
@InterfaceStability.Evolving
public class JsonSerDeser<T> {

Expand All @@ -69,7 +69,7 @@ public class JsonSerDeser<T> {
private final ObjectMapper mapper;

/**
* Create an instance bound to a specific type
* Create an instance bound to a specific type.
* @param classType class to marshall
*/
public JsonSerDeser(Class<T> classType) {
Expand All @@ -88,7 +88,7 @@ public String getName() {
}

/**
* Convert from JSON
* Convert from JSON.
*
* @param json input
* @return the parsed JSON
Expand All @@ -108,7 +108,7 @@ public synchronized T fromJson(String json)
}

/**
* Convert from a JSON file
* Convert from a JSON file.
* @param jsonFile input file
* @return the parsed JSON
* @throws IOException IO problems
Expand All @@ -121,13 +121,13 @@ public synchronized T fromFile(File jsonFile)
try {
return mapper.readValue(jsonFile, classType);
} catch (IOException e) {
LOG.error("Exception while parsing json file {}: {}", jsonFile, e);
LOG.error("Exception while parsing json file {}", jsonFile, e);
throw e;
}
}

/**
* Convert from a JSON file
* Convert from a JSON file.
* @param resource input file
* @return the parsed JSON
* @throws IOException IO problems
Expand Down Expand Up @@ -164,7 +164,7 @@ public T fromInstance(T instance) throws IOException {
}

/**
* Load from a Hadoop filesystem
* Load from a Hadoop filesystem.
* @param fs filesystem
* @param path path
* @return a loaded CD
Expand All @@ -187,7 +187,7 @@ public T load(FileSystem fs, Path path)
}

/**
* Save a cluster description to a hadoop filesystem
* Save a cluster description to a hadoop filesystem.
* @param fs filesystem
* @param path path
* @param overwrite should any existing file be overwritten
Expand All @@ -201,8 +201,8 @@ public void save(FileSystem fs, Path path, T instance,
}

/**
* Write the json as bytes -then close the file
* @param dataOutputStream an outout stream that will always be closed
* Write the json as bytes -then close the file.
* @param dataOutputStream an output stream that will always be closed
* @throws IOException on any failure
*/
private void writeJsonAsBytes(T instance,
Expand All @@ -216,20 +216,21 @@ private void writeJsonAsBytes(T instance,
}

/**
* Convert JSON To bytes
* Convert JSON To bytes.
* @param instance instance to convert
* @return a byte array
* @throws IOException
* @throws IOException any problem serializing the instance.
*/
public byte[] toBytes(T instance) throws IOException {
String json = toJson(instance);
return json.getBytes(UTF_8);
}

/**
* Deserialize from a byte array
* Deserialize from a byte array.
* @param path path the data came from
* @param bytes byte array
* @return the deserialized instance
* @throws IOException all problems
* @throws EOFException not enough data
* @throws InvalidRecordException if the parsing failed -the record is invalid
Expand Down Expand Up @@ -279,7 +280,7 @@ public T fromBytes(String path, byte[] bytes, String marker)
}

/**
* Convert an instance to a JSON string
* Convert an instance to a JSON string.
* @param instance instance to convert
* @return a JSON string description
* @throws JsonProcessingException Json generation problems
Expand Down
Loading