Skip to content

Commit 695ad38

Browse files
committed
YARN-2571 patch 016 fixup of final javadoc warnings, cleanup of <String> style definitions, and make sure public/private/evolving scope is everywhere appropriate, including package infos
1 parent fa75b5e commit 695ad38

26 files changed

+155
-119
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/JsonSerDeser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* which use the mapper
5555
* @param <T> Type to marshal.
5656
*/
57-
@InterfaceAudience.Private()
57+
@InterfaceAudience.Private
5858
@InterfaceStability.Evolving
5959
public class JsonSerDeser<T> {
6060

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryPathUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public static String join(String base, String path) {
146146
public static List<String> split(String path) {
147147
//
148148
String[] pathelements = path.split("/");
149-
List<String> dirs = new ArrayList<String>(pathelements.length);
149+
List<String> dirs = new ArrayList<>(pathelements.length);
150150
for (String pathelement : pathelements) {
151151
if (!pathelement.isEmpty()) {
152152
dirs.add(pathelement);

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryTypeUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ public static void requireAddressType(String required, Endpoint epr) throws
178178
/**
179179
* Get a single URI endpoint.
180180
* @param epr endpoint
181-
* @return the uri of the first entry in the address list. Null if the endpoint
182-
* itself is null
181+
* @return the uri of the first entry in the address list.
182+
* Null if the endpoint itself is null
183183
* @throws InvalidRecordException if the type is wrong, there are no addresses
184184
* or the payload ill-formatted
185185
*/
@@ -194,7 +194,7 @@ public static List<String> retrieveAddressesUriType(Endpoint epr)
194194
throw new InvalidRecordException(epr.toString(),
195195
"No addresses in endpoint");
196196
}
197-
List<String> results = new ArrayList<String>(addresses.size());
197+
List<String> results = new ArrayList<>(addresses.size());
198198
for (Map<String, String> address : addresses) {
199199
results.add(getAddressField(address, ADDRESS_URI));
200200
}
@@ -232,7 +232,7 @@ public static List<URL> retrieveAddressURLs(Endpoint epr)
232232
throw new InvalidRecordException("", "Null endpoint");
233233
}
234234
List<String> addresses = retrieveAddressesUriType(epr);
235-
List<URL> results = new ArrayList<URL>(addresses.size());
235+
List<URL> results = new ArrayList<>(addresses.size());
236236
for (String address : addresses) {
237237
results.add(new URL(address));
238238
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/binding/RegistryUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public static Map<String, RegistryPathStatus> statChildren(
204204
IOException {
205205
List<String> childNames = registryOperations.list(path);
206206
Map<String, RegistryPathStatus> results =
207-
new HashMap<String, RegistryPathStatus>();
207+
new HashMap<>();
208208
for (String childName : childNames) {
209209
String child = join(path, childName);
210210
try {
@@ -313,7 +313,7 @@ public static Map<String, ServiceRecord> extractServiceRecords(
313313
RegistryOperations operations,
314314
String parentpath,
315315
Collection<RegistryPathStatus> stats) throws IOException {
316-
Map<String, ServiceRecord> results = new HashMap<String, ServiceRecord>(stats.size());
316+
Map<String, ServiceRecord> results = new HashMap<>(stats.size());
317317
for (RegistryPathStatus stat : stats) {
318318
if (stat.size > ServiceRecord.RECORD_TYPE.length()) {
319319
// maybe has data

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/exceptions/AuthenticationFailedException.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@
1818

1919
package org.apache.hadoop.registry.client.exceptions;
2020

21+
import org.apache.hadoop.classification.InterfaceAudience;
22+
import org.apache.hadoop.classification.InterfaceStability;
23+
2124
/**
2225
* Exception raised when client access wasn't authenticated.
2326
* That is: the credentials provided were incomplete or invalid.
2427
*/
28+
@InterfaceAudience.Public
29+
@InterfaceStability.Evolving
2530
public class AuthenticationFailedException extends RegistryIOException {
2631
public AuthenticationFailedException(String path, Throwable cause) {
2732
super(path, cause);

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/exceptions/InvalidRecordException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
/**
2525
* Raised if an attempt to parse a record failed.
26-
*
2726
*/
2827
@InterfaceAudience.Public
2928
@InterfaceStability.Evolving

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/exceptions/NoPathPermissionsException.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@
1818

1919
package org.apache.hadoop.registry.client.exceptions;
2020

21+
import org.apache.hadoop.classification.InterfaceAudience;
22+
import org.apache.hadoop.classification.InterfaceStability;
2123
import org.apache.hadoop.fs.PathIOException;
2224

2325
/**
2426
* Raised on path permission exceptions.
25-
* <p>
26-
* This is similar to PathIOException, except that exception doesn't let
2727
*/
28+
@InterfaceAudience.Public
29+
@InterfaceStability.Evolving
2830
public class NoPathPermissionsException extends RegistryIOException {
2931
public NoPathPermissionsException(String path, Throwable cause) {
3032
super(path, cause);

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/exceptions/package-info.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@
3030
* All exceptions in this package are derived from
3131
* {@link org.apache.hadoop.registry.client.exceptions.RegistryIOException}
3232
*/
33+
@InterfaceAudience.Public
34+
@InterfaceStability.Evolving
3335
package org.apache.hadoop.registry.client.exceptions;
36+
37+
import org.apache.hadoop.classification.InterfaceAudience;
38+
import org.apache.hadoop.classification.InterfaceStability;

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/CuratorService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ protected String createFullPath(String path) throws IOException {
297297
}
298298

299299
/**
300-
* Get the registry binding source ... this can be used to
301-
* create new ensemble providers
300+
* Get the registry binding source; this can be used to
301+
* create new ensemble providers.
302302
* @return the registry binding source in use
303303
*/
304304
public RegistryBindingSource getBindingSource() {

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistryBindingSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
import org.apache.hadoop.classification.InterfaceStability;
2323

2424
/**
25-
* Interface which can be implemented by a registry binding source
25+
* Interface which can be implemented by a registry binding source.
2626
*/
2727
@InterfaceAudience.Public
2828
@InterfaceStability.Evolving
2929
public interface RegistryBindingSource {
3030

3131
/**
32-
* Supply the binding information for this registry
32+
* Supply the binding information for this registry.
3333
* @return the binding information data
3434
*/
3535
BindingInformation supplyBindingInformation();

0 commit comments

Comments
 (0)