Example #1
0
 public USKManager(NodeClientCore core) {
   HighLevelSimpleClient client =
       core.makeClient(RequestStarter.UPDATE_PRIORITY_CLASS, false, false);
   client.setMaxIntermediateLength(FProxyToadlet.MAX_LENGTH_NO_PROGRESS);
   client.setMaxLength(FProxyToadlet.MAX_LENGTH_NO_PROGRESS);
   backgroundFetchContext = client.getFetchContext();
   backgroundFetchContext.followRedirects = false;
   backgroundFetchContextIgnoreDBR = backgroundFetchContext.clone();
   backgroundFetchContextIgnoreDBR.ignoreUSKDatehints = true;
   realFetchContext = client.getFetchContext();
   // Performance: I'm pretty sure there is no spatial locality in the underlying data, so it's
   // okay to use the FAST_COMPARATOR here.
   // That is, even if two USKs are by the same author, they won't necessarily be updated or polled
   // at the same time.
   latestKnownGoodByClearUSK = new TreeMap<USK, Long>(USK.FAST_COMPARATOR);
   latestSlotByClearUSK = new TreeMap<USK, Long>(USK.FAST_COMPARATOR);
   subscribersByClearUSK = new TreeMap<USK, USKCallback[]>(USK.FAST_COMPARATOR);
   backgroundFetchersByClearUSK = new TreeMap<USK, USKFetcher>(USK.FAST_COMPARATOR);
   temporaryBackgroundFetchersLRU = LRUMap.createSafeMap(USK.FAST_COMPARATOR);
   temporaryBackgroundFetchersPrefetch = new WeakHashMap<USK, Long>();
   executor = core.getExecutor();
 }