Package org.apache.accumulo.core.file.rfile.RFile

Examples of org.apache.accumulo.core.file.rfile.RFile.Reader


    for (String arg : commandLine.getArgs()) {
     
      Path path = new Path(arg);
      CachableBlockFile.Reader _rdr = new CachableBlockFile.Reader(fs, path, conf, null, null);
      Reader iter = new RFile.Reader(_rdr);
     
      iter.printInfo();
     
      if (doHistogram || dump) {
        iter.seek(new Range((Key) null, (Key) null), new ArrayList<ByteSequence>(), false);
        while (iter.hasTop()) {
          Key key = iter.getTopKey();
          Value value = iter.getTopValue();
          if (dump)
            System.out.println(key + " -> " + value);
          if (doHistogram) {
            long size = key.getSize() + value.getSize();
            int bucket = (int) Math.log10(size);
            countBuckets[bucket]++;
            sizeBuckets[bucket] += size;
            totalSize += size;
          }
          iter.next();
        }
      }
      iter.close();
      if (doHistogram) {
        System.out.println("Up to size      count      %-age");
        for (int i = 1; i < countBuckets.length; i++) {
          System.out.println(String.format("%11.0f : %10d %6.2f%%", Math.pow(10, i), countBuckets[i], sizeBuckets[i] * 100. / totalSize));
        }
View Full Code Here


    Path path = new Path(file);
    // long len = fs.getFileStatus(path).getLen();
    // FSDataInputStream in = fs.open(path);
    // Reader reader = new RFile.Reader(in, len , conf);
    CachableBlockFile.Reader _cbr = new CachableBlockFile.Reader(fs, path, conf, dataCache, indexCache);
    final Reader reader = new RFile.Reader(_cbr);
   
    return reader.getIndex();
  }
View Full Code Here

  public FileSKVIterator openReader(String file, boolean seekToBeginning, FileSystem fs, Configuration conf, AccumuloConfiguration acuconf,
      BlockCache dataCache, BlockCache indexCache) throws IOException {
    Path path = new Path(file);
   
    CachableBlockFile.Reader _cbr = new CachableBlockFile.Reader(fs, path, conf, dataCache, indexCache);
    Reader iter = new RFile.Reader(_cbr);
   
    if (seekToBeginning) {
      iter.seek(new Range((Key) null, null), EMPTY_CF_SET, false);
    }
   
    return iter;
  }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.file.rfile.RFile.Reader

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.