これ http://blog.twiwt.org/e/f835d9 がインストールされていれば、ファイルを保存して、実行権限与えておいて
./unfiltered-sample.scala
ってやるだけでローカルで、勝手に空いてるポートで、"hello" を返すだけのサーバー起動するお( ^ω^)
終了は、コンソールでなにかキーを入力すればいいはず
trait Association { | |
type Item <: AbstractItem | |
trait AbstractItem { | |
def memberOf(): Group | |
} | |
type Group <: AbstractGroup | |
trait AbstractGroup { | |
def addItem(item: Item) | |
def removeItem(item: Item) | |
def items(): List[Item] |
これ http://blog.twiwt.org/e/f835d9 がインストールされていれば、ファイルを保存して、実行権限与えておいて
./unfiltered-sample.scala
ってやるだけでローカルで、勝手に空いてるポートで、"hello" を返すだけのサーバー起動するお( ^ω^)
終了は、コンソールでなにかキーを入力すればいいはず
package sample1; | |
import java.net.InetSocketAddress; | |
import java.util.Map; | |
import org.apache.commons.logging.Log; | |
import org.apache.commons.logging.LogFactory; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.net.NetUtils; | |
import org.apache.hadoop.yarn.api.AMRMProtocol; |
OK, I understand what is not supported (now?). | |
In this case, hoop server should send response message means correct reason, like | |
'concurrent append not supported'. | |
But now, in fact, hoop send message as 'failed to create file'. We cannot know what is wrong | |
from this message. (request method? wrong path? or ...?) | |
This is wrong message, and i want to be fixed. |
1 2 3 | |
1 2 3 | |
1 2 3 |
libraryDependencies += "org.scala-tools.testing" %% "scalacheck" % "1.9" |
package com.github.tototoshi.finagle_hack | |
import java.net.InetSocketAddress | |
import com.twitter.finagle.{Service, SimpleFilter} | |
import com.twitter.util.Future | |
import com.twitter.finagle.builder.{Server, ServerBuilder} | |
import com.twitter.finagle.http._ | |
import com.twitter.finagle.http.path._ | |
object HTTPServer { |
/** | |
* UPDATE: this trick doesn't work here because when using 'asInstanceOf', Nothing is inferred as being the expected type, thus the conversion fails at run-time. | |
*/ | |
/** | |
* Let's say you have some ugly casting to do | |
*/ | |
// this doesn't compile with something like: "expected _, got Any" | |
function match { |
/** | |
* Arbitrary instance for a CompNode: Load, ParallelDo, GroupByKey, Combine, Op or Return | |
*/ | |
import scalaz.Scalaz._ | |
import Gen._ | |
/** | |
* we're using a sized generator where the size of the generated data will be the depth of the graph | |
* This allows to control the generation phase for ScalaCheck properties with minSize and maxSize | |
*/ |