public void closeFileFactory(String filename) throws IOException { if (fileFactoryMap == null) { return; } SeekableLineReaderFactory factory = fileFactoryMap.remove(filename); if (factory != null) { factory.close(); } }
public SeekableLineReader getSLR() throws IOException { return factory.get(); }
public void reloadFactory() { try { this.factory.reload(); } catch (IOException e) { LOGGER.warning(e.toString()); } }
public void loadParamFile() throws IOException { SeekableLineReaderFactory fact = null; SeekableLineReaderIterator iter = null; try { fact = GeneralURIStreamFactory.createSeekableStreamFactory( paramFile, false); iter = new SeekableLineReaderIterator(fact.get()); paramSet = new HashSet<String>(); while (iter.hasNext()) { String param = iter.next(); param = param.trim(); if (param.isEmpty() || param.startsWith("#")) { continue; } // Use only the first word, ignore the rest int wordEnd = param.indexOf(delim); if (wordEnd > 0) { param = param.substring(0, wordEnd); } paramSet.add(param); } } finally { if (iter != null) { iter.close(); } if (fact != null) { fact.close(); } } }
@Override public void run() { try { while (true) { long currModTime = locReaderFactory.getModTime(); if (currModTime != lastModTime) { syncLoad(currModTime); Thread.sleep(checkInterval); if (summary != null) { summary.reloadFactory(); } } Thread.sleep(checkInterval); } } catch (InterruptedException ie) { } } }
public void loadParamFile() throws IOException { SeekableLineReaderFactory fact = null; SeekableLineReaderIterator iter = null; try { fact = GeneralURIStreamFactory.createSeekableStreamFactory( paramFile, false); iter = new SeekableLineReaderIterator(fact.get()); paramSet = new HashSet<String>(); while (iter.hasNext()) { String param = iter.next(); param = param.trim(); if (param.isEmpty() || param.startsWith("#")) { continue; } // Use only the first word, ignore the rest int wordEnd = param.indexOf(delim); if (wordEnd > 0) { param = param.substring(0, wordEnd); } paramSet.add(param); } } finally { if (iter != null) { iter.close(); } if (fact != null) { fact.close(); } } }
@Override public void run() { try { while (true) { long currModTime = locReaderFactory.getModTime(); if (currModTime != lastModTime) { syncLoad(currModTime); Thread.sleep(checkInterval); if (summary != null) { summary.reloadFactory(); } } Thread.sleep(checkInterval); } } catch (InterruptedException ie) { } } }
public SeekableLineReader getSLR() throws IOException { return factory.get(); }
public void closeFileFactory(String filename) throws IOException { if (fileFactoryMap == null) { return; } SeekableLineReaderFactory factory = fileFactoryMap.remove(filename); if (factory != null) { factory.close(); } }
@Override public void run() { try { while (true) { long currModTime = locReaderFactory.getModTime(); if (currModTime != lastModTime) { syncLoad(currModTime); Thread.sleep(checkInterval); if (summary != null) { summary.reloadFactory(); } } Thread.sleep(checkInterval); } } catch (InterruptedException ie) { } } }
public void reloadFactory() { try { this.factory.reload(); } catch (IOException e) { LOGGER.warning(e.toString()); } }
public SeekableLineReader getSLR() throws IOException { return factory.get(); }
public void closeFileFactory(String filename) throws IOException { if (fileFactoryMap == null) { return; } SeekableLineReaderFactory factory = fileFactoryMap.remove(filename); if (factory != null) { factory.close(); } }
lastModTime = locReaderFactory.getModTime();
public void reloadFactory() { try { this.factory.reload(); } catch (IOException e) { LOGGER.warning(e.toString()); } }
protected SeekableLineReader getFileReader(String filename) throws IOException { if (fileFactoryMap == null) { fileFactoryMap = new HashMap<String, SeekableLineReaderFactory>(); fileFactoryMap = Collections.synchronizedMap(fileFactoryMap); } SeekableLineReaderFactory factory = fileFactoryMap.get(filename); if (factory == null) { factory = GeneralURIStreamFactory.createSeekableStreamFactory(filename, useNio); fileFactoryMap.put(filename, factory); } SeekableLineReader reader = factory.get(); reader.setBufferFully(bufferFully); return reader; }
public void close() throws IOException { if (fileFactoryMap != null) { for (SeekableLineReaderFactory factory : fileFactoryMap.values()) { factory.close(); } fileFactoryMap = null; } if (httpFactory != null) { httpFactory.close(); httpFactory = null; } }
lastModTime = locReaderFactory.getModTime();
protected SeekableLineReader getFileReader(String filename) throws IOException { if (fileFactoryMap == null) { fileFactoryMap = new HashMap<String, SeekableLineReaderFactory>(); fileFactoryMap = Collections.synchronizedMap(fileFactoryMap); } SeekableLineReaderFactory factory = fileFactoryMap.get(filename); if (factory == null) { factory = GeneralURIStreamFactory.createSeekableStreamFactory(filename, useNio); fileFactoryMap.put(filename, factory); } SeekableLineReader reader = factory.get(); reader.setBufferFully(bufferFully); return reader; }
public void close() throws IOException { if (fileFactoryMap != null) { for (SeekableLineReaderFactory factory : fileFactoryMap.values()) { factory.close(); } fileFactoryMap = null; } if (httpFactory != null) { httpFactory.close(); httpFactory = null; } }