You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by cr...@apache.org on 2014/06/11 23:27:24 UTC
git commit: SAMZA-192; log pid in samza container
Repository: incubator-samza
Updated Branches:
refs/heads/master aaf0f64c4 -> 11566ab7a
SAMZA-192; log pid in samza container
Project: http://git-wip-us.apache.org/repos/asf/incubator-samza/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-samza/commit/11566ab7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-samza/tree/11566ab7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-samza/diff/11566ab7
Branch: refs/heads/master
Commit: 11566ab7acd05d321ac6d22821f8d2c578e3c121
Parents: aaf0f64
Author: Raul Castro Fernandez <ra...@contxt.in>
Authored: Wed Jun 11 14:27:16 2014 -0700
Committer: Chris Riccomini <cr...@criccomi-mn.linkedin.biz>
Committed: Wed Jun 11 14:27:16 2014 -0700
----------------------------------------------------------------------
.../scala/org/apache/samza/container/SamzaContainer.scala | 3 +++
samza-core/src/main/scala/org/apache/samza/util/Util.scala | 9 +++++++++
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-samza/blob/11566ab7/samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala
----------------------------------------------------------------------
diff --git a/samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala b/samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala
index bfff2a6..356adbb 100644
--- a/samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala
+++ b/samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala
@@ -86,7 +86,10 @@ object SamzaContainer extends Logging {
}
def apply(containerName: String, inputStreams: Set[SystemStreamPartition], config: Config) = {
+ val containerPID = Util.getContainerPID
+
info("Setting up Samza container: %s" format containerName)
+ info("Samza container PID: %s" format containerPID)
info("Using streams and partitions: %s" format inputStreams)
info("Using configuration: %s" format config)
http://git-wip-us.apache.org/repos/asf/incubator-samza/blob/11566ab7/samza-core/src/main/scala/org/apache/samza/util/Util.scala
----------------------------------------------------------------------
diff --git a/samza-core/src/main/scala/org/apache/samza/util/Util.scala b/samza-core/src/main/scala/org/apache/samza/util/Util.scala
index 1b548fd..11c23d0 100644
--- a/samza-core/src/main/scala/org/apache/samza/util/Util.scala
+++ b/samza-core/src/main/scala/org/apache/samza/util/Util.scala
@@ -20,6 +20,7 @@
package org.apache.samza.util
import java.io.File
+import java.lang.management.ManagementFactory
import java.util.Random
import grizzled.slf4j.Logging
import org.apache.samza.{ Partition, SamzaException }
@@ -171,4 +172,12 @@ object Util extends Logging {
def notNull[T](obj: T, msg: String) = if (obj == null) {
throw new NullPointerException(msg)
}
+
+ /**
+ * Returns the name representing the JVM. It usually contains the PID of the process plus some additional information
+ * @return String that contains the name representing this JVM
+ */
+ def getContainerPID(): String = {
+ ManagementFactory.getRuntimeMXBean().getName()
+ }
}