for (JournalAndStream jas : log.getJournals()) { final Map<String, String> jasMap = new HashMap<String, String>(); String manager = jas.getManager().toString();
for (JournalAndStream jas : log.getJournals()) { final Map<String, String> jasMap = new HashMap<String, String>(); String manager = jas.getManager().toString();
for (JournalAndStream jas : log.getJournals()) { final Map<String, String> jasMap = new HashMap<String, String>(); String manager = jas.getManager().toString();
/** * Pull out one of the JournalAndStream objects from the edit log. */ private JournalAndStream getJournalAndStream(int index) { FSImage fsimage = cluster.getNamesystem().getFSImage(); FSEditLog editLog = fsimage.getEditLog(); return editLog.getJournals().get(index); }
/** * invalidate storage by removing the second and third storage directories */ public void invalidateStorage(FSImage fi, Set<File> filesToInvalidate) throws IOException { ArrayList<StorageDirectory> al = new ArrayList<StorageDirectory>(2); Iterator<StorageDirectory> it = fi.getStorage().dirIterator(); while(it.hasNext()) { StorageDirectory sd = it.next(); if(filesToInvalidate.contains(sd.getRoot())) { LOG.info("causing IO error on " + sd.getRoot()); al.add(sd); } } // simulate an error fi.getStorage().reportErrorsOnDirectories(al); for (JournalAndStream j : fi.getEditLog().getJournals()) { if (j.getManager() instanceof FileJournalManager) { FileJournalManager fm = (FileJournalManager)j.getManager(); if (fm.getStorageDirectory().getRoot().equals(path2) || fm.getStorageDirectory().getRoot().equals(path3)) { EditLogOutputStream mockStream = spy(j.getCurrentStream()); j.setCurrentStreamForTests(mockStream); doThrow(new IOException("Injected fault: write")). when(mockStream).write(Mockito.<FSEditLogOp>anyObject()); } } } }
&& aborts.get(0).roll == (i+1)) { AbortSpec spec = aborts.remove(0); editlog.getJournals().get(spec.logindex).abort();
FSEditLog editLog = fsimage.getEditLog(); JournalAndStream jas = editLog.getJournals().get(0); EditLogFileOutputStream spyElos = spy((EditLogFileOutputStream)jas.getCurrentStream());