incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1140143 - in /incubator/hama/branches/0.3: ./ LICENSE.txt NOTICE.txt pom.xml src/examples/org/apache/hama/examples/graph/PageRank.java src/java/org/apache/hama/http/HttpServer.java
Date Mon, 27 Jun 2011 13:04:37 GMT
Author: edwardyoon
Date: Mon Jun 27 13:04:36 2011
New Revision: 1140143

URL: http://svn.apache.org/viewvc?rev=1140143&view=rev
Log:
Merge from trunk

Modified:
    incubator/hama/branches/0.3/   (props changed)
    incubator/hama/branches/0.3/LICENSE.txt
    incubator/hama/branches/0.3/NOTICE.txt
    incubator/hama/branches/0.3/pom.xml
    incubator/hama/branches/0.3/src/examples/org/apache/hama/examples/graph/PageRank.java
    incubator/hama/branches/0.3/src/java/org/apache/hama/http/HttpServer.java

Propchange: incubator/hama/branches/0.3/
------------------------------------------------------------------------------
    svn:mergeinfo = /incubator/hama/trunk:1139127-1140142

Modified: incubator/hama/branches/0.3/LICENSE.txt
URL: http://svn.apache.org/viewvc/incubator/hama/branches/0.3/LICENSE.txt?rev=1140143&r1=1140142&r2=1140143&view=diff
==============================================================================
--- incubator/hama/branches/0.3/LICENSE.txt (original)
+++ incubator/hama/branches/0.3/LICENSE.txt Mon Jun 27 13:04:36 2011
@@ -290,3 +290,29 @@ All Recipient's rights under this Agreem
 Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid
inconsistency the Agreement is copyrighted and may only be modified in the following manner.
The Agreement Steward reserves the right to publish new versions (including revisions) of
this Agreement from time to time. No one other than the Agreement Steward has the right to
modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility
to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement
will be given a distinguishing version number. The Program (including Contributions) may always
be distributed subject to the version of the Agreement under which it was received. In addition,
after a new version of the Agreement is published, Contributor may elect to distribute the
Program (including its Contributions) under the new version. Except as expressly stated in
Sections 2(a) and 2(b) above, Recipient receives no r
 ights or licenses to the intellectual property of any Contributor under this Agreement, whether
expressly, by implication, estoppel or otherwise. All rights in the Program not expressly
granted under this Agreement are reserved.
 
 This Agreement is governed by the laws of the State of New York and the intellectual property
laws of the United States of America. No party to this Agreement will bring a legal action
under this Agreement more than one year after the cause of action arose. Each party waives
its rights to a jury trial in any resulting litigation.
+
+==========================================================
+The following license applies to the SLF4J library
+==========================================================
+Copyright (c) 2004-2008 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+

Modified: incubator/hama/branches/0.3/NOTICE.txt
URL: http://svn.apache.org/viewvc/incubator/hama/branches/0.3/NOTICE.txt?rev=1140143&r1=1140142&r2=1140143&view=diff
==============================================================================
--- incubator/hama/branches/0.3/NOTICE.txt (original)
+++ incubator/hama/branches/0.3/NOTICE.txt Mon Jun 27 13:04:36 2011
@@ -5,4 +5,7 @@ This product includes software developed
 The Apache Software Foundation (http://www.apache.org/).
 
 This product includes JUnit under the Common Public License Version 1.0
-See http://www.junit.org/
\ No newline at end of file
+See http://www.junit.org/
+
+This product includes SLF4J software developed by QOS.ch. 
+Copyright c 2004-2008 QOS.ch. All rights reserved.
\ No newline at end of file

Modified: incubator/hama/branches/0.3/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hama/branches/0.3/pom.xml?rev=1140143&r1=1140142&r2=1140143&view=diff
==============================================================================
--- incubator/hama/branches/0.3/pom.xml (original)
+++ incubator/hama/branches/0.3/pom.xml Mon Jun 27 13:04:36 2011
@@ -84,199 +84,107 @@
       scm:svn:https://svn.apache.org/repos/asf/incubator/hama
     </developerConnection>
   </scm>
+  
+  <properties>
+    <!-- Dependencies -->
+    <commons-logging.version>1.1.1</commons-logging.version>
+    <commons-cli.version>1.2</commons-cli.version>
+    <hadoop.version>0.20.2</hadoop.version>
+    <jetty.version>6.1.4</jetty.version>
+    <junit.version>4.8.1</junit.version>
+    <slf4j-log4j12.version>1.5.2</slf4j-log4j12.version>
+    <servlet-api.version>6.0.32</servlet-api.version>
+    <log4j.version>1.2.16</log4j.version>
+    <zookeeper.version>3.3.1</zookeeper.version>
+    <ant.version>1.7.1</ant.version>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
-      <version>1.0.4</version>
+      <version>${commons-logging.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-cli</groupId>
+      <artifactId>commons-cli</artifactId>
+      <version>${commons-cli.version}</version>
     </dependency>
     <dependency>
       <groupId>org.mortbay.jetty</groupId>
       <artifactId>jetty</artifactId>
-      <version>6.1H.22</version>
+      <version>${jetty.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.tomcat</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>${servlet-api.version}</version>
     </dependency>
     <dependency>
       <groupId>org.mortbay.jetty</groupId>
       <artifactId>jetty-annotations</artifactId>
-      <version>6.1H.22</version>
-      <exclusions>
-        <exclusion>
-          <groupId>geronimo-spec</groupId>
-          <artifactId>geronimo-spec-jta</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>geronimo-annotation_1.0_spec</artifactId>
-        </exclusion>
-      </exclusions>
+      <version>${jetty.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.mortbay.jetty</groupId>
+      <artifactId>jetty-util</artifactId>
+      <version>${jetty.version}</version>
     </dependency>
     <dependency>
       <groupId>org.mortbay.jetty</groupId>
-      <artifactId>jetty-naming</artifactId>
-      <version>6.1H.22</version>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.mail</groupId>
-          <artifactId>mail</artifactId>
-        </exclusion>
-      </exclusions>
+      <artifactId>jsp-api-2.1</artifactId>
+      <version>${jetty.version}</version>
     </dependency>
     <dependency>
       <groupId>org.mortbay.jetty</groupId>
-      <artifactId>jetty-util</artifactId>
-      <version>6.1H.22</version>
+      <artifactId>jsp-2.1</artifactId>
+      <version>${jetty.version}</version>
     </dependency>
     <dependency>
+      <groupId>org.apache.ant</groupId>
+      <artifactId>ant</artifactId>
+      <version>${ant.version}</version>
+    </dependency>    
+    <dependency>
+      <groupId>org.apache.ant</groupId>
+      <artifactId>ant-launcher</artifactId>
+      <version>${ant.version}</version>
+    </dependency>    
+    <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-core</artifactId>
-      <version>0.20.2</version>
-      <exclusions>
-        <exclusion>
-          <groupId>ant</groupId>
-          <artifactId>ant</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>commons-codec</groupId>
-          <artifactId>commons-codec</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>commons-el</groupId>
-          <artifactId>commons-el</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>commons-httpclient</groupId>
-          <artifactId>commons-httpclient</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>commons-net</groupId>
-          <artifactId>commons-net</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.eclipse.jdt</groupId>
-          <artifactId>core</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>hsqldb</groupId>
-          <artifactId>hsqldb</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>oro</groupId>
-          <artifactId>oro</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>tomcat</groupId>
-          <artifactId>jasper-runtime</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>tomcat</groupId>
-          <artifactId>jasper-compiler</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>net.java.dev.jets3t</groupId>
-          <artifactId>jets3t</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.mortbay.jetty</groupId>
-          <artifactId>jsp-api-2.1</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.mortbay.jetty</groupId>
-          <artifactId>jsp-2.1</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.mortbay.jetty</groupId>
-          <artifactId>servlet-api-2.5</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>xmlenc</groupId>
-          <artifactId>xmlenc</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>net.sf.kosmosfs</groupId>
-          <artifactId>kfs</artifactId>
-        </exclusion>
-      </exclusions>
+      <version>${hadoop.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-test</artifactId>
-      <version>0.20.2</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.apache.ftpserver</groupId>
-          <artifactId>ftplet-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.ftpserver</groupId>
-          <artifactId>ftpserver-core</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.ftpserver</groupId>
-          <artifactId>ftpserver-deprecated</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.mina</groupId>
-          <artifactId>mina-core</artifactId>
-        </exclusion>
-      </exclusions>
+      <version>${hadoop.version}</version>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>3.8.1</version>
+      <version>${junit.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
-      <version>1.5.2</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.slf4j</groupId>
-          <artifactId>slf4j-api</artifactId>
-        </exclusion>
-      </exclusions>
+      <version>${slf4j-log4j12.version}</version>
     </dependency>
     <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
-      <version>1.2.15</version>
+      <version>${log4j.version}</version>
       <scope>provided</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.mail</groupId>
-          <artifactId>mail</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>javax.jms</groupId>
-          <artifactId>jms</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>com.sun.jdmk</groupId>
-          <artifactId>jmxtools</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>com.sun.jmx</groupId>
-          <artifactId>jmxri</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>zookeeper</artifactId>
-      <version>3.3.1</version>
-      <exclusions>
-        <exclusion>
-          <groupId>log4j</groupId>
-          <artifactId>log4j</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>jline</groupId>
-          <artifactId>jline</artifactId>
-        </exclusion>
-      </exclusions>
+      <version>${zookeeper.version}</version>
     </dependency>
   </dependencies>
+  
+  <!-- Builds -->
   <build>
     <sourceDirectory>${source.dir}</sourceDirectory>
     <testSourceDirectory>src/test</testSourceDirectory>
@@ -327,6 +235,7 @@
                   <outputDirectory>${basedir}/lib</outputDirectory>
                   <overWriteReleases>false</overWriteReleases>
                   <overWriteSnapshots>true</overWriteSnapshots>
+                  <excludeTransitive>true</excludeTransitive>
                 </configuration>
               </execution>
             </executions>
@@ -413,4 +322,3 @@
     </profile>
   </profiles>
 </project>
-

Modified: incubator/hama/branches/0.3/src/examples/org/apache/hama/examples/graph/PageRank.java
URL: http://svn.apache.org/viewvc/incubator/hama/branches/0.3/src/examples/org/apache/hama/examples/graph/PageRank.java?rev=1140143&r1=1140142&r2=1140143&view=diff
==============================================================================
--- incubator/hama/branches/0.3/src/examples/org/apache/hama/examples/graph/PageRank.java
(original)
+++ incubator/hama/branches/0.3/src/examples/org/apache/hama/examples/graph/PageRank.java
Mon Jun 27 13:04:36 2011
@@ -153,7 +153,7 @@ public class PageRank extends PageRankBa
     List<PageRankVertex> outgoingEdges = adjacencyList.get(v);
     for (PageRankVertex adjacent : outgoingEdges) {
       int mod = Math.abs(adjacent.getId() % peerNames.length);
-      // send a message of the tentative pagerank devided by the size of
+      // send a message of the tentative pagerank divided by the size of
       // the outgoing edges to all adjacents
       peer.send(peerNames[mod], new DoubleMessage(adjacent.getUrl(),
           tentativePagerank.get(v) / outgoingEdges.size()));
@@ -164,8 +164,8 @@ public class PageRank extends PageRankBa
   public void setConf(Configuration conf) {
     this.conf = conf;
     numOfVertices = Integer.parseInt(conf.get("num.vertices"));
-    ALPHA = 0.15 / (double) numOfVertices;
     DAMPING_FACTOR = Double.parseDouble(conf.get("damping.factor"));
+    ALPHA = (1 - DAMPING_FACTOR) / (double) numOfVertices;
     EPSILON = Double.parseDouble(conf.get("epsilon.error"));
     MAX_ITERATIONS = Integer.parseInt(conf.get("max.iterations"));
     peerNames = conf.get(ShortestPaths.BSP_PEERS).split(";");
@@ -177,14 +177,17 @@ public class PageRank extends PageRankBa
   }
 
   public static void printUsage() {
-    LOG.info("PageRank Example:");
-    LOG
-        .info("<damping factor> <epsilon error> <optional: output path>
<optional: input path>");
+    System.out.println("PageRank Example:");
+    System.out
+        .println("<damping factor> <epsilon error> <optional: output path>
<optional: input path>");
   }
 
   public static void main(String[] args) throws IOException,
       InterruptedException, ClassNotFoundException {
-    printUsage();
+    if (args.length == 0) {
+      printUsage();
+      System.exit(-1);
+    }
 
     HamaConfiguration conf = new HamaConfiguration(new Configuration());
     // set the defaults
@@ -192,8 +195,8 @@ public class PageRank extends PageRankBa
     conf.set("epsilon.error", "0.000001");
 
     if (args.length < 2) {
-      LOG.info("You have to provide a damping factor and an error!");
-      LOG.info("Try using 0.85 0.001 as parameter!");
+      System.out.println("You have to provide a damping factor and an error!");
+      System.out.println("Try using 0.85 0.001 as parameter!");
       System.exit(-1);
     } else {
       conf.set("damping.factor", args[0]);

Modified: incubator/hama/branches/0.3/src/java/org/apache/hama/http/HttpServer.java
URL: http://svn.apache.org/viewvc/incubator/hama/branches/0.3/src/java/org/apache/hama/http/HttpServer.java?rev=1140143&r1=1140142&r2=1140143&view=diff
==============================================================================
--- incubator/hama/branches/0.3/src/java/org/apache/hama/http/HttpServer.java (original)
+++ incubator/hama/branches/0.3/src/java/org/apache/hama/http/HttpServer.java Mon Jun 27 13:04:36
2011
@@ -49,7 +49,7 @@ import org.mortbay.jetty.servlet.FilterM
 import org.mortbay.jetty.servlet.ServletHandler;
 import org.mortbay.jetty.servlet.ServletHolder;
 import org.mortbay.jetty.webapp.WebAppContext;
-import org.mortbay.thread.QueuedThreadPool;
+import org.mortbay.thread.BoundedThreadPool;
 import org.mortbay.util.MultiException;
 
 /**
@@ -98,7 +98,7 @@ public class HttpServer {
     listener.setPort(port);
     webServer.addConnector(listener);
 
-    webServer.setThreadPool(new QueuedThreadPool());
+    webServer.setThreadPool(new BoundedThreadPool());
 
     final String appDir = getWebAppsPath();
     ContextHandlerCollection contexts = new ContextHandlerCollection();
@@ -302,7 +302,7 @@ public class HttpServer {
    * Set the min, max number of worker threads (simultaneous connections).
    */
   public void setThreads(int min, int max) {
-    QueuedThreadPool pool = (QueuedThreadPool) webServer.getThreadPool();
+    BoundedThreadPool pool = (BoundedThreadPool) webServer.getThreadPool();
     pool.setMinThreads(min);
     pool.setMaxThreads(max);
   }



Mime
View raw message