hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r411909 - in /lucene/hadoop/trunk: ./ src/java/org/apache/hadoop/record/ src/java/org/apache/hadoop/record/compiler/ src/java/org/apache/hadoop/record/compiler/generated/ src/test/org/apache/hadoop/record/test/
Date Mon, 05 Jun 2006 20:44:08 GMT
Author: cutting
Date: Mon Jun  5 13:44:07 2006
New Revision: 411909

URL: http://svn.apache.org/viewvc?rev=411909&view=rev
Log:
HADOOP-245 and HADOOP-246.  Improvements to record io package.  Contributed by Mahadev.

Added:
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/generated/package.html
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/package.html
Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/BinaryInputArchive.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/BinaryOutputArchive.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/CsvInputArchive.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/CsvOutputArchive.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/InputArchive.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/OutputArchive.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/RecordReader.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/RecordWriter.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/Utils.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/XmlInputArchive.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/XmlOutputArchive.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/CppGenerator.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JBoolean.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JBuffer.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JByte.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JCompType.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JDouble.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JField.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JFile.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JFloat.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JInt.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JLong.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JMap.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JRecord.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JString.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JType.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JVector.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JavaGenerator.java
    lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/FromCpp.java
    lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/TestRecordIO.java
    lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/ToCpp.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Mon Jun  5 13:44:07 2006
@@ -13,6 +13,9 @@
     waiting for map outputs, so that they do not time out.
     (Mahadev Konar via cutting)
 
+ 4. HADOOP-245 and HADOOP-246.  Improvements to record io package.  
+    (Mahadev Konar via cutting)
+
 
 Release 0.3.0 - 2006-06-02
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/BinaryInputArchive.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/BinaryInputArchive.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/BinaryInputArchive.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/BinaryInputArchive.java Mon Jun
 5 13:44:07 2006
