2

我尝试使用以下代码从 zookeeper 获取 PhysicalPlan:

String stateMgrClass = Context.stateManagerClass(this.config);
IStateManager stateManager = null;
stateManager = ReflectionUtils.newInstance(stateMgrClass);
stateManager.initialize(this.config);
SchedulerStateManagerAdaptor stateManagerAdaptor = new SchedulerStateManagerAdaptor(stateManager, 5000);
PhysicalPlans.PhysicalPlan physicalPlan = stateManagerAdaptor.getPhysicalPlan(this.topologyName);

然后出现异常:java.lang.VerifyError: Bad type on operand stack 发生:

Exception in thread "Thread-4" java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    com/twitter/heron/proto/system/PhysicalPlans$PhysicalPlan$Builder.mergeTopology(Lcom/twitter/heron/api/generated/TopologyAPI$Topology;)Lcom/twitter/heron/proto/system/PhysicalPlans$PhysicalPlan$Builder; @72: invokevirtual
  Reason:
    Type 'com/twitter/heron/api/generated/TopologyAPI$Topology' (current frame, stack[1]) is not assignable to 'com/google/protobuf/AbstractMessage'
  Current Frame:
    bci: @72
    flags: { }
    locals: { 'com/twitter/heron/proto/system/PhysicalPlans$PhysicalPlan$Builder', 'com/twitter/heron/api/generated/TopologyAPI$Topology' }
    stack: { 'com/google/protobuf/SingleFieldBuilderV3', 'com/twitter/heron/api/generated/TopologyAPI$Topology' }
  Bytecode:
    0x0000000: 2ab4 0014 c700 3f2a b400 1604 7e04 a000
    0x0000010: 292a b400 09c6 0022 2ab4 0009 b800 4fa5
    0x0000020: 0018 2a2a b400 09b8 0055 2bb6 0056 b600
    0x0000030: 57b5 0009 a700 082a 2bb5 0009 2ab6 0037
    0x0000040: a700 0c2a b400 142b b600 5857 2a59 b400
    0x0000050: 1604 80b5 0016 2ab0                    
  Stackmap Table:
    same_frame(@55)
    same_frame(@60)
    same_frame(@67)
    same_frame(@76)

    at com.twitter.heron.proto.system.PhysicalPlans$PhysicalPlan.toBuilder(PhysicalPlans.java:4211)
    at com.twitter.heron.proto.system.PhysicalPlans$PhysicalPlan.newBuilder(PhysicalPlans.java:4204)
    at com.twitter.heron.statemgr.FileSystemStateManager.getPhysicalPlan(FileSystemStateManager.java:165)
    at com.twitter.heron.spi.statemgr.SchedulerStateManagerAdaptor.getPhysicalPlan(SchedulerStateManagerAdaptor.java:289)
    at zyt.custom.my.scheduler.aurora.AuroraSchedulerController.basedWeightSchedule(AuroraSchedulerController.java:782)
    at zyt.custom.my.scheduler.aurora.AuroraSchedulerThread.run(AuroraSchedulerThread.java:54)

我不知道是什么导致了这个异常。谢谢你的帮助。

4

2 回答 2

3

当类的版本在编译时和运行时不同时,会引发异常。

最近,当我尝试使用旧版本的分析器时遇到了这样一个问题,并且当分析器启动时,将要调用某个操作时会抛出 verifyError。

于 2018-09-19T03:49:50.027 回答
1

这个问题已经通过heron-api:[heron-version].jar从 pom.xml 文件中删除来解决。
heron-spi:[heron-version].jar是创建 Heron 的自定义调度程序所必需的。

于 2018-09-21T07:51:01.140 回答