Skip to content

Commit fa75b5e

Browse files
committed
YARN-2517 patch 015: remove a test which was obsolete, but which didn't show as it was broken. Fix up more javadocs
1 parent 5b1caa1 commit fa75b5e

File tree

10 files changed

+29
-48
lines changed

10 files changed

+29
-48
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/api/RegistryOperationsFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* <i>Each created instance will be returned initialized.</i>
3333
* <p>
3434
* That is, the service will have had <code>Service.init(conf)</code> applied
35-
* to itpossibly after the configuration has been modified to
35+
* to it, possibly after the configuration has been modified to
3636
* support the specific binding/security mechanism used
3737
*/
3838
public final class RegistryOperationsFactory {

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
import java.util.Map;
3838

3939
/**
40-
* Static methods to work with registry typesprimarily endpoints and the
40+
* Static methods to work with registry types, primarily endpoints and the
4141
* list representation of addresses.
4242
*/
4343
@InterfaceAudience.Public
4444
@InterfaceStability.Evolving
4545
public class RegistryTypeUtils {
4646

4747
/**
48-
* Create a URL endpoint from a list of URIs
48+
* Create a URL endpoint from a list of URIs.
4949
* @param api implemented API
5050
* @param protocolType protocol type
5151
* @param uris URIs
@@ -58,7 +58,7 @@ public static Endpoint urlEndpoint(String api,
5858
}
5959

6060
/**
61-
* Create a REST endpoint from a list of URIs
61+
* Create a REST endpoint from a list of URIs.
6262
* @param api implemented API
6363
* @param uris URIs
6464
* @return a new endpoint
@@ -69,7 +69,7 @@ public static Endpoint restEndpoint(String api,
6969
}
7070

7171
/**
72-
* Create a Web UI endpoint from a list of URIs
72+
* Create a Web UI endpoint from a list of URIs.
7373
* @param api implemented API
7474
* @param uris URIs
7575
* @return a new endpoint
@@ -80,7 +80,7 @@ public static Endpoint webEndpoint(String api,
8080
}
8181

8282
/**
83-
* Create an internet address endpoint from a list of URIs
83+
* Create an internet address endpoint from a list of URIs.
8484
* @param api implemented API
8585
* @param protocolType protocol type
8686
* @param hostname hostname/FQDN
@@ -102,7 +102,7 @@ public static Endpoint inetAddrEndpoint(String api,
102102
}
103103

104104
/**
105-
* Create an IPC endpoint
105+
* Create an IPC endpoint.
106106
* @param api API
107107
* @param address the address as a tuple of (hostname, port)
108108
* @return the new endpoint
@@ -115,19 +115,19 @@ public static Endpoint ipcEndpoint(String api, InetSocketAddress address) {
115115
}
116116

117117
/**
118-
* Create a single entry map
118+
* Create a single entry map.
119119
* @param key map entry key
120120
* @param val map entry value
121121
* @return a 1 entry map.
122122
*/
123123
public static Map<String, String> map(String key, String val) {
124-
Map<String, String> map = new HashMap<String, String>(1);
124+
Map<String, String> map = new HashMap<>(1);
125125
map.put(key, val);
126126
return map;
127127
}
128128

129129
/**
130-
* Create a URI
130+
* Create a URI.
131131
* @param uri value
132132
* @return a 1 entry map.
133133
*/
@@ -136,7 +136,7 @@ public static Map<String, String> uri(String uri) {
136136
}
137137

138138
/**
139-
* Create a (hostname, port) address pair
139+
* Create a (hostname, port) address pair.
140140
* @param hostname hostname
141141
* @param port port
142142
* @return a 1 entry map.
@@ -149,7 +149,7 @@ public static Map<String, String> hostnamePortPair(String hostname, int port) {
149149
}
150150

151151
/**
152-
* Create a (hostname, port) address pair
152+
* Create a (hostname, port) address pair.
153153
* @param address socket address whose hostname and port are used for the
154154
* generated address.
155155
* @return a 1 entry map.
@@ -159,7 +159,7 @@ public static Map<String, String> hostnamePortPair(InetSocketAddress address) {
159159
}
160160

161161
/**
162-
* Require a specific address type on an endpoint
162+
* Require a specific address type on an endpoint.
163163
* @param required required type
164164
* @param epr endpoint
165165
* @throws InvalidRecordException if the type is wrong
@@ -176,7 +176,7 @@ public static void requireAddressType(String required, Endpoint epr) throws
176176
}
177177

178178
/**
179-
* Get a single URI endpoint
179+
* Get a single URI endpoint.
180180
* @param epr endpoint
181181
* @return the uri of the first entry in the address list. Null if the endpoint
182182
* itself is null
@@ -203,7 +203,7 @@ public static List<String> retrieveAddressesUriType(Endpoint epr)
203203

204204
/**
205205
* Get a specific field from an address -raising an exception if
206-
* the field is not present
206+
* the field is not present.
207207
* @param address address to query
208208
* @param field field to resolve
209209
* @return the resolved value. Guaranteed to be non-null.
@@ -219,7 +219,7 @@ public static String getAddressField(Map<String, String> address,
219219
}
220220

221221
/**
222-
* Get the address URLs. Guranteed to return at least one address.
222+
* Get the address URLs. Guaranteed to return at least one address.
223223
* @param epr endpoint
224224
* @return the address as a URL
225225
* @throws InvalidRecordException if the type is wrong, there are no addresses
@@ -241,7 +241,7 @@ public static List<URL> retrieveAddressURLs(Endpoint epr)
241241

242242
/**
243243
* Validate the record by checking for null fields and other invalid
244-
* conditions
244+
* conditions.
245245
* @param path path for exceptions
246246
* @param record record to validate. May be null
247247
* @throws InvalidRecordException on invalid entries
@@ -270,7 +270,7 @@ public static void validateServiceRecord(String path, ServiceRecord record)
270270

271271
/**
272272
* Validate the endpoint by checking for null fields and other invalid
273-
* conditions
273+
* conditions.
274274
* @param path path for exceptions
275275
* @param endpoint endpoint to validate. May be null
276276
* @throws InvalidRecordException on invalid entries

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private enum AccessPolicy {
156156

157157
/**
158158
* A list of digest ACLs which can be added to permissions
159-
* and cleared later.
159+
* and cleared later.
160160
*/
161161
private final List<ACL> digestACLs = new ArrayList<>();
162162

@@ -251,7 +251,7 @@ private void initSecurity() throws IOException {
251251
}
252252
}
253253

254-
// here check for UGI having secure on or digest + ID
254+
// configure security access based on settings.
255255
switch (access) {
256256
case sasl:
257257
// secure + SASL => has to be authenticated

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* Methods/classes being invoked. This implies that:
3030
* <ol>
3131
* <li>There can only be one instance of a ZK client or service class
32-
* in a single JVM else their configuration options will conflict.</li>
32+
* in a single JVM -else their configuration options will conflict.</li>
3333
* <li>It is safest to set these properties immediately before
3434
* invoking ZK operations.</li>
3535
* </ol>

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/types/Endpoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public Endpoint(String api,
140140
* @param api API name
141141
* @param addressType address type
142142
* @param protocolType protocol type
143-
* @param addr address. May be null in which case it is not added
143+
* @param addr address. May be null -in which case it is not added
144144
*/
145145
public Endpoint(String api,
146146
String addressType,

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/types/ProtocolTypes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public interface ProtocolTypes {
7474
String PROTOCOL_UDP = "udp";
7575

7676
/**
77-
* Default value the protocol is unknown : "{@value}"
77+
* Default value -the protocol is unknown : "{@value}"
7878
*/
7979
String PROTOCOL_UNKNOWN = "";
8080

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* </ul>
3333
*
3434
* The {@link org.apache.hadoop.registry.client.types.RegistryPathStatus}
35-
* class is not saved to the registry it is the status of a registry
35+
* class is not saved to the registry -it is the status of a registry
3636
* entry that can be retrieved from the API call. It is still
3737
* designed to be marshalled to and from JSON, as it can be served up
3838
* from REST front ends to the registry.

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/server/services/AddingCompositeService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* <p>
3232
* It is essential that any service added is in a state where it can be moved
3333
* on with that of the parent services. Specifically, do not add an uninited
34-
* service to a parent that is already inited as the <code>start</code>
34+
* service to a parent that is already inited -as the <code>start</code>
3535
* operation will then fail
3636
*
3737
*/

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/RegistryTestHelper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
/**
5151
* This is a set of static methods to aid testing the registry operations.
52-
* The methods can be imported staticallyor the class used as a base
52+
* The methods can be imported statically, or the class used as a base
5353
* class for tests.
5454
*/
5555
public class RegistryTestHelper extends Assert {
@@ -207,7 +207,7 @@ public static void assertMatches(ServiceRecord source, ServiceRecord resolved) {
207207
}
208208

209209
/**
210-
* Find an endpoint in a record or fail,
210+
* Find an endpoint in a record or fail.
211211
* @param record record
212212
* @param api API
213213
* @param external external?
@@ -237,7 +237,7 @@ public static Endpoint findEndpoint(ServiceRecord record,
237237
}
238238

239239
/**
240-
* Log a record
240+
* Log a record.
241241
* @param name record name
242242
* @param record details
243243
* @throws IOException only if something bizarre goes wrong marshalling
@@ -324,7 +324,7 @@ public static LoginContext logout(LoginContext login) {
324324
* @param user username
325325
* @param keytab keytab to list
326326
* @return the UGI
327-
* @throws IOException
327+
* @throws IOException login failure.
328328
*/
329329
public static UserGroupInformation loginUGI(String user, File keytab) throws
330330
IOException {

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/secure/TestRegistrySecurityHelper.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -190,23 +190,4 @@ public void testUGIProperties() throws Throwable {
190190
LOG.info("User {} has ACL {}", user, acl);
191191
}
192192

193-
194-
@Test
195-
public void testSecurityImpliesKerberos() throws Throwable {
196-
Configuration conf = new Configuration();
197-
conf.setBoolean("hadoop.security.authentication", true);
198-
conf.setBoolean(KEY_REGISTRY_SECURE, true);
199-
conf.set(KEY_REGISTRY_KERBEROS_REALM, "KERBEROS");
200-
;
201-
try(RegistrySecurity security = new RegistrySecurity("registry security")) {
202-
security.init(conf);
203-
fail("Expected an initialization failure in " + security);
204-
} catch (Exception e) {
205-
assertTrue(
206-
"did not find "+ RegistrySecurity.E_NO_KERBEROS + " in " + e,
207-
e.toString().contains(RegistrySecurity.E_NO_KERBEROS));
208-
}
209-
}
210-
211-
212193
}

0 commit comments

Comments
 (0)