diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/cli/RegistryCli.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/cli/RegistryCli.java
index 480ce0e..0f6ad94 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/cli/RegistryCli.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/cli/RegistryCli.java
@@ -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, or of a YARN registry instance used when constructing
* this object.
- * @throws IOException
+ * @throws IOException IO problems
*/
@Override
public void close() throws IOException {
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/BindFlags.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/BindFlags.java
index 5fd2aef..6e5c614 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/BindFlags.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/BindFlags.java
@@ -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;
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryConstants.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryConstants.java
index a6fe216..b726c97 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryConstants.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryConstants.java
@@ -32,12 +32,12 @@
/**
* prefix for registry configuration options: {@value}.
* Why hadoop. 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}.
*
* For clients using other protocols, these options are not supported.
*/
@@ -45,12 +45,12 @@
/**
* 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;
@@ -69,12 +69,12 @@
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";
@@ -92,7 +92,7 @@
/**
* Registry client uses Kerberos: authentication is automatic from
- * logged in user
+ * logged in user.
*/
String REGISTRY_CLIENT_AUTH_KERBEROS = "kerberos";
@@ -104,12 +104,12 @@
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.
*
* This is only used in secure clusters with
* {@link #KEY_REGISTRY_CLIENT_AUTH} set to
@@ -134,24 +134,24 @@
/**
* 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;
/**
@@ -224,9 +224,9 @@
/**
* 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.
@@ -259,7 +259,7 @@
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";
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryOperations.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryOperations.java
index c51bcf7..1cbfaeb 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryOperations.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryOperations.java
@@ -34,7 +34,7 @@
import java.util.List;
/**
- * Registry Operations
+ * Registry Operations.
*/
@InterfaceAudience.Public
@InterfaceStability.Evolving
@@ -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
@@ -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.
@@ -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.
@@ -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;
@@ -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 list(String path) throws
PathNotFoundException,
@@ -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();
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryOperationsFactory.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryOperationsFactory.java
index 443654d..bd7756a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryOperationsFactory.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryOperationsFactory.java
@@ -32,7 +32,7 @@
* Each created instance will be returned initialized.
*
* That is, the service will have had Service.init(conf) applied
- * to it —possibly 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 {
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/JsonSerDeser.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/JsonSerDeser.java
index af4e4f4..a8188d9 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/JsonSerDeser.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/JsonSerDeser.java
@@ -70,7 +70,7 @@
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 classType) {
@@ -90,7 +90,7 @@ public String getName() {
}
/**
- * Convert from JSON
+ * Convert from JSON.
*
* @param json input
* @return the parsed JSON
@@ -109,7 +109,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
@@ -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
@@ -163,7 +163,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
@@ -186,7 +186,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
@@ -200,8 +200,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,
@@ -215,10 +215,10 @@ 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);
@@ -226,9 +226,10 @@ private void writeJsonAsBytes(T instance,
}
/**
- * 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
@@ -278,7 +279,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 JsonParseException parse problems
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryPathUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryPathUtils.java
index 5d8ea3f..53a321c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryPathUtils.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryPathUtils.java
@@ -40,14 +40,14 @@
public class RegistryPathUtils {
/**
- * Compiled down pattern to validate single entries in the path
+ * Compiled down pattern to validate single entries in the path.
*/
private static final Pattern PATH_ENTRY_VALIDATION_PATTERN =
Pattern.compile(RegistryInternalConstants.VALID_PATH_ENTRY_PATTERN);
/**
* Validate ZK path with the path itself included in
- * the exception text
+ * the exception text.
* @param path path to validate
* @return the path parameter
* @throws InvalidPathnameException if the pathname is invalid.
@@ -83,7 +83,8 @@ public static String validateElementsAsDNS(String path) throws
}
/**
- * Create a full path from the registry root and the supplied subdir
+ * Create a full path from the registry root and the supplied subdir.
+ * @param base root of the registry
* @param path path of operation
* @return an absolute path
* @throws InvalidPathnameException if the path is invalid
@@ -99,7 +100,7 @@ public static String createFullPath(String base, String path) throws
* Join two paths, guaranteeing that there will not be exactly
* one separator between the two, and exactly one at the front
* of the path. There will be no trailing "/" except for the special
- * case that this is the root path
+ * case that this is the root path.
* @param base base path
* @param path second path to add
* @return a combined path.
@@ -138,7 +139,7 @@ public static String join(String base, String path) {
}
/**
- * split a path into elements, stripping empty elements
+ * split a path into elements, stripping empty elements.
* @param path the path
* @return the split path
*/
@@ -172,7 +173,7 @@ public static String lastPathEntry(String path) {
}
/**
- * Get the parent of a path
+ * Get the parent of a path.
* @param path path to look at
* @return the parent path
* @throws PathNotFoundException if the path was at root.
@@ -198,7 +199,7 @@ public static String parentOf(String path) throws PathNotFoundException {
/**
* Perform any formatting for the registry needed to convert
- * non-simple-DNS elements
+ * non-simple-DNS elements.
* @param element element to encode
* @return an encoded string
*/
@@ -208,7 +209,7 @@ public static String encodeForRegistry(String element) {
/**
* Perform whatever transforms are needed to get a YARN ID into
- * a DNS-compatible name
+ * a DNS-compatible name.
* @param yarnId ID as string of YARN application, instance or container
* @return a string suitable for use in registry paths.
*/
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryTypeUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryTypeUtils.java
index ec59d59..2bf4adc 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryTypeUtils.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryTypeUtils.java
@@ -37,7 +37,7 @@
import java.util.Map;
/**
- * Static methods to work with registry types —primarily endpoints and the
+ * Static methods to work with registry types, primarily endpoints and the
* list representation of addresses.
*/
@InterfaceAudience.Public
@@ -45,7 +45,7 @@
public class RegistryTypeUtils {
/**
- * Create a URL endpoint from a list of URIs
+ * Create a URL endpoint from a list of URIs.
* @param api implemented API
* @param protocolType protocol type
* @param uris URIs
@@ -58,7 +58,7 @@ public static Endpoint urlEndpoint(String api,
}
/**
- * Create a REST endpoint from a list of URIs
+ * Create a REST endpoint from a list of URIs.
* @param api implemented API
* @param uris URIs
* @return a new endpoint
@@ -69,7 +69,7 @@ public static Endpoint restEndpoint(String api,
}
/**
- * Create a Web UI endpoint from a list of URIs
+ * Create a Web UI endpoint from a list of URIs.
* @param api implemented API
* @param uris URIs
* @return a new endpoint
@@ -80,7 +80,7 @@ public static Endpoint webEndpoint(String api,
}
/**
- * Create an internet address endpoint from a list of URIs
+ * Create an internet address endpoint from a list of URIs.
* @param api implemented API
* @param protocolType protocol type
* @param hostname hostname/FQDN
@@ -102,7 +102,7 @@ public static Endpoint inetAddrEndpoint(String api,
}
/**
- * Create an IPC endpoint
+ * Create an IPC endpoint.
* @param api API
* @param address the address as a tuple of (hostname, port)
* @return the new endpoint
@@ -115,19 +115,19 @@ public static Endpoint ipcEndpoint(String api, InetSocketAddress address) {
}
/**
- * Create a single entry map
+ * Create a single entry map.
* @param key map entry key
* @param val map entry value
* @return a 1 entry map.
*/
public static Map map(String key, String val) {
- Map map = new HashMap(1);
+ Map map = new HashMap<>(1);
map.put(key, val);
return map;
}
/**
- * Create a URI
+ * Create a URI.
* @param uri value
* @return a 1 entry map.
*/
@@ -136,7 +136,7 @@ public static Endpoint ipcEndpoint(String api, InetSocketAddress address) {
}
/**
- * Create a (hostname, port) address pair
+ * Create a (hostname, port) address pair.
* @param hostname hostname
* @param port port
* @return a 1 entry map.
@@ -149,7 +149,7 @@ public static Endpoint ipcEndpoint(String api, InetSocketAddress address) {
}
/**
- * Create a (hostname, port) address pair
+ * Create a (hostname, port) address pair.
* @param address socket address whose hostname and port are used for the
* generated address.
* @return a 1 entry map.
@@ -159,7 +159,7 @@ public static Endpoint ipcEndpoint(String api, InetSocketAddress address) {
}
/**
- * Require a specific address type on an endpoint
+ * Require a specific address type on an endpoint.
* @param required required type
* @param epr endpoint
* @throws InvalidRecordException if the type is wrong
@@ -176,7 +176,7 @@ public static void requireAddressType(String required, Endpoint epr) throws
}
/**
- * Get a single URI endpoint
+ * Get a single URI endpoint.
* @param epr endpoint
* @return the uri of the first entry in the address list. Null if the endpoint
* itself is null
@@ -203,7 +203,7 @@ public static void requireAddressType(String required, Endpoint epr) throws
/**
* Get a specific field from an address -raising an exception if
- * the field is not present
+ * the field is not present.
* @param address address to query
* @param field field to resolve
* @return the resolved value. Guaranteed to be non-null.
@@ -219,7 +219,7 @@ public static String getAddressField(Map address,
}
/**
- * Get the address URLs. Guranteed to return at least one address.
+ * Get the address URLs. Guaranteed to return at least one address.
* @param epr endpoint
* @return the address as a URL
* @throws InvalidRecordException if the type is wrong, there are no addresses
@@ -241,7 +241,7 @@ public static String getAddressField(Map address,
/**
* Validate the record by checking for null fields and other invalid
- * conditions
+ * conditions.
* @param path path for exceptions
* @param record record to validate. May be null
* @throws InvalidRecordException on invalid entries
@@ -270,7 +270,7 @@ public static void validateServiceRecord(String path, ServiceRecord record)
/**
* Validate the endpoint by checking for null fields and other invalid
- * conditions
+ * conditions.
* @param path path for exceptions
* @param endpoint endpoint to validate. May be null
* @throws InvalidRecordException on invalid entries
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryUtils.java
index 858b6b1..71f601f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryUtils.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryUtils.java
@@ -102,7 +102,7 @@ public static String convertUsername(String username) {
}
/**
- * Create a service classpath
+ * Create a service classpath.
* @param user username or ""
* @param serviceClass service name
* @return a full path
@@ -116,7 +116,7 @@ public static String serviceclassPath(String user,
}
/**
- * Create a path to a service under a user and service class
+ * Create a path to a service under a user and service class.
* @param user username or ""
* @param serviceClass service name
* @param serviceName service name unique for that user and service class
@@ -132,7 +132,7 @@ public static String servicePath(String user,
}
/**
- * Create a path for listing components under a service
+ * Create a path for listing components under a service.
* @param user username or ""
* @param serviceClass service name
* @param serviceName service name unique for that user and service class
@@ -146,7 +146,7 @@ public static String componentListPath(String user,
}
/**
- * Create the path to a service record for a component
+ * Create the path to a service record for a component.
* @param user username or ""
* @param serviceClass service name
* @param serviceName service name unique for that user and service class
@@ -162,12 +162,12 @@ public static String componentPath(String user,
}
/**
- * List service records directly under a path
+ * List service records directly under a path.
* @param registryOperations registry operations instance
* @param path path to list
* @return a mapping of the service records that were resolved, indexed
* by their full path
- * @throws IOException
+ * @throws IOException IO problems
*/
public static Map listServiceRecords(
RegistryOperations registryOperations,
@@ -186,8 +186,9 @@ public static String componentPath(String user,
* This is not an atomic operation; A child may be deleted
* during the iteration through the child entries. If this happens,
* the PathNotFoundException is caught and that child
- * entry ommitted.
+ * entry omitted.
*
+ * @param registryOperations operations instance to use
* @param path path
* @return a possibly empty map of child entries listed by
* their short name.
@@ -279,7 +280,7 @@ public static String getCurrentUsernameUnencoded(String env_hadoop_username) {
}
/**
- * Get the current user path formatted for the registry
+ * Get the current user path formatted for the registry.
*
* In an insecure cluster, the environment variable
* HADOOP_USER_NAME is queried first.
@@ -344,6 +345,7 @@ public static String currentUser() {
*
* @param operations operation support for fetches
* @param parentpath path of the parent of all the entries
+ * @param stats list of registry stat values to examine
* @return a possibly empty map of fullpath:record.
* @throws IOException for any IO Operation that wasn't ignored.
*/
@@ -376,7 +378,7 @@ public static String currentUser() {
/**
- * Static instance of service record marshalling
+ * Static instance of service record marshalling.
*/
public static class ServiceRecordMarshal extends JsonSerDeser {
public ServiceRecordMarshal() {
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/BindingInformation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/BindingInformation.java
index 8ae003d..5c97fd5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/BindingInformation.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/BindingInformation.java
@@ -23,19 +23,19 @@
import org.apache.hadoop.classification.InterfaceStability;
/**
- * Binding information provided by a {@link RegistryBindingSource}
+ * Binding information provided by a {@link RegistryBindingSource}.
*/
@InterfaceAudience.Public
@InterfaceStability.Evolving
public class BindingInformation {
/**
- * The Curator Ensemble Provider
+ * The Curator Ensemble Provider.
*/
public EnsembleProvider ensembleProvider;
/**
- * Any information that may be useful for diagnostics
+ * Any information that may be useful for diagnostics.
*/
public String description;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/CuratorService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/CuratorService.java
index 7f35c3f..f4df778 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/CuratorService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/CuratorService.java
@@ -69,12 +69,12 @@
LoggerFactory.getLogger(CuratorService.class);
/**
- * the Curator binding
+ * the Curator binding.
*/
private CuratorFramework curator;
/**
- * Path to the registry root
+ * Path to the registry root.
*/
private String registryRoot;
@@ -85,17 +85,17 @@
private final RegistryBindingSource bindingSource;
/**
- * Security service
+ * Security service.
*/
private RegistrySecurity registrySecurity;
/**
- * the connection binding text for messages
+ * the connection binding text for messages.
*/
private String connectionDescription;
/**
- * Security connection diagnostics
+ * Security connection diagnostics.
*/
private String securityConnectionDiagnostics = "";
@@ -133,7 +133,7 @@ public CuratorService(String name) {
* Init the service.
* This is where the security bindings are set up
* @param conf configuration of the service
- * @throws Exception
+ * @throws Exception initialization problems.
*/
@Override
protected void serviceInit(Configuration conf) throws Exception {
@@ -155,7 +155,7 @@ protected void serviceInit(Configuration conf) throws Exception {
/**
* Start the service.
* This is where the curator instance is started.
- * @throws Exception
+ * @throws Exception startup problems
*/
@Override
protected void serviceStart() throws Exception {
@@ -167,7 +167,7 @@ protected void serviceStart() throws Exception {
}
/**
- * Close the ZK connection if it is open
+ * Close the ZK connection if it is open.
*/
@Override
protected void serviceStop() throws Exception {
@@ -176,7 +176,7 @@ protected void serviceStop() throws Exception {
}
/**
- * Internal check that a service is in the live state
+ * Internal check that a service is in the live state.
* @throws ServiceStateException if not
*/
private void checkServiceLive() throws ServiceStateException {
@@ -197,7 +197,7 @@ public boolean isSecure() {
}
/**
- * Get the registry security helper
+ * Get the registry security helper.
* @return the registry security helper
*/
protected RegistrySecurity getRegistrySecurity() {
@@ -205,7 +205,7 @@ protected RegistrySecurity getRegistrySecurity() {
}
/**
- * Build the security diagnostics string
+ * Build the security diagnostics string.
* @return a string for diagnostics
*/
protected String buildSecurityDiagnostics() {
@@ -277,7 +277,7 @@ public String toString() {
}
/**
- * Get the binding diagnostics
+ * Get the binding diagnostics.
* @return a diagnostics string valid after the service is started.
*/
public String bindingDiagnosticDetails() {
@@ -287,7 +287,7 @@ public String bindingDiagnosticDetails() {
}
/**
- * Create a full path from the registry root and the supplied subdir
+ * Create a full path from the registry root and the supplied subdir.
* @param path path of operation
* @return an absolute path
* @throws IllegalArgumentException if the path is invalide
@@ -308,7 +308,7 @@ public RegistryBindingSource getBindingSource() {
/**
* Create the ensemble provider for this registry, by invoking
* {@link RegistryBindingSource#supplyBindingInformation()} on
- * the provider stored in {@link #bindingSource}
+ * the provider stored in {@link #bindingSource}.
* Sets {@link #ensembleProvider} to that value;
* sets {@link #connectionDescription} to the binding info
* for use in toString and logging;
@@ -339,7 +339,7 @@ public BindingInformation supplyBindingInformation() {
/**
* Override point: get the connection string used to connect to
- * the ZK service
+ * the ZK service.
* @return a registry quorum
*/
protected String buildConnectionString() {
@@ -348,7 +348,7 @@ protected String buildConnectionString() {
}
/**
- * Create an IOE when an operation fails
+ * Create an IOE when an operation fails.
* @param path path of operation
* @param operation operation attempted
* @param exception caught the exception caught
@@ -361,7 +361,7 @@ protected IOException operationFailure(String path,
}
/**
- * Create an IOE when an operation fails
+ * Create an IOE when an operation fails.
* @param path path of operation
* @param operation operation attempted
* @param exception caught the exception caught
@@ -421,7 +421,7 @@ protected IOException operationFailure(String path,
* @param acl ACL for path -used when creating a new entry
* @param createParents flag to trigger parent creation
* @return true iff the path was created
- * @throws IOException
+ * @throws IOException problem creating the path.
*/
@VisibleForTesting
public boolean maybeCreate(String path,
@@ -432,11 +432,12 @@ public boolean maybeCreate(String path,
}
/**
- * Stat the file
+ * Stat the file.
* @param path path of operation
* @return a curator stat entry
* @throws IOException on a failure
* @throws PathNotFoundException if the path was not found
+ * @throws IOException any other problem
*/
public Stat zkStat(String path) throws IOException {
checkServiceLive();
@@ -457,10 +458,11 @@ public Stat zkStat(String path) throws IOException {
}
/**
- * Get the ACLs of a path
+ * Get the ACLs of a path.
* @param path path of operation
* @return a possibly empty list of ACLs
- * @throws IOException
+ * @throws PathNotFoundException if the path was not found
+ * @throws IOException any other problem
*/
public List zkGetACLS(String path) throws IOException {
checkServiceLive();
@@ -481,10 +483,11 @@ public Stat zkStat(String path) throws IOException {
}
/**
- * Probe for a path existing
+ * Probe for a path existing.
* @param path path of operation
* @return true if the path was visible from the ZK server
* queried.
+ * @throws PathNotFoundException if the path was not found
* @throws IOException on any exception other than
* {@link PathNotFoundException}
*/
@@ -497,16 +500,14 @@ public boolean zkPathExists(String path) throws IOException {
return true;
} catch (PathNotFoundException e) {
return false;
- } catch (IOException e) {
- throw e;
}
}
/**
- * Verify a path exists
+ * Verify a path exists.
* @param path path of operation
* @throws PathNotFoundException if the path is absent
- * @throws IOException
+ * @throws IOException any other problem
*/
public String zkPathMustExist(String path) throws IOException {
zkStat(path);
@@ -558,7 +559,7 @@ public boolean zkMkPath(String path,
}
/**
- * Recursively make a path
+ * Recursively make a path.
* @param path path to create
* @param acl ACL for path
* @throws IOException any problem
@@ -574,11 +575,11 @@ public void zkMkParentPath(String path,
/**
* Create a path with given data. byte[0] is used for a path
- * without data
+ * without data.
* @param path path of operation
* @param data initial data
- * @param acls
- * @throws IOException
+ * @param acls ACL list
+ * @throws IOException any problem creating the path.
*/
public void zkCreate(String path,
CreateMode mode,
@@ -600,10 +601,10 @@ public void zkCreate(String path,
}
/**
- * Update the data for a path
+ * Update the data for a path.
* @param path path of operation
* @param data new data
- * @throws IOException
+ * @throws IOException any problem updating the path.
*/
public void zkUpdate(String path, byte[] data) throws IOException {
Preconditions.checkArgument(data != null, "null data");
@@ -620,12 +621,13 @@ public void zkUpdate(String path, byte[] data) throws IOException {
}
/**
- * Create or update an entry
+ * Create or update an entry.
* @param path path
* @param data data
* @param acl ACL for path -used when creating a new entry
* @param overwrite enable overwrite
- * @throws IOException
+ * @throws FileAlreadyExistsException if the path existed and overwrite==false
+ * @throws IOException IO problem
* @return true if the entry was created, false if it was simply updated.
*/
public boolean zkSet(String path,
@@ -682,10 +684,10 @@ public void zkDelete(String path,
}
/**
- * List all children of a path
+ * List all children of a path.
* @param path path of operation
* @return a possibly empty list of children
- * @throws IOException
+ * @throws IOException read failure
*/
public List zkList(String path) throws IOException {
checkServiceLive();
@@ -703,7 +705,7 @@ public void zkDelete(String path,
}
/**
- * Read data on a path
+ * Read data on a path.
* @param path path of operation
* @return the data
* @throws IOException read failure
@@ -723,7 +725,7 @@ public void zkDelete(String path,
/**
* Return a path dumper instance which can do a full dump
- * of the registry tree in its toString()
+ * of the registry tree in its toString().
* operation
* @return a class to dump the registry
* @param verbose verbose flag - includes more details (such as ACLs)
@@ -746,7 +748,7 @@ public boolean addWriteAccessor(String id, String pass) throws IOException {
}
/**
- * Clear all write accessors
+ * Clear all write accessors.
*/
public void clearWriteAccessors() {
getRegistrySecurity().resetDigestACLs();
@@ -765,7 +767,7 @@ protected String dumpRegistryRobustly(boolean verbose) {
return pathDumper.toString();
} catch (Exception e) {
// ignore
- LOG.debug("Ignoring exception: {}", e);
+ LOG.debug("Ignoring exception", e);
}
return "";
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistryInternalConstants.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistryInternalConstants.java
index f04673a..af9897d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistryInternalConstants.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistryInternalConstants.java
@@ -46,7 +46,7 @@
int PERMISSIONS_REGISTRY_READERS = ZooDefs.Perms.READ;
/**
- * Permissions for system services: {@value}
+ * Permissions for system services: {@value}.
*/
int PERMISSIONS_REGISTRY_SYSTEM_SERVICES = ZooDefs.Perms.ALL;
@@ -75,7 +75,7 @@
/**
* This the Hadoop environment variable which propagates the identity
- * of a user in an insecure cluster
+ * of a user in an insecure cluster.
*/
String HADOOP_USER_NAME = "HADOOP_USER_NAME";
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java
index 49673fc..a85bac8 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java
@@ -76,7 +76,7 @@
/**
* there's no default user to add with permissions, so it would be
- * impossible to create nodes with unrestricted user access
+ * impossible to create nodes with unrestricted user access.
*/
public static final String E_NO_USER_DETERMINED_FOR_ACLS =
"No user for ACLs determinable from current user or registry option "
@@ -90,31 +90,31 @@
"Registry security is enabled -but Hadoop security is not enabled";
/**
- * Access policy options
+ * Access policy options.
*/
private enum AccessPolicy {
anon, sasl, digest
}
/**
- * Access mechanism
+ * Access mechanism.
*/
private AccessPolicy access;
/**
- * User used for digest auth
+ * User used for digest auth.
*/
private String digestAuthUser;
/**
- * Password used for digest auth
+ * Password used for digest auth.
*/
private String digestAuthPassword;
/**
- * Auth data used for digest auth
+ * Auth data used for digest auth.
*/
private byte[] digestAuthData;
@@ -124,13 +124,13 @@
private boolean secureRegistry;
/**
- * An ACL with read-write access for anyone
+ * An ACL with read-write access for anyone.
*/
public static final ACL ALL_READWRITE_ACCESS =
new ACL(ZooDefs.Perms.ALL, ZooDefs.Ids.ANYONE_ID_UNSAFE);
/**
- * An ACL with read access for anyone
+ * An ACL with read access for anyone.
*/
public static final ACL ALL_READ_ACCESS =
new ACL(ZooDefs.Perms.READ, ZooDefs.Ids.ANYONE_ID_UNSAFE);
@@ -142,39 +142,39 @@
public static final List WorldReadWriteACL;
static {
- List acls = new ArrayList();
+ List acls = new ArrayList<>();
acls.add(ALL_READWRITE_ACCESS);
- WorldReadWriteACL = new CopyOnWriteArrayList(acls);
+ WorldReadWriteACL = new CopyOnWriteArrayList<>(acls);
}
/**
- * the list of system ACLs
+ * the list of system ACLs.
*/
- private final List systemACLs = new ArrayList();
+ private final List systemACLs = new ArrayList<>();
/**
* A list of digest ACLs which can be added to permissions
- * —and cleared later.
+ * and cleared later.
*/
- private final List digestACLs = new ArrayList();
+ private final List digestACLs = new ArrayList<>();
/**
- * the default kerberos realm
+ * the default kerberos realm.
*/
private String kerberosRealm;
/**
- * Client context
+ * Client context.
*/
private String jaasClientContext;
/**
- * Client identity
+ * Client identity.
*/
private String jaasClientIdentity;
/**
- * Create an instance
+ * Create an instance.
* @param name service name
*/
public RegistrySecurity(String name) {
@@ -182,9 +182,10 @@ public RegistrySecurity(String name) {
}
/**
- * Init the service: this sets up security based on the configuration
+ * Init the service: this sets up security based on the configuration.
* @param conf configuration
- * @throws Exception
+ * @throws ServiceStateException if the authenticatin mechanism is unknown.
+ * @throws Exception any initialization problem.
*/
@Override
protected void serviceInit(Configuration conf) throws Exception {
@@ -213,7 +214,7 @@ protected void serviceInit(Configuration conf) throws Exception {
* Init security.
*
* After this operation, the {@link #systemACLs} list is valid.
- * @throws IOException
+ * @throws IOException problems initializing security.
*/
private void initSecurity() throws IOException {
@@ -248,7 +249,7 @@ private void initSecurity() throws IOException {
}
}
- // here check for UGI having secure on or digest + ID
+ // configure security access based on settings.
switch (access) {
case sasl:
// secure + SASL => has to be authenticated
@@ -291,7 +292,7 @@ private void initSecurity() throws IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("Auth is anonymous");
}
- userACLs = new ArrayList(0);
+ userACLs = new ArrayList<>(0);
break;
}
systemACLs.addAll(userACLs);
@@ -306,7 +307,7 @@ private void initSecurity() throws IOException {
}
/**
- * Add another system ACL
+ * Add another system ACL.
* @param acl add ACL
*/
public void addSystemACL(ACL acl) {
@@ -314,8 +315,9 @@ public void addSystemACL(ACL acl) {
}
/**
- * Add a digest ACL
+ * Add a digest ACL.
* @param acl add ACL
+ * @return true if the registry is secure and the ACL added
*/
public boolean addDigestACL(ACL acl) {
if (secureRegistry) {
@@ -334,7 +336,7 @@ public boolean addDigestACL(ACL acl) {
}
/**
- * Reset the digest ACL list
+ * Reset the digest ACL list.
*/
public void resetDigestACLs() {
if (LOG.isDebugEnabled()) {
@@ -344,7 +346,7 @@ public void resetDigestACLs() {
}
/**
- * Flag to indicate the cluster is secure
+ * Flag to indicate the cluster is secure.
* @return true if the config enabled security
*/
public boolean isSecureRegistry() {
@@ -352,7 +354,7 @@ public boolean isSecureRegistry() {
}
/**
- * Get the system principals
+ * Get the system principals.
* @return the system principals
*/
public List getSystemACLs() {
@@ -361,21 +363,21 @@ public boolean isSecureRegistry() {
}
/**
- * Get all ACLs needed for a client to use when writing to the repo.
+ * Get all ACLs needed for a client to use when creating a new entry.
* That is: system ACLs, its own ACL, any digest ACLs
* @return the client ACLs
*/
public List getClientACLs() {
- List clientACLs = new ArrayList(systemACLs);
+ List clientACLs = new ArrayList<>(systemACLs);
clientACLs.addAll(digestACLs);
return clientACLs;
}
/**
- * Create a SASL ACL for the user
+ * Create a SASL ACL for the user.
* @param perms permissions
* @return an ACL for the current user or null if they aren't a kerberos user
- * @throws IOException
+ * @throws IOException IO problems
*/
public ACL createSaslACLFromCurrentUser(int perms) throws IOException {
UserGroupInformation currentUser = UserGroupInformation.getCurrentUser();
@@ -387,7 +389,7 @@ public ACL createSaslACLFromCurrentUser(int perms) throws IOException {
}
/**
- * Given a UGI, create a SASL ACL from it
+ * Given a UGI, create a SASL ACL from it.
* @param ugi UGI
* @param perms permissions
* @return a new ACL
@@ -398,7 +400,7 @@ public ACL createSaslACL(UserGroupInformation ugi, int perms) {
}
/**
- * Get a conf option, throw an exception if it is null/empty
+ * Get a conf option, throw an exception if it is null/empty.
* @param key key
* @param defval default value
* @return the value
@@ -437,9 +439,10 @@ public String getKerberosRealm() {
}
/**
- * Generate a base-64 encoded digest of the idPasswordPair pair
+ * Generate a base-64 encoded digest of the idPasswordPair pair.
* @param idPasswordPair id:password
* @return a string that can be used for authentication
+ * @throws IOException on invalid idPasswordPair or digest problems
*/
public String digest(String idPasswordPair) throws IOException {
if (StringUtils.isEmpty(idPasswordPair) || !isValid(idPasswordPair)) {
@@ -455,18 +458,18 @@ public String digest(String idPasswordPair) throws IOException {
}
/**
- * Generate a base-64 encoded digest of the idPasswordPair pair
+ * Generate a base-64 encoded digest of the idPasswordPair pair.
* @param id ID
* @param password pass
* @return a string that can be used for authentication
- * @throws IOException
+ * @throws IOException on invalid idPasswordPair or digest problems
*/
public String digest(String id, String password) throws IOException {
return digest(id + ":" + password);
}
/**
- * Given a digest, create an ID from it
+ * Given a digest, create an ID from it.
* @param digest digest
* @return ID
*/
@@ -475,7 +478,7 @@ public Id toDigestId(String digest) {
}
/**
- * Create a Digest ID from an id:pass pair
+ * Create a Digest ID from an id:pass pair.
* @param id ID
* @param password password
* @return an ID
@@ -542,7 +545,7 @@ public Id parse(String idPair, String realm) {
}
/**
- * Parse the IDs, adding a realm if needed, setting the permissions
+ * Parse the IDs, adding a realm if needed, setting the permissions.
* @param principalList id string
* @param realm realm to add
* @param perms permissions
@@ -552,7 +555,7 @@ public Id parse(String idPair, String realm) {
public List buildACLs(String principalList, String realm, int perms)
throws IOException {
List aclPairs = splitAclPairs(principalList, realm);
- List ids = new ArrayList(aclPairs.size());
+ List ids = new ArrayList<>(aclPairs.size());
for (String aclPair : aclPairs) {
ACL newAcl = new ACL();
newAcl.setId(parse(aclPair, realm));
@@ -563,7 +566,7 @@ public Id parse(String idPair, String realm) {
}
/**
- * Parse an ACL list. This includes configuration indirection
+ * Parse an ACL list. This includes configuration indirection.
* {@link ZKUtil#resolveConfIndirection(String)}
* @param zkAclConf configuration string
* @return an ACL list
@@ -583,15 +586,11 @@ public Id parse(String idPair, String realm) {
* @return a JVM-specific kerberos login module classname.
*/
public static String getKerberosAuthModuleForJVM() {
- if (System.getProperty("java.vendor").contains("IBM")) {
- return "com.ibm.security.auth.module.Krb5LoginModule";
- } else {
- return "com.sun.security.auth.module.Krb5LoginModule";
- }
+ return KerberosUtil.getKrb5LoginModuleName();
}
/**
- * JAAS template: {@value}
+ * JAAS template: {@value}.
* Note the semicolon on the last entry
*/
private static final String JAAS_ENTRY =
@@ -609,7 +608,7 @@ public static String getKerberosAuthModuleForJVM() {
;
/**
- * Create a JAAS entry for insertion
+ * Create a JAAS entry for insertion.
* @param context context of the entry
* @param principal kerberos principal
* @param keytab keytab
@@ -653,7 +652,7 @@ public static void bindJVMtoJAASFile(File jaasFile) {
}
/**
- * Set the Zookeeper server property
+ * Set the Zookeeper server property.
* {@link ZookeeperConfigOptions#PROP_ZK_SERVER_SASL_CONTEXT}
* to the SASL context. When the ZK server starts, this is the context
* which it will read in
@@ -664,7 +663,7 @@ public static void bindZKToServerJAASContext(String contextName) {
}
/**
- * Reset any system properties related to JAAS
+ * Reset any system properties related to JAAS.
*/
public static void clearJaasSystemProperties() {
System.clearProperty(Environment.JAAS_CONF_KEY);
@@ -742,7 +741,7 @@ public static void setZKSaslClientProperties(String username,
}
/**
- * Clear all the ZK SASL Client properties
+ * Clear all the ZK SASL Client properties.
* Important:This is JVM-wide
*/
public static void clearZKSaslClientProperties() {
@@ -752,7 +751,7 @@ public static void clearZKSaslClientProperties() {
}
/**
- * Turn ZK SASL on
+ * Turn ZK SASL on.
* Important:This is JVM-wide
*/
protected static void enableZookeeperClientSASL() {
@@ -787,7 +786,7 @@ public void logCurrentHadoopUser() {
UserGroupInformation realUser = currentUser.getRealUser();
LOG.info("Real User = {}" , realUser);
} catch (IOException e) {
- LOG.warn("Failed to get current user {}, {}", e);
+ LOG.warn("Failed to get current user", e);
}
}
@@ -812,7 +811,7 @@ public static String aclsToString(List acls) {
}
/**
- * Convert an ACL to a string, with any obfuscation needed
+ * Convert an ACL to a string, with any obfuscation needed.
* @param acl ACL
* @return ACL string value
*/
@@ -826,7 +825,7 @@ public static String aclToString(ACL acl) {
/**
* Convert an ID to a string, stripping out all but the first few characters
- * of any digest auth hash for security reasons
+ * of any digest auth hash for security reasons.
* @param id ID
* @return a string description of a Zookeeper ID
*/
@@ -846,7 +845,7 @@ public static String idToString(Id id) {
}
/**
- * Build up low-level security diagnostics to aid debugging
+ * Build up low-level security diagnostics to aid debugging.
* @return a string to use in diagnostics
*/
public String buildSecurityDiagnostics() {
@@ -893,8 +892,8 @@ private static String describeProperty(String name, String def) {
}
/**
- * Get the default kerberos realm —returning "" if there
- * is no realm or other problem
+ * Get the default kerberos realm -returning "" if there
+ * is no realm or other problem.
* @return the default realm of the system if it
* could be determined
*/
@@ -917,12 +916,13 @@ public static String getDefaultRealmInJVM() {
/**
* Create an ACL For a user.
* @param ugi User identity
- * @return the ACL For the specified user. Ifthe username doesn't end
+ * @param perms permissions to pass to {@link #createACLfromUsername(String, int)}
+ * @return the ACL For the specified user. If the username doesn't end
* in "@" then the realm is added
*/
public ACL createACLForUser(UserGroupInformation ugi, int perms) {
if (LOG.isDebugEnabled()) {
- LOG.debug("Creating ACL For ", new UgiInfo(ugi));
+ LOG.debug("Creating ACL For {}", new UgiInfo(ugi));
}
if (!secureRegistry) {
return ALL_READWRITE_ACCESS;
@@ -932,7 +932,7 @@ public ACL createACLForUser(UserGroupInformation ugi, int perms) {
}
/**
- * Given a user name (short or long), create a SASL ACL
+ * Given a user name (short or long), create a SASL ACL.
* @param username user name; if it doesn't contain an "@" symbol, the
* service's kerberos realm is added
* @param perms permissions
@@ -949,7 +949,7 @@ public ACL createACLfromUsername(String username, int perms) {
}
/**
- * On demand string-ifier for UGI with extra details
+ * On demand string-ifier for UGI with extra details.
*/
public static class UgiInfo {
@@ -957,7 +957,7 @@ public static UgiInfo fromCurrentUser() {
try {
return new UgiInfo(UserGroupInformation.getCurrentUser());
} catch (IOException e) {
- LOG.info("Failed to get current user {}", e, e);
+ LOG.info("Failed to get current user", e);
return new UgiInfo(null);
}
}
@@ -979,14 +979,15 @@ public String toString() {
builder.append(" hasKerberosCredentials=").append(
ugi.hasKerberosCredentials());
builder.append(" isFromKeytab=").append(ugi.isFromKeytab());
- builder.append(" kerberos is enabled in Hadoop =").append(UserGroupInformation.isSecurityEnabled());
+ builder.append(" kerberos is enabled in Hadoop =")
+ .append(UserGroupInformation.isSecurityEnabled());
return builder.toString();
}
}
/**
- * on-demand stringifier for a list of ACLs
+ * on-demand stringifier for a list of ACLs.
*/
public static class AclListInfo {
public final List acls;
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZKPathDumper.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZKPathDumper.java
index 3c4a730..44a3839 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZKPathDumper.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZKPathDumper.java
@@ -43,7 +43,7 @@
private final boolean verbose;
/**
- * Create a path dumper -but do not dump the path until asked
+ * Create a path dumper -but do not dump the path until asked.
* @param curator curator instance
* @param root root
* @param verbose verbose flag - includes more details (such as ACLs)
@@ -73,7 +73,7 @@ public String toString() {
/**
* Recursively expand the path into the supplied string builder, increasing
* the indentation by {@link #INDENT} as it proceeds (depth first) down
- * the tree
+ * the tree.
* @param builder string build to append to
* @param path path to examine
* @param indent current indentation
@@ -120,7 +120,7 @@ private void expand(StringBuilder builder,
}
/**
- * Append the specified indentation to a builder
+ * Append the specified indentation to a builder.
* @param builder string build to append to
* @param indent current indentation
* @param c charactor to use for indentation
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZookeeperConfigOptions.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZookeeperConfigOptions.java
index edcf085..7c5092a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZookeeperConfigOptions.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZookeeperConfigOptions.java
@@ -23,13 +23,13 @@
/**
* Configuration options which are internal to Zookeeper,
- * as well as some other ZK constants
+ * as well as some other ZK constants.
*
* Zookeeper options are passed via system properties prior to the ZK
* Methods/classes being invoked. This implies that:
*
*
There can only be one instance of a ZK client or service class
- * in a single JVM —else their configuration options will conflict.
+ * in a single JVM -else their configuration options will conflict.
*
It is safest to set these properties immediately before
* invoking ZK operations.
*
@@ -77,7 +77,7 @@
/**
* The SASL Server context, referring to a context in the JVM's
- * JAAS context file: {@value}
+ * JAAS context file: {@value}.
*/
String PROP_ZK_SERVER_SASL_CONTEXT =
ZooKeeperSaslServer.LOGIN_CONTEXT_NAME_KEY;
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/types/Endpoint.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/types/Endpoint.java
index e4effb4..83cc9e8 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/types/Endpoint.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/types/Endpoint.java
@@ -50,7 +50,7 @@
public final class Endpoint implements Cloneable {
/**
- * API implemented at the end of the binding
+ * API implemented at the end of the binding.
*/
public String api;
@@ -67,7 +67,7 @@
public String protocolType;
/**
- * a list of address tuples —tuples whose format depends on the address type
+ * a list of address tuples -tuples whose format depends on the address type.
*/
public List