Skip to content
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

RpcServerFactoryPBImpl force yarn users to define a protocol in a entailed namespace #31

Open
coderplay opened this issue May 29, 2012 · 0 comments
Labels

Comments

@coderplay
Copy link
Owner

It's not a bug of Dragon, but is of Hadoop Yarn.

We defined wire protocol use protobuf with the java package name "org.apache.hadoop.realtime.proto"

option java_package = "org.apache.hadoop.realtime.proto";

Such definition would cause a ClassNotFoundException when starting an application master of Dragon.

12/05/29 14:45:33 ERROR app.DragonAppMaster: Error starting DragonAppMaster
org.apache.hadoop.yarn.YarnException: Failed to Start org.apache.hadoop.realtime.client.app.DragonAppMaster
    at org.apache.hadoop.yarn.service.CompositeService.start(CompositeService.java:78)
    at org.apache.hadoop.realtime.client.app.DragonAppMaster.start(DragonAppMaster.java:155)
    at org.apache.hadoop.realtime.client.app.DragonAppMaster$1.run(DragonAppMaster.java:218)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:396)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1177)
    at org.apache.hadoop.realtime.client.app.DragonAppMaster.initAndStartAppMaster(DragonAppMaster.java:214)
    at org.apache.hadoop.realtime.client.app.DragonAppMaster.main(DragonAppMaster.java:200)
Caused by: org.apache.hadoop.yarn.YarnException: Failed to load class: [org.apache.hadoop.yarn.proto.DragonClientProtocol$DragonClientProtocolService]
    at org.apache.hadoop.yarn.factories.impl.pb.RpcServerFactoryPBImpl.getServer(RpcServerFactoryPBImpl.java:105)
    at org.apache.hadoop.yarn.ipc.HadoopYarnProtoRPC.getServer(HadoopYarnProtoRPC.java:63)
    at org.apache.hadoop.realtime.client.DragonClientService.start(DragonClientService.java:134)
    at org.apache.hadoop.yarn.service.CompositeService.start(CompositeService.java:68)
    ... 7 more
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.yarn.proto.DragonClientProtocol$DragonClientProtocolService
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1162)
    at org.apache.hadoop.yarn.factories.impl.pb.RpcServerFactoryPBImpl.getServer(RpcServerFactoryPBImpl.java:103)
    ... 10 more

RpcServerFactoryPBImpl hard coded namespace suffix and class suffix of every protocol we defined. It force yarn users to define a protocol in a entailed namespace, below is some lines of RpcServerFactoryPBImpl.java that issues in the bug.

  private static final String PROTO_GEN_PACKAGE_NAME = "org.apache.hadoop.yarn.proto";
  private static final String PROTO_GEN_CLASS_SUFFIX = "Service";
  private static final String PB_IMPL_PACKAGE_SUFFIX = "impl.pb.service";
  private static final String PB_IMPL_CLASS_SUFFIX = "PBServiceImpl";

//...

  private String getProtoClassName(Class<?> clazz) {
    String srcClassName = getClassName(clazz);
    return PROTO_GEN_PACKAGE_NAME + "." + srcClassName + "$" + srcClassName + PROTO_GEN_CLASS_SUFFIX;  
  }
@ghost ghost assigned ghost and coderplay May 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant