Permalink
Browse files

code cleanup

- fixed leftovers from previous experiments
- removed bookkeeper backend
  • Loading branch information...
1 parent 96f9d93 commit ecccad9db017ce317f96171708d1d77f3e2e1fbc Matthieu Morel committed Aug 26, 2011
View
@@ -88,8 +88,6 @@ scala_compiler: 'org.scala-lang:scala-compiler:2.8.1',
scala_library: 'org.scala-lang:scala-library:2.8.1',
jedis: 'redis.clients:jedis:2.0.0',
commons_pool: 'commons-pool:commons-pool:1.5.6',
-bookkeeper: 'org.apache.bookkeeper:bookkeeper-server:3.4.0-SNAPSHOT',
-netty: 'org.jboss.netty:netty:3.2.4.Final'
]
@@ -153,66 +151,88 @@ dependencies {
binDistImage = copySpec {
/* Include all the resources. */
- from project(':s4-core').sourceSets.main.resources
-
- into ("s4-core/lib") {
- from project("s4-core").configurations.runtime
- from project("s4-core").configurations.archives.allArtifactFiles.filter{ file -> !file.name.endsWith('-sources.jar') }
- }
- into ("s4-driver/lib/java") {
- from project("s4-driver").configurations.runtime
- from project("s4-driver").configurations.archives.allArtifactFiles.filter{ file -> !file.name.endsWith('-sources.jar') }
+ from project(':s4-core').sourceSets.main.resources
+
+ [project('s4-core'), project('s4-driver')].collect { project ->
+ into (project.name + "/lib") {
+ from project.configurations.runtime
+ from project.configurations.archives.allArtifactFiles.filter{ file -> !file.name.endsWith('-sources.jar') }
+ }
}
}
allDistImage = copySpec {
with binDistImage
-
- base = "${project(":").projectDir}/s4-driver"
- into ("s4-driver/lib/perl") {
- from "$base/perl"
- }
- into ("s4-driver/lib/python") {
- from "$base/python"
- }
- into ("testinput") {
- from "${project(":").projectDir}/s4-examples/testinput"
- }
-
- subprojects.findAll {proj ->
- into('src') {
+ subprojects.findAll {proj ->
+ into('src') {
from proj.sourceSets.main.allJava
}
- switch(proj.name) {
- case "s4-example-driver":
- into("s4-driver") {
- from proj.sourceSets.main.resources
- }
- into ("s4-driver/lib/java") {
- from proj.configurations.runtime
- from proj.configurations.archives.allArtifactFiles
- }
- break
-
- case ~/(s4\-example).*/:
- into ("s4-example-apps/" + proj.name + "/lib") {
- from(
- proj.configurations.runtime
- - project("s4-core").configurations.runtime
- )
- from proj.configurations.archives.allArtifactFiles
- }
- into ("s4-example-apps/" + proj.name) {
- from proj.sourceSets.main.resources
- }
- break
- }
- }
+ switch(proj.name) {
+ case "s4-core":
+ break
+
+ case "s4-driver":
+ into ("${proj.name}/lib/python") {
+ from ("${proj.name}/python/")
+ }
+ into ("${proj.name}/lib/perl") {
+ from ("${proj.name}/perl/")
+ }
+ break
+ case "s4-example-driver":
+ into("s4-driver") {
+ from proj.sourceSets.main.resources
+ }
+ into ("s4-driver/lib") {
+ from proj.configurations.runtime
+ from proj.configurations.archives.allArtifactFiles
+ }
+ break
+
+ case "s4-tools-loadgenerator":
+ into("s4-tools-loadgenerator") {
+ from proj.sourceSets.main.resources
+ }
+ into ("s4-tools-loadgenerator/lib") {
+ from proj.configurations.runtime
+ from proj.configurations.archives.allArtifactFiles
+ }
+ break
+
+ case "s4-example-testinput":
+ print "Got here"
+ into("s4-example-testinput") {
+ from proj.sourceSets.main.resources
+ }
+ break
+
+ case ~/(s4\-example).*/:
+ into ("s4-example-apps/" + proj.name + "/lib") {
+ from(
+ proj.configurations.runtime
+ - project("s4-core").configurations.runtime
+ )
+ from proj.configurations.archives.allArtifactFiles
+ }
+ into ("s4-example-apps/" + proj.name) {
+ from proj.sourceSets.main.resources
+ }
+ break
+
+ default :
+ println("default")
+
+ }
+ //if(project.name != 's4-core') {
+ // into(project.name) {
+ // from project.sourceSets.main.resources
+ // }
+ //}
+ }
into('javadoc') {
from "$buildDir/javadoc"
}
}
-
task binImage(type: Copy) {
description = "Create binary image"
destinationDir = file("$buildDir/s4-image")
@@ -225,6 +245,12 @@ task allImage(type: Copy, dependsOn: s4Javadoc) {
with allDistImage
}
+allImage << {
+ // we need this because copyTask's fileMode property is not honored
+ ant.chmod(dir: "$buildDir/s4-image/scripts", perm: "u+x", includes: "*")
+ ant.chmod(dir: "$buildDir/s4-image/s4-tools-loadgenerator/scripts", perm: "u+x", includes: "*")
+ ant.chmod(dir: "$buildDir/s4-image/s4-driver/scripts", perm: "u+x", includes: "*")
+}
task binTgz( type: Tar) {
description = "Build binary bundle in GZIP format"
Binary file not shown.
@@ -26,9 +26,7 @@ dependencies {
compile( libraries.commons_cli )
compile( libraries.commons_jexl )
compile( libraries.commons_codec )
- compile( libraries.bookkeeper )
compile( libraries.jedis )
- compile( libraries.netty )
compile project(':s4-comm')
}
@@ -15,6 +15,7 @@
*/
package io.s4;
+import io.s4.ft.SafeKeeper;
import io.s4.processor.AbstractPE;
import io.s4.processor.PEContainer;
import io.s4.util.S4Util;
@@ -35,6 +36,8 @@
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
@@ -240,7 +243,11 @@ public static void main(String args[]) throws Exception {
for (String processingElementBeanName : processingElementBeanNames) {
AbstractPE bean = (AbstractPE) context.getBean(processingElementBeanName);
bean.setClock(clock);
-
+ try {
+ bean.setSafeKeeper((SafeKeeper) context.getBean("safeKeeper"));
+ } catch (NoSuchBeanDefinitionException ignored) {
+ // no safe keeper = no checkpointing / recovery
+ }
// if the application did not specify an id, use the Spring bean name
if (bean.getId() == null) {
bean.setId(processingElementBeanName);
@@ -31,7 +31,6 @@
private AsynchronousEventProcessor eventProcessor;
private io.s4.listener.EventListener rawListener;
private Monitor monitor;
- private int partitionId;
public void setMonitor(Monitor monitor) {
this.monitor = monitor;
@@ -57,14 +56,6 @@ public int getEventCount() {
return eventCount;
}
- public void setPartitionId(int partitionId) {
- this.partitionId = partitionId;
- }
-
- public int getPartitionId() {
- return this.partitionId;
- }
-
public EventListener() {
}
Oops, something went wrong.

0 comments on commit ecccad9

Please sign in to comment.