gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject svn commit: r1340070 - in /gora/trunk: ./ bin/ conf/ gora-core/src/main/java/org/apache/gora/compiler/ gora-hbase/ gora-tutorial/ gora-tutorial/src/main/java/org/apache/gora/tutorial/log/
Date Fri, 18 May 2012 11:30:11 GMT
Author: lewismc
Date: Fri May 18 11:30:11 2012
New Revision: 1340070

URL: http://svn.apache.org/viewvc?rev=1340070&view=rev
Log:
commit to address classloading issues as discussed on user@ and update to CHANGES.txt

Modified:
    gora/trunk/CHANGES.txt
    gora/trunk/bin/gora
    gora/trunk/conf/log4j.properties
    gora/trunk/gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java
    gora/trunk/gora-hbase/pom.xml
    gora/trunk/gora-tutorial/pom.xml
    gora/trunk/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogManager.java

Modified: gora/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/gora/trunk/CHANGES.txt?rev=1340070&r1=1340069&r2=1340070&view=diff
==============================================================================
--- gora/trunk/CHANGES.txt (original)
+++ gora/trunk/CHANGES.txt Fri May 18 11:30:11 2012
@@ -6,6 +6,8 @@ Gora Change Log
 
 0.3 (trunk) Current Development:
 
+* GORA-** Commit to fix classloading for CLI execution (lewismc)
+
 * GORA-122 gora-accumulo/lib is not cleaned after mvn clean (lewismc)
 
 * GORA-133 & 63 GoraCompiler cannot compile array type & bin/compile-examples.sh
does not work respectively (enis, Kazuomi Kashii via lewismc)

Modified: gora/trunk/bin/gora
URL: http://svn.apache.org/viewvc/gora/trunk/bin/gora?rev=1340070&r1=1340069&r2=1340070&view=diff
==============================================================================
--- gora/trunk/bin/gora (original)
+++ gora/trunk/bin/gora Fri May 18 11:30:11 2012
@@ -82,6 +82,7 @@ if [ "$GORA_HEAPSIZE" != "" ]; then
 fi
 
 # CLASSPATH initially contains $GORA_CONF_DIR, or defaults to $GORA_HOME/conf
+CLASSPATH=${GORA_CONF_DIR:=$GORA_HOME/conf}
 CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
 
 # so that filenames w/ spaces are handled correctly in loops below
@@ -107,20 +108,24 @@ fi
 
 # figure out which class to run
 if [ "$COMMAND" = "compile" ] ; then
-  CLASS=org.apache.gora.compiler.GoraCompiler
   MODULE=gora-core
+  CLASSPATH=$CLASSPATH:$GORA_HOME/$MODULE/target/classes/
+  CLASS=org.apache.gora.compiler.GoraCompiler
 elif [ "$COMMAND" = "specificcompiler" ] ; then
-  CLASS=org.apache.avro.specific.SpecificCompiler
   MODULE=gora-core
+  CLASSPATH=$CLASSPATH:$GORA_HOME/$MODULE/target/classes/
+  CLASS=org.apache.avro.specific.SpecificCompiler
 elif [ "$COMMAND" = "logmanager" ] ; then
-  CLASS=org.apache.gora.tutorial.log.LogManager
   MODULE=gora-tutorial
+  CLASSPATH=$CLASSPATH:$GORA_HOME/$MODULE/target/classes/
+  CLASS=org.apache.gora.tutorial.log.LogManager
 elif [ "$COMMAND" = "loganalytics" ] ; then
-  CLASS=org.apache.gora.tutorial.log.LogAnalytics
   MODULE=gora-tutorial
+  CLASS=org.apache.gora.tutorial.log.LogAnalytics
+  CLASSPATH=$CLASSPATH:$GORA_HOME/$MODULE/target/classes/
 elif [ "$COMMAND" = "junit" ] ; then
-  CLASSPATH=$CLASSPATH:target/test-classes/
   MODULE=*
+  CLASSPATH=$CLASSPATH:target/test-classes/
   CLASS=junit.textui.TestRunner
 else
   MODULE="$COMMAND"
