/** * @return a list that contains all the archived index directories excluding the one * currently accepting updates. */ public List<Directory> getAllArchivedDirectories() { @SuppressWarnings("unchecked") List<Directory> emptyList = Collections.EMPTY_LIST; ArrayList<Directory> list = new ArrayList<Directory>(); List<File> dirs = getAllArchivedDirs(); if (dirs != null) { for (File dir : dirs) { try { list.add(getFSDirectoryFromFile(dir)); } catch (IOException e) { log.error("potential index corruption: " + dir, e); } } } if (list.size() == 0) return emptyList; return list; }
public long getSizeBytes() { return _dirMgrFactory.getDiskIndexSizeBytes(); }
_scheduler = _dirMgrFactory.getScheduler(); _dirMgrFactory.clearRecentlyChanged(); _interpreter = interpreter; _decorator = readerDecorator; List<ZoieMultiReader<R>> archives; List<ZoieSystem<R, D>> archiveZoies; if (_dirMgrFactory.getScheduler().isAppendOnly()) { archives = loadArchives(); archiveZoies = Collections.emptyList(); _currentVersion = _dirMgrFactory.getArchivedVersion(); _currentZoie = _readerMgr.retireAndNew(null); _currentZoie.start();
protected List<ZoieSystem<R, D>> loadArchiveZoies() { List<ZoieSystem<R, D>> archives = new ArrayList<ZoieSystem<R, D>>(); long t0 = System.currentTimeMillis(); List<File> dirs = _dirMgrFactory.getAllArchivedDirs(); for (File dir : dirs) { try { DirectoryManager dirMgr = new DefaultDirectoryManager(dir, _dirMgrFactory.getMode()); ZoieSystem<R, D> zoie = new ZoieSystem<R, D>(dirMgr, _interpreter, _decorator, _zConfig); zoie.start(); archives.add(zoie); } catch (Exception e) { log.error("Load index: " + dir + " failed.", e); } } log.info("load " + dirs.size() + " archived indices of " + getSizeBytes() + " bytes in " + (System.currentTimeMillis() - t0) + "ms"); return archives; }
public synchronized ZoieSystem<R, D> retireAndNew(final ZoieSystem<R, D> old) { DirectoryManager _dirMgr = _dirMgrFactory.getDirectoryManager(); _dirMgrFactory.clearRecentlyChanged(); ZoieSystem<R, D> newzoie = hg.createZoie(_dirMgr); List<ZoieSystem<R, D>> actives = new LinkedList<ZoieSystem<R, D>>(box._actives); List<ZoieSystem<R, D>> retiring = new LinkedList<ZoieSystem<R, D>>(box._retiree); if (old != null) { actives.remove(old); retiring.add(old); retireThreadPool.execute(new Runnable() { @Override public void run() { if (listener != null) { listener.onRetiredZoie(old); } retire(old); } }); } actives.add(newzoie); Box<R, D> newbox = new Box<R, D>(box._archives, box._archiveZoies, retiring, actives, _decorator); box = newbox; if (listener != null) { listener.onNewZoie(newzoie); } return newzoie; }
Calendar time = null; try { time = getCalendarTime(name); } catch (ParseException e) { log.warn("potential index corruption. we skip folder: " + name, e);
protected List<ZoieMultiReader<R>> loadArchives() { List<ZoieMultiReader<R>> archives = new ArrayList<ZoieMultiReader<R>>(); long t0 = System.currentTimeMillis(); List<Directory> dirs = _dirMgrFactory.getAllArchivedDirectories(); for (Directory dir : dirs) { DirectoryReader reader; try { reader = DirectoryReader.open(dir); ZoieMultiReader<R> zoiereader = new ZoieMultiReader<R>(reader, _decorator); // Initialize docIdMapper DocIDMapper mapper = _zConfig.getDocidMapperFactory().getDocIDMapper(zoiereader); zoiereader.setDocIDMapper(mapper); archives.add(zoiereader); } catch (CorruptIndexException e) { log.error("corruptedIndex", e); } catch (IOException e) { log.error("IOException", e); } } log.info("load " + dirs.size() + " archived indices of " + getSizeBytes() + " bytes in " + (System.currentTimeMillis() - t0) + "ms"); return archives; }
long time = dateFormatter.get().parse(name).getTime(); if (!file.equals(_location)) { // don't count the current one IndexSignature sig = getIndexSignature(file); if (sig != null) { if (sig.getVersion() != null) {
_scheduler = _dirMgrFactory.getScheduler(); _dirMgrFactory.clearRecentlyChanged(); _interpreter = interpreter; _decorator = readerDecorator; List<ZoieMultiReader<R>> archives; List<ZoieSystem<R, D>> archiveZoies; if (_dirMgrFactory.getScheduler().isAppendOnly()) { archives = loadArchives(); archiveZoies = Collections.emptyList(); _currentVersion = _dirMgrFactory.getArchivedVersion(); _currentZoie = _readerMgr.retireAndNew(null); _currentZoie.start();
protected List<ZoieSystem<R, D>> loadArchiveZoies() { List<ZoieSystem<R, D>> archives = new ArrayList<ZoieSystem<R, D>>(); long t0 = System.currentTimeMillis(); List<File> dirs = _dirMgrFactory.getAllArchivedDirs(); for (File dir : dirs) { try { DirectoryManager dirMgr = new DefaultDirectoryManager(dir, _dirMgrFactory.getMode()); ZoieSystem<R, D> zoie = new ZoieSystem<R, D>(dirMgr, _interpreter, _decorator, _zConfig); zoie.start(); archives.add(zoie); } catch (Exception e) { log.error("Load index: " + dir + " failed.", e); } } log.info("load " + dirs.size() + " archived indices of " + getSizeBytes() + " bytes in " + (System.currentTimeMillis() - t0) + "ms"); return archives; }
public synchronized ZoieSystem<R, D> retireAndNew(final ZoieSystem<R, D> old) { DirectoryManager _dirMgr = _dirMgrFactory.getDirectoryManager(); _dirMgrFactory.clearRecentlyChanged(); ZoieSystem<R, D> newzoie = hg.createZoie(_dirMgr); List<ZoieSystem<R, D>> actives = new LinkedList<ZoieSystem<R, D>>(box._actives); List<ZoieSystem<R, D>> retiring = new LinkedList<ZoieSystem<R, D>>(box._retiree); if (old != null) { actives.remove(old); retiring.add(old); retireThreadPool.execute(new Runnable() { @Override public void run() { if (listener != null) { listener.onRetiredZoie(old); } retire(old); } }); } actives.add(newzoie); Box<R, D> newbox = new Box<R, D>(box._archives, box._archiveZoies, retiring, actives, _decorator); box = newbox; if (listener != null) { listener.onNewZoie(newzoie); } return newzoie; }
Calendar time = null; try { time = getCalendarTime(name); } catch (ParseException e) { log.warn("potential index corruption. we skip folder: " + name, e);
protected List<ZoieMultiReader<R>> loadArchives() { List<ZoieMultiReader<R>> archives = new ArrayList<ZoieMultiReader<R>>(); long t0 = System.currentTimeMillis(); List<Directory> dirs = _dirMgrFactory.getAllArchivedDirectories(); for (Directory dir : dirs) { DirectoryReader reader; try { reader = DirectoryReader.open(dir); ZoieMultiReader<R> zoiereader = new ZoieMultiReader<R>(reader, _decorator); // Initialize docIdMapper DocIDMapper mapper = _zConfig.getDocidMapperFactory().getDocIDMapper(zoiereader); zoiereader.setDocIDMapper(mapper); archives.add(zoiereader); } catch (CorruptIndexException e) { log.error("corruptedIndex", e); } catch (IOException e) { log.error("IOException", e); } } log.info("load " + dirs.size() + " archived indices of " + getSizeBytes() + " bytes in " + (System.currentTimeMillis() - t0) + "ms"); return archives; }
long time = dateFormatter.get().parse(name).getTime(); if (!file.equals(_location)) { // don't count the current one IndexSignature sig = getIndexSignature(file); if (sig != null) { if (sig.getVersion() != null) {
_scheduler = _dirMgrFactory.getScheduler(); _dirMgrFactory.clearRecentlyChanged(); _interpreter = interpreter; _decorator = readerDecorator; List<ZoieIndexReader<R>> archives; List<ZoieSystem<R, D>> archiveZoies; if (_dirMgrFactory.getScheduler().isAppendOnly()) archiveZoies, hourglassListeners); _currentVersion = _dirMgrFactory.getArchivedVersion(); _currentZoie = _readerMgr.retireAndNew(null); _currentZoie.start();
protected List<ZoieSystem<R, D>> loadArchiveZoies() { List<ZoieSystem<R, D>> archives = new ArrayList<ZoieSystem<R, D>>(); long t0 = System.currentTimeMillis(); List<File> dirs = _dirMgrFactory.getAllArchivedDirs(); for(File dir : dirs) { IndexReader reader; try { DirectoryManager dirMgr = new DefaultDirectoryManager(dir, _dirMgrFactory.getMode()); ZoieSystem<R, D> zoie = new ZoieSystem<R, D>(dirMgr, _interpreter, _decorator, _zConfig); zoie.start(); archives.add(zoie); } catch (Exception e) { log.error("Load index: " + dir + " failed.", e); } } log.info("load "+dirs.size()+" archived indices of " + getSizeBytes() +" bytes in " + (System.currentTimeMillis() - t0) + "ms"); return archives; }
/** * @return a list that contains all the archived index directories excluding the one * currently accepting updates. */ public List<Directory> getAllArchivedDirectories() { @SuppressWarnings("unchecked") List<Directory> emptyList = Collections.EMPTY_LIST; ArrayList<Directory> list = new ArrayList<Directory>(); List<File> dirs = getAllArchivedDirs(); if (dirs != null) { for (File dir : dirs) { try { list.add(getFSDirectoryFromFile(dir)); } catch (IOException e) { log.error("potential index corruption: " + dir, e); } } } if (list.size() == 0) return emptyList; return list; }
public synchronized ZoieSystem<R, D> retireAndNew(final ZoieSystem<R, D> old) DirectoryManager _dirMgr = _dirMgrFactory.getDirectoryManager(); _dirMgrFactory.clearRecentlyChanged(); ZoieSystem<R, D> newzoie = hg.createZoie(_dirMgr); List<ZoieSystem<R, D>> actives = new LinkedList<ZoieSystem<R, D>>(box._actives);
try time = getCalendarTime(name);
public long getSizeBytes() { return _dirMgrFactory.getDiskIndexSizeBytes(); }