Skip to content

Hybrid L1/L2 cache#1800

Merged
drcrallen merged 2 commits intoapache:masterfrom
metamx:hybrid-cache
Oct 6, 2015
Merged

Hybrid L1/L2 cache#1800
drcrallen merged 2 commits intoapache:masterfrom
metamx:hybrid-cache

Conversation

@xvrl
Copy link
Copy Markdown
Member

@xvrl xvrl commented Oct 2, 2015

Can be used to combine a local (L1) cache with a remote (L2) cache to reduce cache latency.

@xvrl xvrl self-assigned this Oct 2, 2015
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add it to javaDoc of getBulk that its expected to return a map with no null values.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did, on Cache interface docs

@nishantmonu51
Copy link
Copy Markdown
Member

LGTM

@drcrallen
Copy link
Copy Markdown
Contributor

Needs docs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if we should also warm up level1 cache when there is a miss in l1 cache and hit in l2 cache ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xvrl
Copy link
Copy Markdown
Member Author

xvrl commented Oct 5, 2015

@drcrallen will add docs once the code has been ok'ed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was it required to change semantics of this method or this is done to be "cleaner" ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@himanshug well, it's not technically required, but would make the code both more complex and slower if we have to check the value of each key in the map in order to filter them out in order to do a bulk L2 request.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the upstream code doesn't require the null entries for cache misses, I figured it was easier to enforce it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment thread docs/content/configuration/caching.md Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enabled on the broker...

@himanshug
Copy link
Copy Markdown
Contributor

LGTM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does getBulk guarantee a mutable map is returned?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does not, the question is do we want to add the overhead of copying

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both memcached and mapcache use hashmaps. Can we just change the contract for getBulk to return mutable maps?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to make a copy if necessary, if it becomes a performance drag we can revisit

drcrallen added a commit that referenced this pull request Oct 6, 2015
@drcrallen drcrallen merged commit 020a706 into apache:master Oct 6, 2015
@drcrallen drcrallen deleted the hybrid-cache branch October 6, 2015 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants