-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exceptions on the cache-store should be ignored for Read/WriteThroughStore #225
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.twitter.storehaus | ||
|
||
import com.twitter.util.Future | ||
|
||
class ExceptionStore[K, V](f: Float = 0.5f) extends Store[K, V] { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this idea. Did you intend to use f to throw exceptions with some probability? It's not currently being used in this code though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I originally intended to use configurable possibility. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Will investigate failures on random exceptions separately. |
||
override def get(k: K): Future[Option[V]] = { | ||
Future.exception(new RuntimeException()) | ||
} | ||
|
||
override def put(kv: (K, Option[V])): Future[Unit] = { | ||
Future.exception(new RuntimeException()) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file needs the copyright/license header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, thanks