Load water marks from an underlying file.

@param waterMarksFile
@throws IOException
776827
protected void loadWaterMarks(File waterMarksFile) throws IOException {
        Properties p = new Properties();
        FileInputStream fis = new FileInputStream(waterMarksFile);

        logger.info("Loading " + waterMarksFile);

        try {
            p.load(fis);

            Enumeration<?> enm = p.propertyNames();
            while (enm.hasMoreElements()) {
                String source = (String) enm.nextElement();
                String waterMarks = p.getProperty(source);
                String[] parts = waterMarks.split(",");
                if (parts.length == 2) {
                    long lwmScn = Long.parseLong(parts[0].trim());
                    long hwmScn = Long.parseLong(parts[1].trim());
                    
                    // Make sure that hwmScn and lwmScn are always equal when loaded
                    if (hwmScn < lwmScn) {
                        lwmScn = hwmScn;
                    } else {
                        hwmScn = lwmScn;
                    }
                    
                    WaterMarkEntry wmEntry = sourceWaterMarkMap.get(source);
                    if (wmEntry == null) {
                        wmEntry = new WaterMarkEntry(source);
                        sourceWaterMarkMap.put(source, wmEntry);
                    }
                    
                    wmEntry.setLWMScn(lwmScn);
                    wmEntry.setHWMScn(hwmScn);
                }
            }
        } catch (IOException e) {
            logger.error("Failed to load source water marks from " + waterMarksFile.getName(), e);
            throw e;
        } finally {
            fis.close();
            fis = null;
        }
    }
193333
public final void load(final String filename) {
        logger.debug("Loading the cache from places file: " + filename);
        try (
            InputStream fis = new FileInputStream(filename);
        ) {
            load(fis);
        } catch (IOException e) {
            logger.error("Problem reading places file", e);
        }
    }
375521
public static Properties load(File file) throws IOException {
        if (file.isFile()) {
            return load(file.toURI().toURL());
        }
        return new Properties();
    }
1323463
protected void loadProperties(String filename) {
		ClassLoader thclassLoader = Thread.currentThread().getContextClassLoader();
		if (thclassLoader != null){
			URL url = thclassLoader.getResource(filename);
			if (url != null){
				try {
					this.setXMLProperties(url.openStream(), null);
				} catch (Exception e) {
					// do nothing
				} 
			}
		}
	}
847710
public void flush() throws IOException {
        checkMutable();
        long startTime = System.currentTimeMillis();
        channel.force(true);
        long elapsedTime = System.currentTimeMillis() - startTime;
        LogFlushStats.recordFlushRequest(elapsedTime);
        logger.debug("flush time " + elapsedTime);
        setHighWaterMark.set(getSizeInBytes());
        logger.debug("flush high water mark:" + highWaterMark());
    }
949267
public static Properties load(File file) throws IOException {
        if (file.isFile()) {
            FileInputStream fis = null;
            try {
                Properties headers = new Properties();
                fis = new FileInputStream(file);
                headers.load(fis);
                return headers;
            } finally {
                IOUtils.closeQuietly(fis);
            }
        }
        return new Properties();
    }
133115
public void loadFile(File file, String resourcePath) throws IOException {
	loadFile(ResourceUtil.toResource(file), resourcePath);
    }
996202
public void loadFromFileWithPath(String file, LabelAlphabet alphabet) throws IOException {
		File f = new File(file);
		FileInputStream in = new FileInputStream(f);
		BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
		String line;
		while((line=reader.readLine())!=null){
			String[] tok = line.split(" ");
			for(int i=0;i<tok.length-1;i++){
				addEdge(alphabet.lookupIndex(tok[i]),alphabet.lookupIndex(tok[i+1]));
			}
		}
		travel();
		
	}
368341
private void load() throws IOException
   {
      if (PrivilegedFileHelper.exists(storage))
      {
         InputStream in = PrivilegedFileHelper.fileInputStream(storage);
         try
         {
            Properties props = new Properties();
            log.debug("loading namespace mappings...");
            props.load(in);

            // read mappings from properties
            Iterator<Object> iter = props.keySet().iterator();
            while (iter.hasNext())
            {
               String prefix = (String)iter.next();
               String uri = props.getProperty(prefix);
               log.debug(prefix + " -> " + uri);
               prefixToURI.put(prefix, uri);
               uriToPrefix.put(uri, prefix);
            }
            prefixCount = props.size();
            log.debug("namespace mappings loaded.");
         }
         finally
         {
            in.close();
         }
      }
   }
1118076
public void load() throws IOException {
        logRecorders.clear();
        File dir = configDir();
        File[] files = dir.listFiles((FileFilter)new WildcardFileFilter("*.xml"));
        if(files==null)     return;
        for (File child : files) {
            String name = child.getName();
            name = name.substring(0,name.length()-4);   // cut off ".xml"
            LogRecorder lr = new LogRecorder(name);
            lr.load();
            logRecorders.put(name,lr);
        }
    }
92115
public void track(AcknowledgableWatermark acknowledgableWatermark) {
    if (!_started.get() && _autoStart) {
      start();
    }
    maybeAbort();
    String source = acknowledgableWatermark.getCheckpointableWatermark().getSource();
    Deque<AcknowledgableWatermark> sourceWatermarks = _watermarksMap.get(source);
    if (sourceWatermarks == null) {
      sourceWatermarks = new ConcurrentLinkedDeque<>();
      _watermarksMap.put(source, sourceWatermarks);
    }
    sourceWatermarks.add(acknowledgableWatermark);
    _watermarksInserted.mark();
  }
754001
public void loadPath(String path, String suffix)
			throws IOException {
		List<File> files = MyFiles.getAllFiles(path, suffix);
		for(File f:files){
			load(f.toString());
		}
		
	}
439387
public boolean syncWaterMarks() {
        // Sync up low water marks
        for (String source : sourceWaterMarkMap.keySet()) {
            WaterMarkEntry wmEntry = sourceWaterMarkMap.get(source);
            wmEntry.setLWMScn(wmEntry.getHWMScn());
        }
        
        return flush();
    }
69681
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();
			}
		}
	}
980613
public void load(String filename, String separator) throws IOException, PropertiesException {
		load(new File(filename), separator);
	}
766037
@Override
  public void reset () throws IOException
  {
    _ensureOpen ();
    if (m_nMarkedChar < 0)
      throw new IOException (m_nMarkedChar == INVALIDATED ? "Mark invalid" : "Stream not marked");
    m_nNextCharIndex = m_nMarkedChar;
    m_bSkipLF = m_bMarkedSkipLF;
  }
964418
public void setWaterMarks(String source, long lwmScn, long hwmScn) {
        WaterMarkEntry e = sourceWaterMarkMap.get(source);
        if (e == null) {
            e = new WaterMarkEntry(source);
            sourceWaterMarkMap.put(source, e);
        }
        e.setLWMScn(lwmScn);
        e.setHWMScn(hwmScn);
    }