Package edu.umd.cloud9.io.map

Examples of edu.umd.cloud9.io.map.HMapIIW


      }
    }

    private HMapIIW readSamplesFromCache(String samplesFile, JobConf conf) throws IOException {
      Path[] localFiles = DistributedCache.getLocalCacheFiles(conf);
      HMapIIW samplesMap = null;
      for (Path localFile : localFiles) {
        if (localFile.toString().contains(samplesFile)) {
          samplesMap = new HMapIIW();
          LineReader reader = new LineReader(FileSystem.getLocal(conf).open(localFile));
          Text t = new Text();
          while (reader.readLine(t) != 0) {
            int docno = Integer.parseInt(t.toString());
            sLogger.info(docno + " --> sample");
            samplesMap.put(docno, 1);
          }
          reader.close();
          sLogger.info(samplesMap.size() + " sampled");
        }
      }
      if (samplesMap == null) throw new RuntimeException("Not found in local cache: " + samplesFile);
      return samplesMap;
    }
View Full Code Here


    super();
  }

  private static HMapIIW readSamplesFromCache(String samplesFile, JobConf conf) throws IOException {
    Path[] localFiles = DistributedCache.getLocalCacheFiles(conf);
    HMapIIW samplesMap = null;
    for (Path localFile : localFiles) {
      if (localFile.toString().contains(samplesFile)) {
        samplesMap = new HMapIIW();
        LineReader reader = new LineReader(FileSystem.getLocal(conf).open(localFile));
        Text t = new Text();
        while (reader.readLine(t) != 0) {
          int docno = Integer.parseInt(t.toString());
          sLogger.info(docno + " --> sample");
          samplesMap.put(docno, 1);
        }
        reader.close();
        sLogger.info(samplesMap.size() + " sampled");
      }
    }
    if (samplesMap == null) throw new RuntimeException("Not found in local cache: " + samplesFile);
    return samplesMap;
  }
View Full Code Here

    }

    private HMapIIW readSamplesFromCache(String samplesFile, JobConf conf) throws IOException {
      Path[] localFiles = DistributedCache.getLocalCacheFiles(conf);
      HMapIIW samplesMap = null;
      for (Path localFile : localFiles) {
        if (localFile.toString().contains(samplesFile)) {
          samplesMap = new HMapIIW();
          LineReader reader = new LineReader(FileSystem.getLocal(conf).open(localFile));
          Text t = new Text();
          while (reader.readLine(t) != 0) {
            int docno = Integer.parseInt(t.toString());
            sLogger.info(docno + " --> sample");
            samplesMap.put(docno, 1);
          }
          reader.close();
          sLogger.info(samplesMap.size() + " sampled");
        }
      }
      if (samplesMap == null) throw new RuntimeException("Not found in local cache: " + samplesFile);
      return samplesMap;
    }
View Full Code Here

      } catch (Exception e) {
        throw new RuntimeException("Error reading doc vectors!");
      }

      if (localFiles != null && localFiles.length > 0) {
        samplesMap = new HMapIIW();
        try {
          LineReader reader = new LineReader(FileSystem.getLocal(job).open(localFiles[0]));
          Text t = new Text();
          while (reader.readLine(t) != 0) {
            int docno = Integer.parseInt(t.toString());
View Full Code Here

      keyInt = new IntWritable();
      valText = new Text();

      sampleDocnosFile = job.get("SampleDocnosFile");
      if (sampleDocnosFile != null) {
        samplesMap = new HMapIIW();
        try {
          LineReader reader = new LineReader(FileSystem.get(job).open(new Path(sampleDocnosFile)));
          Text t = new Text();
          while (reader.readLine(t) != 0) {
            int docno = Integer.parseInt(t.toString());
View Full Code Here

        // TODO Auto-generated catch block
        e2.printStackTrace();
      }
      sampleDocnosFile = job.get("SampleDocnosFile");
      if (sampleDocnosFile != null) {
        samplesMap = new HMapIIW();
        try {
          LineReader reader = new LineReader(FileSystem.get(job).open(new Path(sampleDocnosFile)));
          Text t = new Text();
          while (reader.readLine(t) != 0) {
            int docno = Integer.parseInt(t.toString());
View Full Code Here

      keyText = new Text();
      valText = new Text();

      sampleDocnosFile = job.get("SampleDocnosFile");
      if (sampleDocnosFile != null) {
        samplesMap = new HMapIIW();
        try {
          LineReader reader = new LineReader(FileSystem.get(job).open(new Path(sampleDocnosFile)));
          Text t = new Text();
          while (reader.readLine(t) != 0) {
            String[] docnos = t.toString().split("\t");
View Full Code Here

      } catch (Exception e) {
        throw new RuntimeException("Error reading doc vectors!");
      }

      if (localFiles != null && localFiles.length > 0) {
        samplesMap = new HMapIIW();
        try {
          LineReader reader = new LineReader(FileSystem.get(conf).open(new Path(conf.get("Ivory.SampleFile"))));
          Text t = new Text();
          while (reader.readLine(t) != 0) {
            int docno = Integer.parseInt(t.toString());
View Full Code Here

      } catch (Exception e) {
        throw new RuntimeException("Error reading doc vectors!");
      }

      if (localFiles != null && localFiles.length > 0) {
        samplesMap = new HMapIIW();
        try {
          LineReader reader = new LineReader(FileSystem.getLocal(job).open(localFiles[0]));
          Text t = new Text();
          while (reader.readLine(t) != 0) {
            int docno = Integer.parseInt(t.toString());
View Full Code Here

      } catch (Exception e) {
        throw new RuntimeException("Error reading doc vectors!");
      }

      if (localFiles != null && localFiles.length > 0) {
        samplesMap = new HMapIIW();
        try {
          LineReader reader = new LineReader(FileSystem.getLocal(job).open(localFiles[0]));
          Text t = new Text();
          while (reader.readLine(t) != 0) {
            int docno = Integer.parseInt(t.toString());
View Full Code Here

TOP

Related Classes of edu.umd.cloud9.io.map.HMapIIW

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.