private void start() throws FetchException { getter.start(clientContext); }
/** * Restart the request. * @param redirect Use this URI instead of the old one. * @param filterData * @param context The database. We must be on the database thread! See ClientContext for convenience * methods. * @return True if we successfully restarted, false if we can't restart. * @throws FetchException If something went wrong. */ public boolean restart(FreenetURI redirect, boolean filterData, ClientContext context) throws FetchException { ctx.filterData = filterData; return start(true, redirect, context); }
public void start(ClientContext context) throws FetchException { start(false, null, context); }
@Override public boolean run(ClientContext context) { try { getter.start(context); } catch (FetchException e) { getter.clientCallback.onFailure(e, getter); } return true; }
public void start() { boolean f; synchronized(this) { f = fetched; } if(f) cb.onSuccess(this); else { try { cg.start(context); } catch (FetchException e) { synchronized(this) { failed = true; } cb.onFailure(e, this); } } }
/** * Start a request. Schedule a job on the database thread if it is persistent, otherwise start it * immediately. * @param getter The request to start. * @throws FetchException If the request is transient and failed to start. * @throws DatabaseDisabledException If the request is persistent and the database is disabled. */ public void start(final ClientGetter getter) throws FetchException, PersistenceDisabledException { if(getter.persistent()) { jobRunner.queue(new PersistentJob() { @Override public boolean run(ClientContext context) { try { getter.start(context); } catch (FetchException e) { getter.clientCallback.onFailure(e, getter); } return true; } }, NativeThread.NORM_PRIORITY); } else { getter.start(this); } }
ClientGetter get = new ClientGetter(fw, uri, context, RequestStarter.INTERACTIVE_PRIORITY_CLASS, null, null, null); get.setMetaSnoop(new DumperSnoopMetadata()); get.start(n.clientCore.clientContext); FetchResult result = fw.waitForCompletion(); ClientMetadata cm = result.getMetadata();
get.start(context); } catch (FetchException e) { if(logMINOR) Logger.minor(this, "Prefetch failed: "+e, e);
if(finished) return; getter.start(context); if(persistence != Persistence.CONNECTION && !finished) { FCPMessage msg = persistentTagMessage();
/** * A non-authoritative hint that a specific edition *might* exist. At the moment, * we just fetch the block. We do not fetch the contents, and it is possible that * USKFetcher's are also fetching the block. FIXME would it be more efficient to * pass it along to a USKFetcher? * @param usk * @param edition * @param context */ public void hintUpdate(USK usk, long edition, ClientContext context) { if(edition < lookupLatestSlot(usk)) return; FreenetURI uri = usk.copy(edition).getURI().sskForUSK(); final ClientGetter get = new ClientGetter(new NullClientCallback(rcBulk), uri, new FetchContext(backgroundFetchContext, FetchContext.IDENTICAL_MASK), RequestStarter.UPDATE_PRIORITY_CLASS, new NullBucket(), null, null); try { get.start(context); } catch (FetchException e) { // Ignore } }
get.start(context); } catch (FetchException e) { if(logMINOR) Logger.minor(this, "Cannot start hint fetch for "+uri+" : "+e, e);
else { try { start(context); } catch (FetchException e1) { e = e1;
/** * A non-authoritative hint that a specific edition *might* exist. At the moment, * we just fetch the block. We do not fetch the contents, and it is possible that * USKFetcher's are also fetching the block. FIXME would it be more efficient to * pass it along to a USKFetcher? * @param context * @throws MalformedURLException If the uri passed in is not a USK. */ public void hintUpdate(FreenetURI uri, ClientContext context, short priority) throws MalformedURLException { if(uri.getSuggestedEdition() < lookupLatestSlot(USK.create(uri))) { if(logMINOR) Logger.minor(this, "Ignoring hint because edition is "+uri.getSuggestedEdition()+" but latest is "+lookupLatestSlot(USK.create(uri))); return; } uri = uri.sskForUSK(); if(logMINOR) Logger.minor(this, "Doing hint fetch for "+uri); final ClientGetter get = new ClientGetter(new NullClientCallback(rcBulk), uri, new FetchContext(backgroundFetchContext, FetchContext.IDENTICAL_MASK), priority, new NullBucket(), null, null); try { get.start(context); } catch (FetchException e) { if(logMINOR) Logger.minor(this, "Cannot start hint fetch for "+uri+" : "+e, e); // Ignore } }
BinaryBlobWriter bbw = new BinaryBlobWriter(blobBucket); ClientGetter getter = new ClientGetter(fw, uri, ctx, (short) 0, null, bbw, false, null, null); getter.start(node.clientCore.clientContext); fw.waitForCompletion(); assertTrue(blobBucket.size() > 0);