Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove ForwardingManager, rename stuff to less confusing Rowzy names

  • Loading branch information...
commit ce8fe247756c7087cfdfaaaa53d3af7fa18fed62 1 parent 1544917
@freels freels authored
View
9 src/main/scala/com/twitter/rowz/ForwardingManager.scala
@@ -1,9 +0,0 @@
-package com.twitter.rowz
-
-import com.twitter.gizzard.nameserver.{Forwarding, NameServer}
-import com.twitter.gizzard.shards.ShardException
-
-
-class ForwardingManager(nameServer: NameServer[Shard]) extends (Long => Shard) {
- def apply(id: Long) = nameServer.findCurrentForwarding(0, id)
-}
View
10 src/main/scala/com/twitter/rowz/Shard.scala → src/main/scala/com/twitter/rowz/RowzShard.scala
@@ -4,17 +4,17 @@ import com.twitter.gizzard.shards
import com.twitter.xrayspecs.Time
-object Shard {
+object RowzShard {
type Cursor = Long
- val CursorStart = -1
+ val CursorStart = 0
}
-trait Shard extends shards.Shard {
- import Shard.Cursor
+trait RowzShard extends shards.Shard {
+ import RowzShard._
def create(id: Long, name: String, at: Time)
def destroy(row: Row, at: Time)
def read(id: Long): Option[Row]
def selectAll(cursor: Cursor, count: Int): (Seq[Row], Option[Cursor])
def write(rows: Seq[Row])
-}
+}
View
11 ...cala/com/twitter/rowz/ReadWriteShardAdapter.scala → ...ain/scala/com/twitter/rowz/RowzShardAdapter.scala
@@ -1,13 +1,12 @@
package com.twitter.rowz
-import com.twitter.gizzard.shards
-import com.twitter.gizzard.shards.ReadWriteShard
-import com.twitter.xrayspecs.Time
-import Shard.Cursor
+import com.twitter.gizzard.shards.{ReadWriteShard, ReadWriteShardAdapter}
+import com.twitter.util.Time
+import RowzShard.Cursor
-class ReadWriteShardAdapter(shard: ReadWriteShard[Shard])
- extends shards.ReadWriteShardAdapter(shard) with Shard {
+class RowzShardAdapter(shard: ReadWriteShard[Shard])
+extends ReadWriteShardAdapter(shard) with RowzShard {
def create(id: Long, name: String, at: Time) = shard.writeOperation(_.create(id, name, at))
def destroy(row: Row, at: Time) = shard.writeOperation(_.destroy(row, at))
Please sign in to comment.
Something went wrong with that request. Please try again.