@@ -25,7 +25,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class BinaryInputArchive implements InputArchive {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/BinaryOutputArchive.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/BinaryOutputArchive.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/BinaryOutputArchive.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/BinaryOutputArchive.java Mon Jun
 5 13:44:07 2006
@@ -26,7 +26,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class BinaryOutputArchive implements OutputArchive {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/CsvInputArchive.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/CsvInputArchive.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/CsvInputArchive.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/CsvInputArchive.java Mon Jun  5
13:44:07 2006
@@ -26,7 +26,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 class CsvInputArchive implements InputArchive {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/CsvOutputArchive.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/CsvOutputArchive.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/CsvOutputArchive.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/CsvOutputArchive.java Mon Jun  5
13:44:07 2006
@@ -26,7 +26,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class CsvOutputArchive implements OutputArchive {
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/InputArchive.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/InputArchive.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/InputArchive.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/InputArchive.java Mon Jun  5 13:44:07
2006
@@ -24,7 +24,7 @@
 /**
  * Interface that all the Deserializers have to implement.
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public interface InputArchive {
     public byte readByte(String tag) throws IOException;

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/OutputArchive.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/OutputArchive.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/OutputArchive.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/OutputArchive.java Mon Jun  5 13:44:07
2006
@@ -24,7 +24,7 @@
 /**
  * Interface that alll the serializers have to implement.
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public interface OutputArchive {
     public void writeByte(byte b, String tag) throws IOException;

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/RecordReader.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/RecordReader.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/RecordReader.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/RecordReader.java Mon Jun  5 13:44:07
2006
@@ -30,7 +30,7 @@
  * Front-end interface to deserializers. Also acts as a factory
  * for deserializers.
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class RecordReader {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/RecordWriter.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/RecordWriter.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/RecordWriter.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/RecordWriter.java Mon Jun  5 13:44:07
2006
@@ -30,7 +30,7 @@
 /**
  * Front-end for serializers. Also serves as a factory for serializers.
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class RecordWriter {
     
@@ -112,4 +112,4 @@
     public void write(Record r) throws IOException {
         r.serialize(archive, "");
     }
-}
\ No newline at end of file
+}

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/Utils.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/Utils.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/Utils.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/Utils.java Mon Jun  5 13:44:07 2006
@@ -24,7 +24,7 @@
 
 /**
  * Various utility functions for Hadooop record I/O runtime.
- * @author milindb@yahoo-inc.com
+ * @author Milind Bhandarkar
  */
 public class Utils {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/XmlInputArchive.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/XmlInputArchive.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/XmlInputArchive.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/XmlInputArchive.java Mon Jun  5
13:44:07 2006
@@ -29,7 +29,7 @@
 import javax.xml.parsers.SAXParser;
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 class XmlInputArchive implements InputArchive {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/XmlOutputArchive.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/XmlOutputArchive.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/XmlOutputArchive.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/XmlOutputArchive.java Mon Jun  5
13:44:07 2006
@@ -26,7 +26,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 class XmlOutputArchive implements OutputArchive {
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/CppGenerator.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/CppGenerator.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/CppGenerator.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/CppGenerator.java Mon Jun
 5 13:44:07 2006
@@ -23,22 +23,35 @@
 import java.util.Iterator;
 
 /**
+ * C++ Code generator front-end for Hadoop record I/O.
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 class CppGenerator {
+    private String mFullName;
     private String mName;
     private ArrayList mInclFiles;
     private ArrayList mRecList;
     
-    /** Creates a new instance of CppGenerator */
-    public CppGenerator(String name, ArrayList ilist, ArrayList rlist) {
-        mName = name;
+    /** Creates a new instance of CppGenerator
+     *
+     * @param name possibly full pathname to the file
+     * @param ilist included files (as JFile)
+     * @param rlist List of records defined within this file
+     */
+    CppGenerator(String name, ArrayList ilist, ArrayList rlist) {
+        mFullName = name;
+        mName = (new File(name)).getName();
         mInclFiles = ilist;
         mRecList = rlist;
     }
     
-    public void genCode() throws IOException {
+    /**
+     * Generate C++ code. This method only creates the requested file(s)
+     * and spits-out file-level elements (such as include statements etc.)
+     * record-level code is generated by JRecord.
+     */
+    void genCode() throws IOException {
         FileWriter cc = new FileWriter(mName+".cc");
         FileWriter hh = new FileWriter(mName+".hh");
         hh.write("#ifndef __"+mName.toUpperCase().replace('.','_')+"__\n");

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JBoolean.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JBoolean.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JBoolean.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JBoolean.java Mon Jun 
5 13:44:07 2006
@@ -18,7 +18,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JBoolean extends JType {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JBuffer.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JBuffer.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JBuffer.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JBuffer.java Mon Jun  5
13:44:07 2006
@@ -18,7 +18,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JBuffer extends JCompType {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JByte.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JByte.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JByte.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JByte.java Mon Jun  5 13:44:07
2006
@@ -18,7 +18,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JByte extends JType {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JCompType.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JCompType.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JCompType.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JCompType.java Mon Jun
 5 13:44:07 2006
@@ -17,17 +17,19 @@
 package org.apache.hadoop.record.compiler;
 
 /**
+ * Abstract base class for all the "compound" types such as ustring,
+ * buffer, vector, map, and record.
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 abstract class JCompType extends JType {
     
     /** Creates a new instance of JCompType */
-    public JCompType(String cppType, String javaType, String suffix, String wrapper) {
+    JCompType(String cppType, String javaType, String suffix, String wrapper) {
         super(cppType, javaType, suffix, wrapper, null);
     }
     
-    public String genCppGetSet(String fname, int fIdx) {
+    String genCppGetSet(String fname, int fIdx) {
         String cgetFunc = "  virtual const "+getCppType()+"& get"+fname+"() const {\n";
         cgetFunc += "    return m"+fname+";\n";
         cgetFunc += "  }\n";
@@ -37,15 +39,15 @@
         return cgetFunc + getFunc;
     }
     
-    public String genJavaCompareTo(String fname) {
+    String genJavaCompareTo(String fname) {
         return "    ret = "+fname+".compareTo(peer."+fname+");\n";
     }
     
-    public String genJavaEquals(String fname, String peer) {
+    String genJavaEquals(String fname, String peer) {
         return "    ret = "+fname+".equals("+peer+");\n";
     }
     
-    public String genJavaHashCode(String fname) {
+    String genJavaHashCode(String fname) {
         return "    ret = "+fname+".hashCode();\n";
     }
 }

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JDouble.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JDouble.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JDouble.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JDouble.java Mon Jun  5
13:44:07 2006
@@ -18,7 +18,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JDouble extends JType {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JField.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JField.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JField.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JField.java Mon Jun  5
13:44:07 2006
@@ -18,7 +18,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JField {
     private JType mType;

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JFile.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JFile.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JFile.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JFile.java Mon Jun  5 13:44:07
2006
@@ -20,8 +20,11 @@
 import java.util.ArrayList;
 
 /**
+ * Container for the Hadoop Record DDL.
+ * The main components of the file are filename, list of included files,
+ * and records defined in that file.
  *
- * @author milindb@yahoo-inc.com
+ * @author Milind Bhandarkar
  */
 public class JFile {
     
@@ -29,18 +32,27 @@
     private ArrayList mInclFiles;
     private ArrayList mRecords;
     
-    /** Creates a new instance of JFile */
+    /** Creates a new instance of JFile
+     *
+     * @param name possibly full pathname to the file
+     * @param inclFiles included files (as JFile)
+     * @param recList List of records defined within this file
+     */
     public JFile(String name, ArrayList inclFiles, ArrayList recList) {
         mName = name;
         mInclFiles = inclFiles;
         mRecords = recList;
     }
-        
+    
+    /** Strip the other pathname components and return the basename */
     String getName() {
         int idx = mName.lastIndexOf('/');
         return (idx > 0) ? mName.substring(idx) : mName; 
     }
     
+    /** Generate record code in given language. Language should be all
+     *  lowercase.
+     */
     public void genCode(String language) throws IOException {
         if ("c++".equals(language)) {
             CppGenerator gen = new CppGenerator(mName, mInclFiles, mRecords);

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JFloat.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JFloat.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JFloat.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JFloat.java Mon Jun  5
13:44:07 2006
@@ -18,7 +18,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JFloat extends JType {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JInt.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JInt.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JInt.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JInt.java Mon Jun  5 13:44:07
2006
@@ -18,7 +18,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JInt extends JType {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JLong.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JLong.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JLong.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JLong.java Mon Jun  5 13:44:07
2006
@@ -18,7 +18,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JLong extends JType {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JMap.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JMap.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JMap.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JMap.java Mon Jun  5 13:44:07
2006
@@ -18,7 +18,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JMap extends JCompType {
    

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JRecord.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JRecord.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JRecord.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JRecord.java Mon Jun  5
13:44:07 2006
@@ -24,7 +24,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JRecord extends JCompType {
 
@@ -132,7 +132,7 @@
             hh.write(jf.genCppGetSet(fIdx));
         }
         hh.write("}; // end record "+getName()+"\n");
-        for (int i=0; i<ns.length; i++) {
+        for (int i=ns.length-1; i>=0; i--) {
             hh.write("} // end namespace "+ns[i]+"\n");
         }
         cc.write("void "+getCppFQName()+"::serialize(::hadoop::OArchive& a_, const char*
tag) {\n");

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JString.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JString.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JString.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JString.java Mon Jun  5
13:44:07 2006
@@ -18,7 +18,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JString extends JCompType {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JType.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JType.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JType.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JType.java Mon Jun  5 13:44:07
2006
@@ -17,10 +17,11 @@
 package org.apache.hadoop.record.compiler;
 
 /**
- *
- * @author milindb
+ * Abstract Base class for all types supported by Hadoop Record I/O.
+ * 
+ * @author Milind Bhandarkar
  */
-public abstract class JType {
+abstract public class JType {
     
     private String mCppName;
     private String mJavaName;
@@ -31,7 +32,7 @@
     /**
      * Creates a new instance of JType
      */
-    public JType(String cppname, String javaname, String suffix, String wrapper, String unwrap)
{
+    JType(String cppname, String javaname, String suffix, String wrapper, String unwrap)
{
         mCppName = cppname;
         mJavaName = javaname;
         mMethodSuffix = suffix;
@@ -39,21 +40,21 @@
         mUnwrapMethod = unwrap;
     }
     
-    abstract public String getSignature();
+    abstract String getSignature();
     
-    public String genCppDecl(String fname) {
+    String genCppDecl(String fname) {
         return "  "+mCppName+" m"+fname+";\n"; 
     }
     
-    public String genJavaDecl (String fname) {
+    String genJavaDecl (String fname) {
         return "  private "+mJavaName+" m"+fname+";\n";
     }
     
-    public String genJavaConstructorParam (int fIdx) {
+    String genJavaConstructorParam (int fIdx) {
         return "        "+mJavaName+" m"+fIdx;
     }
     
-    public String genCppGetSet(String fname, int fIdx) {
+    String genCppGetSet(String fname, int fIdx) {
         String getFunc = "  virtual "+mCppName+" get"+fname+"() const {\n";
         getFunc += "    return m"+fname+";\n";
         getFunc += "  }\n";
@@ -63,7 +64,7 @@
         return getFunc+setFunc;
     }
     
-    public String genJavaGetSet(String fname, int fIdx) {
+    String genJavaGetSet(String fname, int fIdx) {
         String getFunc = "  public "+mJavaName+" get"+fname+"() {\n";
         getFunc += "    return m"+fname+";\n";
         getFunc += "  }\n";
@@ -73,31 +74,31 @@
         return getFunc+setFunc;
     }
     
-    public String getCppType() {
+    String getCppType() {
         return mCppName;
     }
     
-    public String getJavaType() {
+    String getJavaType() {
         return mJavaName;
     }
    
-    public String getJavaWrapperType() {
+    String getJavaWrapperType() {
         return mWrapper;
     }
     
-    public String getMethodSuffix() {
+    String getMethodSuffix() {
         return mMethodSuffix;
     }
     
-    public String genJavaWriteMethod(String fname, String tag) {
+    String genJavaWriteMethod(String fname, String tag) {
         return "    a_.write"+mMethodSuffix+"("+fname+",\""+tag+"\");\n";
     }
     
-    public String genJavaReadMethod(String fname, String tag) {
+    String genJavaReadMethod(String fname, String tag) {
         return "    "+fname+"=a_.read"+mMethodSuffix+"(\""+tag+"\");\n";
     }
     
-    public String genJavaReadWrapper(String fname, String tag, boolean decl) {
+    String genJavaReadWrapper(String fname, String tag, boolean decl) {
         String ret = "";
         if (decl) {
             ret = "    "+mWrapper+" "+fname+";\n";
@@ -105,19 +106,19 @@
         return ret + "    "+fname+"=new "+mWrapper+"(a_.read"+mMethodSuffix+"(\""+tag+"\"));\n";
     }
     
-    public String genJavaWriteWrapper(String fname, String tag) {
+    String genJavaWriteWrapper(String fname, String tag) {
         return "        a_.write"+mMethodSuffix+"("+fname+"."+mUnwrapMethod+"(),\""+tag+"\");\n";
     }
     
-    public String genJavaCompareTo(String fname) {
+    String genJavaCompareTo(String fname) {
         return "    ret = ("+fname+" == peer."+fname+")? 0 :(("+fname+"<peer."+fname+")?-1:1);\n";
     }
     
-    public String genJavaEquals(String fname, String peer) {
+    String genJavaEquals(String fname, String peer) {
         return "    ret = ("+fname+"=="+peer+");\n";
     }
     
-    public String genJavaHashCode(String fname) {
+    String genJavaHashCode(String fname) {
         return "    ret = (int)"+fname+";\n";
     }
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JVector.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JVector.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JVector.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JVector.java Mon Jun  5
13:44:07 2006
@@ -18,7 +18,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class JVector extends JCompType {
     

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JavaGenerator.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JavaGenerator.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JavaGenerator.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/JavaGenerator.java Mon
Jun  5 13:44:07 2006
@@ -23,22 +23,32 @@
 import java.util.Iterator;
 
 /**
+ * Java Code generator front-end for Hadoop record I/O.
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 class JavaGenerator {
     private String mName;
     private ArrayList mInclFiles;
     private ArrayList mRecList;
     
-    /** Creates a new instance of JavaGenerator */
+    /** Creates a new instance of JavaGenerator
+     *
+     * @param name possibly full pathname to the file
+     * @param incl included files (as JFile)
+     * @param records List of records defined within this file
+     */
     JavaGenerator(String name, ArrayList incl, ArrayList records) {
         mName = name;
         mInclFiles = incl;
         mRecList = records;
     }
     
-    public void genCode() throws IOException {
+    /**
+     * Generate Java code for records. This method is only a front-end to
+     * JRecord, since one file is generated for each record.
+     */
+    void genCode() throws IOException {
         for (Iterator i = mRecList.iterator(); i.hasNext(); ) {
             JRecord rec = (JRecord) i.next();
             rec.genJavaCode();

Added: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/generated/package.html
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/generated/package.html?rev=411909&view=auto
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/generated/package.html
(added)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/generated/package.html
Mon Jun  5 13:44:07 2006
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+  <head>
+    <title>Hadoop Record Compiler: Parser</title>
+  </head>
+  <body>
+  This package contains code generated by JavaCC from the
+  Hadoop record syntax file rcc.jj. For details about the
+  record file syntax please @see org.apache.hadoop.record.
+  </body>
+</html>

Added: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/package.html
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/package.html?rev=411909&view=auto
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/package.html (added)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/compiler/package.html Mon Jun  5
13:44:07 2006
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+  <head>
+    <title>Hadoop Record Compiler</title>
+  </head>
+  <body>
+  This package contains classes needed for code generation
+  from the hadoop record compiler. CppGenerator and JavaGenerator
+  are the main entry points from the parser. There are classes
+  corrsponding to every primitive type and compound type
+  included in Hadoop record I/O syntax.
+  </body>
+</html>

Modified: lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/FromCpp.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/FromCpp.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/FromCpp.java (original)
+++ lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/FromCpp.java Mon Jun  5 13:44:07
2006
@@ -29,7 +29,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class FromCpp extends TestCase {
     

Modified: lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/TestRecordIO.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/TestRecordIO.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/TestRecordIO.java (original)
+++ lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/TestRecordIO.java Mon Jun 
5 13:44:07 2006
@@ -29,7 +29,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class TestRecordIO extends TestCase {
     

Modified: lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/ToCpp.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/ToCpp.java?rev=411909&r1=411908&r2=411909&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/ToCpp.java (original)
+++ lucene/hadoop/trunk/src/test/org/apache/hadoop/record/test/ToCpp.java Mon Jun  5 13:44:07
2006
@@ -29,7 +29,7 @@
 
 /**
  *
- * @author milindb
+ * @author Milind Bhandarkar
  */
 public class ToCpp extends TestCase {
     



Mime
View raw message