use of org.apollo.net.update.OnDemandRequestWorker in project apollo by apollo-rsps.
the class UpdateService method start.
@Override
public void start() {
int release = context.getRelease().getReleaseNumber();
try {
Path base = Paths.get("data/fs/", Integer.toString(release));
for (int i = 0; i < THREADS_PER_TYPE; i++) {
workers.add(new JagGrabRequestWorker(dispatcher, new IndexedFileSystem(base, true)));
workers.add(new OnDemandRequestWorker(dispatcher, new IndexedFileSystem(base, true)));
workers.add(new HttpRequestWorker(dispatcher, new IndexedFileSystem(base, true)));
}
} catch (FileNotFoundException reason) {
logger.log(Level.SEVERE, "Unable to find index or data files from the file system.", reason);
}
workers.forEach(service::submit);
}
Aggregations