Skip to content

Instantly share code, notes, and snippets.

@hn5092
Created July 19, 2016 08:53
Show Gist options
  • Save hn5092/eb31a64bdf40b5e7d6f2336b266f8bf9 to your computer and use it in GitHub Desktop.
Save hn5092/eb31a64bdf40b5e7d6f2336b266f8bf9 to your computer and use it in GitHub Desktop.
user executorcompletionservice
CompletionService<HStore> completionService =
new ExecutorCompletionService<HStore>(storeOpenerThreadPool);
// initialize each store in parallel
for (final HColumnDescriptor family : htableDescriptor.getFamilies()) {
status.setStatus("Instantiating store for column family " + family);
completionService.submit(new Callable<HStore>() {
@Override
public HStore call() throws IOException {
return instantiateHStore(family);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment