Home | About | Sematext search-lucene.com search-hadoop.com
 Search Lucene and all its subprojects:

Switch to Threaded View
PyLucene, mail # dev - JCC access to a nested iteration class


Copy link to this message
-
JCC access to a nested iteration class
csrickle 2012-08-17, 10:43
Hello,

This is a redirection attempt, as I used the jira tool incorrectly.  Please consider the original PYLUCENE-21 issue and the following additional comment.

I did exclude my jcc invocation. This is a snapshot, where I paired down the pylucene Makefile and adapted to a simple Maven archetype generated project:

python -m jcc.__main__ --arch x86_64 --jar /Users/crickle/jcc/jcc-hello/target/jcc-hello-1.0-SNAPSHOT.jar --rename home.App\$Embedded=AppEmbedded --package java.lang java.lang.System java.lang.Runtime java.lang.IllegalStateException java.lang.IndexOutOfBoundsException --package java.util java.util.Arrays java.util.HashMap java.util.HashSet java.util.No
SuchElementException java.text.SimpleDateFormat java.text.DecimalFormat java.text.Collator --package java.util.regex --package java.io java.io.StringReader java.io.InputStreamRea
der java.io.FileInputStream --python jcchello --mapping java.util.Properties 'getProperty:(Ljava/lang/String;)Ljava/lang/String;' --sequence java.util.AbstractList 'size:()I' 'ge
t:(I)Ljava/lang/Object;' --version 1.0 --files 4 --install

 I replicated it and understand a few points that I was missing. In the above invocation, am I equivalently asking for wrapping by specifying the --jar option for the archive that contains the code to be wrapped? Do I still need --classpath per your provided example?

For now, I have arrived at a solution that is working for us that uses a supplemental function (as described in my initial question) to provide the iteration over the query result set. So far, we haven't really found any problem with this approach, except that the logic spans python and java.

This is an Apache Accumulo interface. The particular class containing the nested class, analogous to App.Embedded.hello2(), is TabletServerBatchReaderIterator:

http://svn.apache.org/viewvc/accumulo/tags/1.4.1/src/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java?view=markup

Getting jcc to recognize MyEntry (listed below) is the actual problem I'm still hoping to solve.

  private static class MyEntry implements Entry<Key,Value> {
98
99 private Key key;
100 private Value value;
101
102 MyEntry(Key key, Value value) {
103 this.key = key;
104 this.value = value;
105 }
106
107 @Override
108 public Key getKey() {
109 return key;
110 }
111
112 @Override
113 public Value getValue() {
114 return value;
115 }
116
117 @Override
118 public Value setValue(Value value) {
119 throw new UnsupportedOperationException();
120 }
121
122 }

If this class is contained within a specified --jar argument in the jcc invocation, can I then add a --rename command such that I can refer to the "private" and "static" MyEntry class.

Thanks again for your kind consideration.
Craig