Skip to content

RangeHandle does not properly group repair updates #44

@stephentu

Description

@stephentu

RangeHandle uses a

var loosers = new HashMap[Array[Byte], (Array[Byte], List[RemoteActorProxy])]

to attempt to group loser keys. however, there are several issues with this

(1) Array[Byte]'s hashcode is identity based:
scala> val h = new collection.mutable.HashMap[Array[Byte], Int]
h: scala.collection.mutable.HashMap[Array[Byte],Int] = Map()

scala> h += ((Array(0,1,2), 1))
res0: h.type = Map(([B@1224b90,1))

scala> h contains Array(0, 1, 2)
res1: Boolean = false

  1. we're not even taking advantage of this, since we don't have a bulk put request, but we process puts sequentially (albeit asynchronously)
    for ((key, (data, servers)) <- handler.loosers) {
    for (server <- servers) {
    server !! PutRequest(key, Some(data))
    }
    }

so i propose either we
(1) considering the HashMaps into an ArrayBuffer for efficiency

(2) use a wrapper class around Array[Byte] which properly computes the hash code. then we can take advantage of this grouping by introducing a bulk put request

the current solution is sub-optimal compared to (1) or (2) b/c a) we don't group keys properly, b) even if we did we don't exploit the grouping

thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions