hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chl...@apache.org
Subject [hama] branch componentization updated: Add FileSystem to BSPMaster.
Date Sun, 17 Mar 2019 22:44:51 GMT
This is an automated email from the ASF dual-hosted git repository.

chl501 pushed a commit to branch componentization
in repository https://gitbox.apache.org/repos/asf/hama.git


The following commit(s) were added to refs/heads/componentization by this push:
     new d9f658a  Add FileSystem to BSPMaster.
d9f658a is described below

commit d9f658a0f0c4ed1f730954c4952b3d266be5058f
Author: Chiahung Lin <chl501@apache.org>
AuthorDate: Sun Mar 17 23:41:45 2019 +0100

    Add FileSystem to BSPMaster.
---
 commons.v2/src/main/scala/org/apache/hama/fs/FileSystem.scala     | 4 ++++
 .../src/main/scala/org/apache/hama/membership/BSPMaster.scala     | 8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/commons.v2/src/main/scala/org/apache/hama/fs/FileSystem.scala b/commons.v2/src/main/scala/org/apache/hama/fs/FileSystem.scala
index cae2503..a8371fd 100644
--- a/commons.v2/src/main/scala/org/apache/hama/fs/FileSystem.scala
+++ b/commons.v2/src/main/scala/org/apache/hama/fs/FileSystem.scala
@@ -35,6 +35,8 @@ trait FileSystem {
 
   def exist(path: Path): Boolean 
 
+  def isLocal: Boolean
+
 }
 
 object FileSystem {
@@ -58,6 +60,8 @@ object FileSystem {
 
     override def exist(path: Path): Boolean = path.toFile.exists
 
+    override def isLocal: Boolean = true
+
   }
 
 }
diff --git a/membership/src/main/scala/org/apache/hama/membership/BSPMaster.scala b/membership/src/main/scala/org/apache/hama/membership/BSPMaster.scala
index 778ae21..ea70d8c 100644
--- a/membership/src/main/scala/org/apache/hama/membership/BSPMaster.scala
+++ b/membership/src/main/scala/org/apache/hama/membership/BSPMaster.scala
@@ -23,6 +23,7 @@ import cats.implicits._
 import com.google.common.hash.Hashing
 import com.google.common.base.Charsets._
 import org.apache.hama.conf.Setting
+import org.apache.hama.fs.FileSystem
 import org.apache.hama.util.Utils._
 
 object Address {
@@ -175,8 +176,11 @@ object BSPMaster {
     val port = setting.get("org.apache.hama.net.port", -1)
     (Address.create(host, port),
     Identifier.create(host, port),
-    Master.validNel).mapN(BSPMaster.apply)
+    Master.validNel,
+    FileSystem.local.validNel).mapN(BSPMaster.apply)
   }
 
 }
-final case class BSPMaster (address: Address, id: Identifier, role: Role)
+final case class BSPMaster (
+  address: Address, id: Identifier, role: Role, fs: FileSystem
+)


Mime
View raw message