Skip to content

Commit

Permalink
Merge pull request #2185 from adamos/add_content_timeout
Browse files Browse the repository at this point in the history
Add content requests timeout
  • Loading branch information
Ximo Guanter Gonzálbez committed Jun 16, 2014
2 parents 458b592 + 9c560ac commit 4076df6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,23 @@ class MetadataServerConfig(config: Config) extends BaseInfinityConfig(config) {
class ContentServerConfig(config: Config) extends BaseInfinityConfig(config) {
val chunkSize = withDefault(config.getInt("content.chunkSize"), DefaultChunkSize)
val bufferSize = withDefault(config.getInt("content.bufferSize"), DefaultBufferSize)

val contentRequestTimeout = withDefault(
config.getLong("content.requestTimeout"), DefaultContentRequestTimeout)
val nameNodeRPCUri: URI =
new URI(config.getString(s"${PluginConfig.HadoopKeyPrefix}.$NameNodeHdfsAddressKey"))

val localContentServerUrl: URL = contentServerUrl(InetAddress.getLocalHost.getHostName)
}

object InfinityConfig {
import scala.concurrent.duration._

val DefaultProtocol: String = "http"
val DefaultContentPort: Int = 51075
val DefaultMetadataPort: Int = 51070
val DefaultMetadataBasePath: String = "/infinityfs/v1/metadata"
val DefaultContentBasePath: String = "/infinityfs/v1/content"
val DefaultContentRequestTimeout: Long = 15.minutes.toMillis
val DefaultReplication: Short = 3
val DefaultBlockSize: Long = 64l * 1024l * 1024l
val NameNodeHdfsAddressKey = "fs.defaultFS"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class ContentRoutes(
private val actionValidator = new HttpContentActionValidator(config, dataNode)
private val renderResult = new ContentActionResultRenderer(config.chunkSize)

override val asyncRequestTimeoutMillis: Long = config.contentRequestTimeout

override def intent: Intent = { case request =>
val response = for {
authInfo <- AuthInfo(request)
Expand Down

0 comments on commit 4076df6

Please sign in to comment.