You are viewing a plain text version of this content. The canonical link for it is here.
Posted to s4-commits@incubator.apache.org by df...@apache.org on 2013/03/15 17:22:59 UTC

[1/3] git commit: S4-130 fix metrics config for csv output - also minor update for twitter-adapter s4r name in corresponding build file

S4-130 fix metrics config for csv output
- also minor update for twitter-adapter s4r name in corresponding build file


Project: http://git-wip-us.apache.org/repos/asf/incubator-s4/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s4/commit/2a5f92cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s4/tree/2a5f92cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s4/diff/2a5f92cb

Branch: refs/heads/dev
Commit: 2a5f92cbc514027930fe2f55ed25aff5d915c841
Parents: 039c11f
Author: Matthieu Morel <mm...@apache.org>
Authored: Fri Mar 15 11:54:15 2013 +0100
Committer: Matthieu Morel <mm...@apache.org>
Committed: Fri Mar 15 12:19:47 2013 +0100

----------------------------------------------------------------------
 .../java/org/apache/s4/core/util/S4Metrics.java    |    8 ++++----
 test-apps/twitter-adapter/build.gradle             |    2 --
 website/content/doc/0.6.0/metrics.md               |    3 ++-
 .../content/doc/0.6.0/twitter_trending_example.md  |   10 ++++------
 4 files changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/2a5f92cb/subprojects/s4-core/src/main/java/org/apache/s4/core/util/S4Metrics.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/main/java/org/apache/s4/core/util/S4Metrics.java b/subprojects/s4-core/src/main/java/org/apache/s4/core/util/S4Metrics.java
index 6544c36..eb637a2 100644
--- a/subprojects/s4-core/src/main/java/org/apache/s4/core/util/S4Metrics.java
+++ b/subprojects/s4-core/src/main/java/org/apache/s4/core/util/S4Metrics.java
@@ -106,10 +106,10 @@ public class S4Metrics {
             } else {
                 String group1 = matcher.group(1);
 
-                if ("csv".equals(group1)) {
-                    String outputDir = matcher.group(2);
-                    long period = Long.valueOf(matcher.group(3));
-                    TimeUnit timeUnit = TimeUnit.valueOf(matcher.group(4));
+                if (group1.startsWith("csv")) {
+                    String outputDir = group1.substring("csv:".length());
+                    long period = Long.valueOf(matcher.group(2));
+                    TimeUnit timeUnit = TimeUnit.valueOf(matcher.group(3));
                     logger.info("Reporting metrics through csv files in directory [{}] with frequency of [{}] [{}]",
                             new String[] { outputDir, String.valueOf(period), timeUnit.name() });
                     CsvReporter.enable(new File(outputDir), period, timeUnit);

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/2a5f92cb/test-apps/twitter-adapter/build.gradle
----------------------------------------------------------------------
diff --git a/test-apps/twitter-adapter/build.gradle b/test-apps/twitter-adapter/build.gradle
index 0d93fd0..e654957 100644
--- a/test-apps/twitter-adapter/build.gradle
+++ b/test-apps/twitter-adapter/build.gradle
@@ -46,8 +46,6 @@ project.ext["archivesBaseName"] = "$project.name"
 project.ext["distRootFolder"] = "$archivesBaseName-${-> version}"
 
 
-// Append the suffix 'SNAPSHOT' when the build is not for release.
-version = new Version(major: 0, minor: 0, bugfix: 0, isRelease: false)
 group = 'org.apache.s4'
 
 apply plugin: 'java'

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/2a5f92cb/website/content/doc/0.6.0/metrics.md
----------------------------------------------------------------------
diff --git a/website/content/doc/0.6.0/metrics.md b/website/content/doc/0.6.0/metrics.md
index 552df5d..70d08d5 100644
--- a/website/content/doc/0.6.0/metrics.md
+++ b/website/content/doc/0.6.0/metrics.md
@@ -31,7 +31,8 @@ The `s4.metrics.config` parameter enables periodic dumps of aggregated statistic
 Examples:
 	
 	# dump metrics to csv files to /path/to/directory every 10 seconds
-	csv:file://path/to/directory:10:SECONDS
+	# (recommendation: use a clean directory)
+	csv:/path/to/directory:10:SECONDS
 	
 	# dump metrics to the console every minute
 	console:1:MINUTES

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/2a5f92cb/website/content/doc/0.6.0/twitter_trending_example.md
----------------------------------------------------------------------
diff --git a/website/content/doc/0.6.0/twitter_trending_example.md b/website/content/doc/0.6.0/twitter_trending_example.md
index 0787d89..f7fabf4 100644
--- a/website/content/doc/0.6.0/twitter_trending_example.md
+++ b/website/content/doc/0.6.0/twitter_trending_example.md
@@ -47,12 +47,14 @@ Have a look at the code in these directories. You'll note that:
 * Build and deploy twitter-counter app
 
 		./s4 s4r -b=`pwd`/test-apps/twitter-counter/build.gradle -appClass=org.apache.s4.example.twitter.TwitterCounterApp twitter-counter
+		
 		./s4 deploy -appName=twitter-counter -c=cluster1 -s4r=`pwd`/test-apps/twitter-counter/build/libs/twitter-counter.s4r
 		
-* Build and deploy twitter-adapter app. In this example, we don't directly specify the app class of the adapter, we use the deployment approach for apps (remember, the adapter is also an app). Notice that the twitter-adapter package also has a different naming scheme. [^1]
+* Build and deploy twitter-adapter app. In this example, we don't directly specify the app class of the adapter, we use the deployment approach for apps (remember, the adapter is also an app). 
 
 		./s4 s4r -b=`pwd`/test-apps/twitter-adapter/build.gradle -appClass=org.apache.s4.example.twitter.TwitterInputAdapter twitter-adapter
-		./s4 deploy -appName=twitter-adapter -c=cluster2 -s4r=`pwd`/test-apps/twitter-adapter/build/libs/twitter-adapter-0.0.0-SNAPSHOT.s4r -p=s4.adapter.output.stream=RawStatus
+		
+		./s4 deploy -appName=twitter-adapter -c=cluster2 -s4r=`pwd`/test-apps/twitter-adapter/build/libs/twitter-adapter.s4r -p=s4.adapter.output.stream=RawStatus
 		
 * Observe the current 10 most popular topics in file TopNTopics.txt. The file gets updated at regular intervals, and only outputs topics with a minimum of 10 occurrences, so you may have to wait a little before the file is updated :
 
@@ -79,7 +81,3 @@ Last, the [javadoc](http://people.apache.org/~mmorel/apache-s4-0.6.0-incubating-
 We hope this will help you start rapidly, and remember: we're happy to help!
 
 ----
-
-###Footnotes
-
-[^1]: Modifying the `build.gradle` script you can change several aspects of the build process. By default the name of the `s4r` package is the application name provided in the packaging step, but you can attach the version automatically as in this example.
\ No newline at end of file