private void complete(InsertException e, ClientContext context) { synchronized(this) { if(finished) return; finished = true; if(e != null && this.e != null && this.e != e) { if(e.getMode() == InsertExceptionMode.CANCELLED) { // Cancelled is okay, ignore it, we cancel after failure sometimes. // Ignore the new failure mode, use the old one e = this.e; if(persistent) { e = e.clone(); // Since we will remove it, we can't pass it on } } else { // Delete the old failure mode, use the new one this.e = e; } } if(e == null) { e = this.e; if(persistent && e != null) { e = e.clone(); // Since we will remove it, we can't pass it on } } } if(e != null) cb.onFailure(e, this, context); else cb.onSuccess(this, context); }
@Override public boolean run(ClientContext context) { if(logMINOR) Logger.minor(this, "Succeeding on "+SplitFileInserter.this); unregisterSender(); if(!(ctx.earlyEncode || ctx.getCHKOnly)) { reportMetadata(metadata); } cb.onSuccess(SplitFileInserter.this, context); raf.close(); raf.free(); originalData.close(); if(freeData) originalData.free(); return true; }
cb.onSuccess(this, context);
if(shouldSendKey) cb.onEncode(key, this, context); // In case of race conditions etc, especially for LocalRequestOnly. cb.onSuccess(this, context);
private void insertSucceeded(ClientContext context, long edition) { if(ctx.ignoreUSKDatehints) { if(logMINOR) Logger.minor(this, "Inserted to edition "+edition); cb.onSuccess(this, context); return;