Skip to content

Commit

Permalink
journalling should be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
asmuth committed Jul 30, 2012
1 parent bcb50cb commit ade1c73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/Backbone.scala
Expand Up @@ -23,12 +23,16 @@ class Backbone() extends Actor{
if (msg.exists(List("_volatile")) unary_!) {
sequence += 1
msg.sequence = sequence

Fyrehose.message_index ! msg
Fyrehose.message_cache ! msg
Fyrehose.writer ! msg
}

msg.sequence = sequence

if (Fyrehose.writer != null)
Fyrehose.writer ! msg

queries.foreach(_ ! msg)
}

Expand Down
12 changes: 5 additions & 7 deletions src/Fyrehose.scala
Expand Up @@ -23,7 +23,6 @@ object Fyrehose{
val BUFFER_SIZE_UDP = 65535
val MESSAGE_CACHE_SIZE = 100000
val FILE_CHUNK_SIZE = 3600 * 6
val DEFAULT_OUT_DIR = "/tmp/fyrehose"

var backbone : Backbone = null
var writer : Writer = null
Expand Down Expand Up @@ -63,9 +62,6 @@ object Fyrehose{
(CONFIG contains 'listen_udp unary_!)
) return usage()

if (CONFIG contains 'out_dir unary_!)
CONFIG += (('out_dir, DEFAULT_OUT_DIR))

if (CONFIG contains 'upstream)
return println("not yet implemented: -x / --upstream")

Expand All @@ -83,8 +79,10 @@ object Fyrehose{
backbone = new Backbone()
backbone.start()

writer = new Writer()
writer.start()
if (CONFIG contains 'out_dir) {
writer = new Writer()
writer.start()
}

message_cache.start()
message_index.start()
Expand Down Expand Up @@ -127,7 +125,7 @@ object Fyrehose{
println("usage: fyrehose [options] ")
println(" -l, --listen-tcp <port> listen for clients on this tcp port ")
println(" -u, --listen-udp <port> listen for clients on this udp port ")
println(" -p, --path <path> path to store data (default: /tmp/fyrehose/) ")
println(" -p, --path <path> write event journal (default: no journal) ")
println(" -t, --timeout <msecs> connection idle timeout (default: 5000ms) ")
// println(" -x, --upstream <addr> pull events from this fyrehosed \n")
}
Expand Down

0 comments on commit ade1c73

Please sign in to comment.