@@ -133,15 +138,15 @@ for f in $GORA_HOME/$MODULE/lib/*.jar; d
   CLASSPATH=${CLASSPATH}:$f;
 done
 
-for f in $GORA_HOME/$MODULE/build/*.job; do
+for f in $GORA_HOME/$MODULE/target/*.jar; do
   CLASSPATH=${CLASSPATH}:$f;
 done
 
-CLASSPATH=$CLASSPATH:$GORA_HOME/$MODULE/target/classes
-CLASSPATH=${CLASSPATH}:$GORA_HOME/$MODULE/target/test/classes
+CLASSPATH=${CLASSPATH}:$GORA_HOME/$MODULE/target/classes/
+CLASSPATH=${CLASSPATH}:$GORA_HOME/$MODULE/target/test-classes/
 
-CLASSPATH=$CLASSPATH:$GORA_HOME/conf
-CLASSPATH=$CLASSPATH:$GORA_HOME/$MODULE/conf
+CLASSPATH=${CLASSPATH}:$GORA_HOME/conf
+CLASSPATH=${CLASSPATH}:$GORA_HOME/$MODULE/conf
 
 # run it
 exec "$JAVA" $JAVA_HEAP_MAX $JAVA_OPTS $GORA_OPTS -classpath "$CLASSPATH" $CLASS "$@"

Modified: gora/trunk/conf/log4j.properties
URL: http://svn.apache.org/viewvc/gora/trunk/conf/log4j.properties?rev=1340070&r1=1340069&r2=1340070&view=diff
==============================================================================
--- gora/trunk/conf/log4j.properties (original)
+++ gora/trunk/conf/log4j.properties Fri May 18 11:30:11 2012
@@ -21,7 +21,7 @@ log4j.rootLogger=${gora.root.logger}
 
 # Define some default values that can be overridden by system properties
 # Logging Threshold
-log4j.threshhold=WARN
+log4j.threshhold=ALL
 
 #
 # Daily Rolling File Appender
@@ -51,8 +51,8 @@ log4j.appender.console.target=System.err
 log4j.appender.console.layout=org.apache.log4j.PatternLayout
 #log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
 log4j.appender.console.layout.ConversionPattern=%-5p %-30.30c{2} - %m%n
-# Custom Logging levels
 
+# Custom Logging levels
 log4j.logger.net.sf.jml=WARN
 log4j.logger.org.apache=WARN
-log4j.org.apache.gora=INFO
+log4j.logger.org.apache.gora=INFO

Modified: gora/trunk/gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java
URL: http://svn.apache.org/viewvc/gora/trunk/gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java?rev=1340070&r1=1340069&r2=1340070&view=diff
==============================================================================
--- gora/trunk/gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java (original)
+++ gora/trunk/gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java Fri May
18 11:30:11 2012
@@ -32,12 +32,15 @@ import org.apache.avro.Schema;
 import org.apache.avro.Protocol.Message;
 import org.apache.avro.Schema.Field;
 import org.apache.avro.specific.SpecificData;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /** Generate specific Java interfaces and classes for protocols and schemas. */
 public class GoraCompiler {
   private File dest;
   private Writer out;
   private Set<Schema> queue = new HashSet<Schema>();
+  private static final Log log = LogFactory.getLog(GoraCompiler.class);
 
   private GoraCompiler(File dest) {
     this.dest = dest;                             // root directory for output
@@ -58,6 +61,7 @@ public class GoraCompiler {
 
   /** Generates Java classes for a schema. */
   public static void compileSchema(File src, File dest) throws IOException {
+	log.info("Compiling " + src + " to " + dest );
     GoraCompiler compiler = new GoraCompiler(dest);
     compiler.enqueue(Schema.parse(src));          // enqueue types
     compiler.compile();                           // generate classes for types
@@ -442,7 +446,7 @@ public class GoraCompiler {
 
   public static void main(String[] args) throws Exception {
     if (args.length < 2) {
-      System.err.println("Usage: SpecificCompiler <schema file> <output dir>");
+      System.err.println("Usage: Compiler <schema file> <output dir>");
       System.exit(1);
     }
     compileSchema(new File(args[0]), new File(args[1]));

Modified: gora/trunk/gora-hbase/pom.xml
URL: http://svn.apache.org/viewvc/gora/trunk/gora-hbase/pom.xml?rev=1340070&r1=1340069&r2=1340070&view=diff
==============================================================================
--- gora/trunk/gora-hbase/pom.xml (original)
+++ gora/trunk/gora-hbase/pom.xml Fri May 18 11:30:11 2012
@@ -52,7 +52,7 @@
     	<url>https://builds.apache.org/job/Gora-trunk/</url>
     </ciManagement>
 
-      <properties>
+    <properties>
         <osgi.import>*</osgi.import>
         <osgi.export>org.apache.gora.hbase*;version="${project.version}";-noimport:=true</osgi.export>
     </properties>
@@ -165,13 +165,12 @@
         <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
-	     <exclusions>
-	       <exclusion>
+	        <exclusions>
+	          <exclusion>
                 <groupId>javax.jms</groupId>
-	        <artifactId>jms</artifactId>
-	      </exclusion>
+	            <artifactId>jms</artifactId>
+	          </exclusion>
             </exclusions>
-
         </dependency>
 
         <!-- Testing Dependencies -->

Modified: gora/trunk/gora-tutorial/pom.xml
URL: http://svn.apache.org/viewvc/gora/trunk/gora-tutorial/pom.xml?rev=1340070&r1=1340069&r2=1340070&view=diff
==============================================================================
--- gora/trunk/gora-tutorial/pom.xml (original)
+++ gora/trunk/gora-tutorial/pom.xml Fri May 18 11:30:11 2012
@@ -25,7 +25,7 @@
         <relativePath>../</relativePath>
     </parent>
     <artifactId>gora-tutorial</artifactId>
-    <packaging>jar</packaging>
+    <packaging>bundle</packaging>
 
     <name>Apache Gora :: Tutorial</name>
         <url>http://gora.apache.org</url>
@@ -51,6 +51,11 @@
     	<system>Jenkins</system>
     	<url>https://builds.apache.org/job/Gora-trunk/</url>
     </ciManagement>
+    
+    <properties>
+        <osgi.import>*</osgi.import>
+        <osgi.export>org.apache.gora.tutorial*;version="${project.version}";-noimport:=true</osgi.export>
+    </properties>
 
     <build>
         <directory>target</directory>
@@ -78,6 +83,24 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>${maven-jar-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>jar</goal>
+                            <!-- goal>test-jar</goal-->
+                        </goals>
+                        <configuration>
+                        <archive>
+                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                        </archive>
+                    </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 
@@ -85,6 +108,11 @@
         <!-- Gora Internal Dependencies -->
         <dependency>
             <groupId>org.apache.gora</groupId>
+            <artifactId>gora-core</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.gora</groupId>
             <artifactId>gora-hbase</artifactId>
         </dependency>
 
@@ -93,6 +121,45 @@
             <artifactId>gora-sql</artifactId>
         </dependency>
 
+		<!-- Hadoop Dependencies -->
+		<dependency>
+            <groupId>org.apache.hadoop</groupId>
+            <artifactId>hadoop-core</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.hadoop</groupId>
+            <artifactId>avro</artifactId>
+        </dependency>
+        
+        <!-- Misc Dependencies -->
+        <dependency>
+            <groupId>org.jdom</groupId>
+            <artifactId>jdom</artifactId>
+        </dependency>
+        
+        <!-- Logging Dependencies -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+	        <exclusions>
+	          <exclusion>
+                <groupId>javax.jms</groupId>
+	            <artifactId>jms</artifactId>
+	          </exclusion>
+            </exclusions>
+        </dependency>
+		
         <dependency>
             <groupId>org.hsqldb</groupId>
             <artifactId>hsqldb</artifactId>

Modified: gora/trunk/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogManager.java
URL: http://svn.apache.org/viewvc/gora/trunk/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogManager.java?rev=1340070&r1=1340069&r2=1340070&view=diff
==============================================================================
--- gora/trunk/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogManager.java (original)
+++ gora/trunk/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogManager.java Fri
May 18 11:30:11 2012
@@ -45,7 +45,7 @@ import org.apache.hadoop.conf.Configurat
  * <code>gora-tutorial/src/main/avro/pageview.json</code>.
  * 
  * <p>See the tutorial.html file in docs or go to the 
- * <a href="http://incubator.apache.org/gora/docs/current/tutorial.html"> 
+ * <a href="http://gora.apache.org/docs/current/tutorial.html"> 
  * web site</a>for more information.</p>
  */
 public class LogManager {
@@ -137,6 +137,7 @@ public class LogManager {
   
   /** Stores the pageview object with the given key */
   private void storePageview(long key, Pageview pageview) throws IOException {
+	log.info("Storing Pageview in: " + dataStore.toString());
     dataStore.put(key, pageview);
   }
   



Mime
View raw message