Skip to content
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

ISPN-5528 Expose segment ownership in the Hot Rod client #3532

Closed
wants to merge 1 commit into from

Conversation

gustavocoding
Copy link

https://issues.jboss.org/browse/ISPN-5528

Changes in the server:

  • Always send numSegments for clustered caches.
  • Sends all owners instead of only 2 during topology changes

Changes in the client:

  • Added getSegmentsByServer() method that:
    • if there's topology in the server, but hash function is zero, assumes REPL cache and every server is associated with all segments {0...numSegments-1}
    • if there's no topology present (topologyId < 0), associates the server with an empty set (LOCAL cache)
    • If both numSegments and hashFunction are present (DIST) uses the consistent hash to associate the segments to each server

@gustavocoding
Copy link
Author

rebased

@gustavocoding
Copy link
Author

This PR should be rebased on top of #3511, marking as preview for now

@gustavocoding
Copy link
Author

Rebased

@gustavocoding
Copy link
Author

Failures not caused by this PR:
Caused by: java.io.FileNotFoundException: /tmp/infinispanTempFiles/StateTransferFileCacheLoaderFunctionalTest1/nbst-with-file-loader.dat (Read-only file system)

Looked at the agents and all have free disk space and /tmp is apparently writable, need to investigate the cause...

@gustavocoding
Copy link
Author

rebased

/**
* Returns segment ownership for this cache
*/
Map<SocketAddress, Set<Integer>> getSegmentsByServer();
Copy link
Member

Choose a reason for hiding this comment

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

Not sure I like this exposed as public API. Can't we just leave it in RemoteCacheImpl and have code that needs to use this cast to the actual implementation ?

Copy link
Author

Choose a reason for hiding this comment

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

What's your concern of exposing this as public API?

Copy link
Member

Choose a reason for hiding this comment

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

It is definitely not a user-oriented API: however, once it ends up in the public API we have to keep it stable

Copy link
Author

Choose a reason for hiding this comment

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

It is definitely not a user-oriented API

Yeah, it's like a SPI, maybe an advanced API 😄

One of the Remotecache.retrieveEntries accepts a list of segments to filter, IMO it'd be a bit odd to hide getSegmentsByServer since it's a useful complement. We discussed previously the possibility of a AdvancedRemoteCache interface, it's not too late to rescue that idea if there's strong opposition to expose segments & co in the RemoteCache

we have to keep it stable

Not trying to predict the future, but segment ownership by servers is a solidified concept that is not likely to go away anytime soon?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I understand, but then I'd probably prefer to encapsulate the return type into an interface like RemoteSegmentMapping instead of Map<SocketAddress, Set> (same for retrieveEntries).

Copy link
Author

Choose a reason for hiding this comment

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

👍 to encapsulate the naked Map

@gustavocoding
Copy link
Author

Updated with changes to the API

@galderz
Copy link
Member

galderz commented Jul 3, 2015

Looks good, integrated :)

@galderz galderz closed this Jul 3, 2015
@gustavocoding gustavocoding deleted the ISPN-5528 branch December 24, 2015 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants