public void onFailure(MyKey key, FetchException fe) { if(logMINOR) Logger.minor(this, "Failure: "+fe.mode+" for block "+key.blockNumber+" for "+key.segmentNumber); synchronized(this) { if(cancelled || finishedFetcher) return; dirtyGeneralProgress = true; } errors.inc(fe.getMode()); SplitFileFetcherSegmentStorage segment = segments[key.segmentNumber]; segment.onNonFatalFailure(key.blockNumber); lazyWriteMetadata(); }
SplitFileFetcherSegmentStorage segment = storage.segments[0]; for(int i=0;i<test.dataBlocks.length;i++) { segment.onNonFatalFailure(i); segment.onNonFatalFailure(i+test.dataBlocks.length);
storage.onNonFatalFailure(i);
private void testDataBlocksOnly(TestSplitfile test) throws IOException, CHKEncodeException, FetchException, MetadataParseException { StorageCallback cb = test.createStorageCallback(); SplitFileFetcherStorage storage = test.createStorage(cb); SplitFileFetcherSegmentStorage segment = storage.segments[0]; for(int i=0;i<test.checkBlocks.length;i++) { segment.onNonFatalFailure(test.dataBlocks.length+i); } for(int i=0;i<test.dataBlocks.length;i++) { assertFalse(segment.hasStartedDecode()); assertTrue(segment.onGotKey(test.dataKeys[i].getNodeCHK(), test.encodeDataBlock(i))); cb.markDownloadedBlock(i); } cb.checkFailed(); assertTrue(segment.hasStartedDecode()); cb.checkFailed(); waitForDecode(segment); cb.checkFailed(); cb.waitForFinished(); cb.checkFailed(); test.verifyOutput(storage); cb.checkFailed(); storage.finishedFetcher(); cb.checkFailed(); waitForFinished(segment); cb.checkFailed(); cb.waitForFree(storage); cb.checkFailed(); }
int total = test.dataBlocks.length+test.checkBlocks.length; for(int i=0;i<total;i++) segment.onNonFatalFailure(i); // We want healing on all blocks that aren't found. boolean[] hits = new boolean[total]; for(int i=0;i<test.dataBlocks.length;i++) {
for(SplitFileFetcherSegmentStorage segment : storage.segments) { for(int i=0;i<segment.totalBlocks();i++) segment.onNonFatalFailure(i); // We want healing on all blocks that aren't found.
int total = test.dataBlocks.length+test.checkBlocks.length; for(int i=0;i<total;i++) segment.onNonFatalFailure(i); // We want healing on all blocks that aren't found. boolean[] hits = new boolean[total]; for(int i=0;i<test.dataBlocks.length;i++) {
int total = test.dataBlocks.length+test.checkBlocks.length; for(int i=0;i<total;i++) segment.onNonFatalFailure(i); // We want healing on all blocks that aren't found. boolean[] hits = new boolean[total]; for(int i=0;i<test.dataBlocks.length;i++) {