Skip to content

Instantly share code, notes, and snippets.

@jimbaker
Created July 17, 2013 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimbaker/6024424 to your computer and use it in GitHub Desktop.
Save jimbaker/6024424 to your computer and use it in GitHub Desktop.
Example of using proxymaker branch to generate a Java class of desired shape; emitted by javap -v WordSpout.class from https://github.com/jimbaker/jython-storm-starter
Classfile /Users/jbaker/experiments/jython-storm-starter/custom/otter/excl/plumbing/WordSpout.class
Last modified Jun 26, 2013; size 2520 bytes
MD5 checksum d409ee8487af9709bda9e468e820d326
public class otter.excl.plumbing.WordSpout extends backtype.storm.topology.base.BaseRichSpout implements org.python.core.PyProxy,org.python.core.ClassDictInit
RuntimeVisibleAnnotations:
0: #101(#102=I#103)
1: #104(#102=J#105)
minor version: 0
major version: 49
flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
#1 = Utf8 __proxy
#2 = Utf8 Lorg/python/core/PyObject;
#3 = Utf8 _setPyInstance
#4 = Utf8 (Lorg/python/core/PyObject;)V
#5 = Utf8 otter/excl/plumbing/WordSpout
#6 = Class #5 // otter/excl/plumbing/WordSpout
#7 = NameAndType #1:#2 // __proxy:Lorg/python/core/PyObject;
#8 = Fieldref #6.#7 // otter/excl/plumbing/WordSpout.__proxy:Lorg/python/core/PyObject;
#9 = Utf8 _getPyInstance
#10 = Utf8 ()Lorg/python/core/PyObject;
#11 = Utf8 __systemState
#12 = Utf8 Lorg/python/core/PySystemState;
#13 = Utf8 _setPySystemState
#14 = Utf8 (Lorg/python/core/PySystemState;)V
#15 = NameAndType #11:#12 // __systemState:Lorg/python/core/PySystemState;
#16 = Fieldref #6.#15 // otter/excl/plumbing/WordSpout.__systemState:Lorg/python/core/PySystemState;
#17 = Utf8 _getPySystemState
#18 = Utf8 ()Lorg/python/core/PySystemState;
#19 = Utf8 __initProxy__
#20 = Utf8 ([Ljava/lang/Object;)V
#21 = Utf8 excl.plumbing
#22 = String #21 // excl.plumbing
#23 = Utf8 WordSpout
#24 = String #23 // WordSpout
#25 = Utf8 org/python/core/Py
#26 = Class #25 // org/python/core/Py
#27 = Utf8 initProxy
#28 = Utf8 (Lorg/python/core/PyProxy;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
#29 = NameAndType #27:#28 // initProxy:(Lorg/python/core/PyProxy;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
#30 = Methodref #26.#29 // org/python/core/Py.initProxy:(Lorg/python/core/PyProxy;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
#31 = Utf8 <init>
#32 = Utf8 ()V
#33 = Utf8 backtype/storm/topology/base/BaseRichSpout
#34 = Class #33 // backtype/storm/topology/base/BaseRichSpout
#35 = NameAndType #31:#32 // "<init>":()V
#36 = Methodref #34.#35 // backtype/storm/topology/base/BaseRichSpout."<init>":()V
#37 = Utf8 EmptyObjects
#38 = Utf8 [Lorg/python/core/PyObject;
#39 = NameAndType #37:#38 // EmptyObjects:[Lorg/python/core/PyObject;
#40 = Fieldref #26.#39 // org/python/core/Py.EmptyObjects:[Lorg/python/core/PyObject;
#41 = NameAndType #19:#20 // __initProxy__:([Ljava/lang/Object;)V
#42 = Methodref #6.#41 // otter/excl/plumbing/WordSpout.__initProxy__:([Ljava/lang/Object;)V
#43 = Utf8 finalize
#44 = Utf8 java/lang/Object
#45 = Class #44 // java/lang/Object
#46 = NameAndType #43:#32 // finalize:()V
#47 = Methodref #45.#46 // java/lang/Object.finalize:()V
#48 = Utf8 clone
#49 = Utf8 ()Ljava/lang/Object;
#50 = NameAndType #48:#49 // clone:()Ljava/lang/Object;
#51 = Methodref #45.#50 // java/lang/Object.clone:()Ljava/lang/Object;
#52 = Utf8 declareOutputFields
#53 = Utf8 (Lbacktype/storm/topology/OutputFieldsDeclarer;)V
#54 = String #52 // declareOutputFields
#55 = Utf8 org/python/compiler/ProxyMaker
#56 = Class #55 // org/python/compiler/ProxyMaker
#57 = Utf8 findPython
#58 = Utf8 (Lorg/python/core/PyProxy;Ljava/lang/String;)Lorg/python/core/PyObject;
#59 = NameAndType #57:#58 // findPython:(Lorg/python/core/PyProxy;Ljava/lang/String;)Lorg/python/core/PyObject;
#60 = Methodref #56.#59 // org/python/compiler/ProxyMaker.findPython:(Lorg/python/core/PyProxy;Ljava/lang/String;)Lorg/python/core/PyObject;
#61 = Utf8 org/python/core/PyObject
#62 = Class #61 // org/python/core/PyObject
#63 = Utf8 _jcall
#64 = Utf8 ([Ljava/lang/Object;)Lorg/python/core/PyObject;
#65 = NameAndType #63:#64 // _jcall:([Ljava/lang/Object;)Lorg/python/core/PyObject;
#66 = Methodref #62.#65 // org/python/core/PyObject._jcall:([Ljava/lang/Object;)Lorg/python/core/PyObject;
#67 = Utf8 py2void
#68 = NameAndType #67:#4 // py2void:(Lorg/python/core/PyObject;)V
#69 = Methodref #26.#68 // org/python/core/Py.py2void:(Lorg/python/core/PyObject;)V
#70 = Utf8 nextTuple
#71 = String #70 // nextTuple
#72 = Utf8 open
#73 = Utf8 (Ljava/util/Map;Lbacktype/storm/task/TopologyContext;Lbacktype/storm/spout/SpoutOutputCollector;)V
#74 = String #72 // open
#75 = Utf8 serialVersionUID
#76 = Utf8 J
#77 = Utf8 <clinit>
#78 = Long 1l
#80 = NameAndType #75:#76 // serialVersionUID:J
#81 = Fieldref #6.#80 // otter/excl/plumbing/WordSpout.serialVersionUID:J
#82 = Utf8 classDictInit
#83 = Utf8 __supernames__
#84 = String #83 // __supernames__
#85 = Utf8 java/lang/String
#86 = Class #85 // java/lang/String
#87 = String #48 // clone
#88 = String #43 // finalize
#89 = Utf8 java2py
#90 = Utf8 (Ljava/lang/Object;)Lorg/python/core/PyObject;
#91 = NameAndType #89:#90 // java2py:(Ljava/lang/Object;)Lorg/python/core/PyObject;
#92 = Methodref #26.#91 // org/python/core/Py.java2py:(Ljava/lang/Object;)Lorg/python/core/PyObject;
#93 = Utf8 __setitem__
#94 = Utf8 (Ljava/lang/String;Lorg/python/core/PyObject;)V
#95 = NameAndType #93:#94 // __setitem__:(Ljava/lang/String;Lorg/python/core/PyObject;)V
#96 = Methodref #62.#95 // org/python/core/PyObject.__setitem__:(Ljava/lang/String;Lorg/python/core/PyObject;)V
#97 = Utf8 org/python/core/PyProxy
#98 = Class #97 // org/python/core/PyProxy
#99 = Utf8 org/python/core/ClassDictInit
#100 = Class #99 // org/python/core/ClassDictInit
#101 = Utf8 Lorg/python/compiler/APIVersion;
#102 = Utf8 value
#103 = Integer 33
#104 = Utf8 Lorg/python/compiler/MTime;
#105 = Long -1l
#107 = Utf8 backtype/storm/topology/OutputFieldsDeclarer
#108 = Class #107 // backtype/storm/topology/OutputFieldsDeclarer
#109 = Utf8 java/util/Map
#110 = Class #109 // java/util/Map
#111 = Utf8 backtype/storm/task/TopologyContext
#112 = Class #111 // backtype/storm/task/TopologyContext
#113 = Utf8 backtype/storm/spout/SpoutOutputCollector
#114 = Class #113 // backtype/storm/spout/SpoutOutputCollector
#115 = Utf8 Code
#116 = Utf8 StackMap
#117 = Utf8 RuntimeVisibleAnnotations
{
protected org.python.core.PyObject __proxy;
flags: ACC_PROTECTED
protected transient org.python.core.PySystemState __systemState;
flags: ACC_PROTECTED, ACC_TRANSIENT
public static final long serialVersionUID;
flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL
public void _setPyInstance(org.python.core.PyObject);
flags: ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
0: aload_0
1: aload_1
2: putfield #8 // Field __proxy:Lorg/python/core/PyObject;
5: return
public org.python.core.PyObject _getPyInstance();
flags: ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: getfield #8 // Field __proxy:Lorg/python/core/PyObject;
4: areturn
public void _setPySystemState(org.python.core.PySystemState);
flags: ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
0: aload_0
1: aload_1
2: putfield #16 // Field __systemState:Lorg/python/core/PySystemState;
5: return
public org.python.core.PySystemState _getPySystemState();
flags: ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: getfield #16 // Field __systemState:Lorg/python/core/PySystemState;
4: areturn
public void __initProxy__(java.lang.Object[]);
flags: ACC_PUBLIC
Code:
stack=4, locals=2, args_size=2
0: aload_0
1: ldc #22 // String excl.plumbing
3: ldc #24 // String WordSpout
5: aload_1
6: invokestatic #30 // Method org/python/core/Py.initProxy:(Lorg/python/core/PyProxy;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
9: return
public otter.excl.plumbing.WordSpout();
flags: ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
0: aload_0
1: invokespecial #36 // Method backtype/storm/topology/base/BaseRichSpout."<init>":()V
4: aload_0
5: getstatic #40 // Field org/python/core/Py.EmptyObjects:[Lorg/python/core/PyObject;
8: invokevirtual #42 // Method __initProxy__:([Ljava/lang/Object;)V
11: return
public void finalize();
flags: ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: invokespecial #47 // Method java/lang/Object.finalize:()V
4: return
public java.lang.Object clone();
flags: ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: invokespecial #51 // Method java/lang/Object.clone:()Ljava/lang/Object;
4: areturn
public void declareOutputFields(backtype.storm.topology.OutputFieldsDeclarer);
flags: ACC_PUBLIC
Code:
stack=4, locals=3, args_size=2
0: aload_0
1: ldc #54 // String declareOutputFields
3: invokestatic #60 // Method org/python/compiler/ProxyMaker.findPython:(Lorg/python/core/PyProxy;Ljava/lang/String;)Lorg/python/core/PyObject;
6: dup
7: ifnull 27
10: iconst_1
11: anewarray #45 // class java/lang/Object
14: astore_2
15: aload_2
16: iconst_0
17: aload_1
18: aastore
19: aload_2
20: invokevirtual #66 // Method org/python/core/PyObject._jcall:([Ljava/lang/Object;)Lorg/python/core/PyObject;
23: invokestatic #69 // Method org/python/core/Py.py2void:(Lorg/python/core/PyObject;)V
26: return
27: pop
28: return
StackMap: number_of_entries = 1
frame_type = 255 offset = 27
locals = [ class otter/excl/plumbing/WordSpout, class backtype/storm/topology/OutputFieldsDeclarer ]
stack = [ class org/python/core/PyObject ]
public void nextTuple();
flags: ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
0: aload_0
1: ldc #71 // String nextTuple
3: invokestatic #60 // Method org/python/compiler/ProxyMaker.findPython:(Lorg/python/core/PyProxy;Ljava/lang/String;)Lorg/python/core/PyObject;
6: dup
7: ifnull 20
10: getstatic #40 // Field org/python/core/Py.EmptyObjects:[Lorg/python/core/PyObject;
13: invokevirtual #66 // Method org/python/core/PyObject._jcall:([Ljava/lang/Object;)Lorg/python/core/PyObject;
16: invokestatic #69 // Method org/python/core/Py.py2void:(Lorg/python/core/PyObject;)V
19: return
20: pop
21: return
StackMap: number_of_entries = 1
frame_type = 255 offset = 20
locals = [ class otter/excl/plumbing/WordSpout ]
stack = [ class org/python/core/PyObject ]
public void open(java.util.Map, backtype.storm.task.TopologyContext, backtype.storm.spout.SpoutOutputCollector);
flags: ACC_PUBLIC
Code:
stack=4, locals=5, args_size=4
0: aload_0
1: ldc #74 // String open
3: invokestatic #60 // Method org/python/compiler/ProxyMaker.findPython:(Lorg/python/core/PyProxy;Ljava/lang/String;)Lorg/python/core/PyObject;
6: dup
7: ifnull 40
10: iconst_3
11: anewarray #45 // class java/lang/Object
14: astore 4
16: aload 4
18: iconst_0
19: aload_1
20: aastore
21: aload 4
23: iconst_1
24: aload_2
25: aastore
26: aload 4
28: iconst_2
29: aload_3
30: aastore
31: aload 4
33: invokevirtual #66 // Method org/python/core/PyObject._jcall:([Ljava/lang/Object;)Lorg/python/core/PyObject;
36: invokestatic #69 // Method org/python/core/Py.py2void:(Lorg/python/core/PyObject;)V
39: return
40: pop
41: return
StackMap: number_of_entries = 1
frame_type = 255 offset = 40
locals = [ class otter/excl/plumbing/WordSpout, class java/util/Map, class backtype/storm/task/TopologyContext, class backtype/storm/spout/SpoutOutputCollector ]
stack = [ class org/python/core/PyObject ]
static {};
flags: ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: ldc2_w #78 // long 1l
3: putstatic #81 // Field serialVersionUID:J
6: return
public static void classDictInit(org.python.core.PyObject);
flags: ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=2, args_size=1
0: aload_0
1: ldc #84 // String __supernames__
3: iconst_2
4: anewarray #86 // class java/lang/String
7: astore_1
8: aload_1
9: iconst_0
10: ldc #87 // String clone
12: aastore
13: aload_1
14: iconst_1
15: ldc #88 // String finalize
17: aastore
18: aload_1
19: invokestatic #92 // Method org/python/core/Py.java2py:(Ljava/lang/Object;)Lorg/python/core/PyObject;
22: invokevirtual #96 // Method org/python/core/PyObject.__setitem__:(Ljava/lang/String;Lorg/python/core/PyObject;)V
25: return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment