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

adds a cache for Tasks, which are never changed #722

Merged
merged 5 commits into from Oct 12, 2015

Conversation

Projects
None yet
4 participants
@wsorenson
Copy link
Member

wsorenson commented Oct 6, 2015

No description provided.

}

private <T> List<T> getAsyncThrows(final String pathNameForLogs, final Collection<String> paths, final Transcoder<T> transcoder) throws Exception {
private <T> List<T> getAsyncThrows(final String pathNameForLogs, final Collection<String> paths, final Transcoder<T> transcoder, final Optional<ZkCache<T>> cache) throws Exception {
final List<T> objects = Lists.newArrayListWithCapacity(paths.size());

This comment has been minimized.

Copy link
@jhaber

jhaber Oct 6, 2015

Member

Outside the scope of this PR but it looks like the ArrayList being used here is modified concurrently from multiple threads which seems like it could cause problems

@@ -135,6 +135,11 @@ protected boolean exists(String path) {
}
}

protected SingularityDeleteResult delete(String path, ZkCache<?> cache) {
cache.delete(path);

This comment has been minimized.

Copy link
@jhaber

jhaber Oct 6, 2015

Member

Won't other nodes still have this data cached?


public static <U> SingularityJsonTranscoderBinder bindTranscoder(Binder binder) {
return new SingularityJsonTranscoderBinder(binder);
}

This comment has been minimized.

Copy link
@tpetr

tpetr Oct 6, 2015

Member

^ extra cruft here

This comment has been minimized.

Copy link
@jhaber

jhaber Oct 6, 2015

Member

please include link to stack overflow article

}

public ZkCache(int maxSize, int initialSize, MetricRegistry registry, String name) {
cache = CacheBuilder.newBuilder().maximumSize(5000).concurrencyLevel(2).initialCapacity(100).build();

This comment has been minimized.

Copy link
@tpetr

tpetr Oct 6, 2015

Member

need to wire up args

@tpetr tpetr added this to the 0.4.6 milestone Oct 7, 2015

@ssalinas ssalinas added the hs_stable label Oct 9, 2015

wsorenson added a commit that referenced this pull request Oct 12, 2015

Merge pull request #722 from HubSpot/cache_tasks
adds a cache for Tasks, which are never changed

@wsorenson wsorenson merged commit 0e481db into master Oct 12, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.