BinaryBlobInserter(Bucket blob, ClientPutter parent, RequestClient clientContext, boolean tolerant, short prioClass, InsertContext ctx, ClientContext context) throws IOException, BinaryBlobFormatException { logMINOR = Logger.shouldLog(LogLevel.MINOR, this); this.ctx = ctx; this.maxRetries = ctx.maxInsertRetries; this.consecutiveRNFsCountAsSuccess = ctx.consecutiveRNFsCountAsSuccess; this.parent = parent; this.clientContext = clientContext; this.errors = new FailureCodeTracker(true); this.realTimeFlag = clientContext.realTimeFlag(); DataInputStream dis = new DataInputStream(blob.getInputStream()); BlockSet blocks = new SimpleBlockSet(); try { BinaryBlob.readBinaryBlob(dis, blocks, tolerant); } finally { dis.close(); } ArrayList<MySendableInsert> myInserters = new ArrayList<MySendableInsert>(); int x=0; for(Key key: blocks.keys()) { KeyBlock block = blocks.get(key); MySendableInsert inserter = new MySendableInsert(x++, block, prioClass, getScheduler(block, context), clientContext); myInserters.add(inserter); } inserters = myInserters.toArray(new MySendableInsert[myInserters.size()]); parent.addMustSucceedBlocks(inserters.length); parent.notifyClients(context); }
@Override public ClientKeyBlock get(ClientKey key) { KeyBlock block = get(key.getNodeKey(false)); if(block == null) return null; try { return Key.createKeyBlock(key, block); } catch (KeyVerifyException e) { Logger.error(this, "Caught decoding block with "+key+" : "+e, e); return null; } }
protected void processMainJarBlob(final File temp, final PeerNode source, final int version, FreenetURI uri) { SimpleBlockSet blocks = new SimpleBlockSet(); final String toString = source == null ? "(local)" : source.userToString();
SimpleBlockSet blocks = new SimpleBlockSet();
node.clientCore.makeClient((short)0, false, false); FetchContext ctx2 = client.getFetchContext(FILE_SIZE*2); SimpleBlockSet blocks = new SimpleBlockSet(); DataInputStream dis = new DataInputStream(blobBucket.getInputStream()); BinaryBlob.readBinaryBlob(dis, blocks, true);