Package org.apache.accumulo.trace.instrument

Examples of org.apache.accumulo.trace.instrument.Span


    }
  }
 
  @Override
  public FileStatus[] listStatus(Path[] files) throws IOException {
    Span span = Trace.start("listStatus");
    try {
      return impl.listStatus(files);
    } finally {
      span.stop();
    }
  }
View Full Code Here


    }
  }
 
  @Override
  public FileStatus[] listStatus(Path[] files, PathFilter filter) throws IOException {
    Span span = Trace.start("listStatus");
    try {
      return impl.listStatus(files, filter);
    } finally {
      span.stop();
    }
  }
View Full Code Here

  }
 
  private void compactLocalityGroup(String lgName, Set<ByteSequence> columnFamilies, boolean inclusive, FileSKVWriter mfw, CompactionStats majCStats)
      throws IOException, CompactionCanceledException {
    ArrayList<FileSKVIterator> readers = new ArrayList<FileSKVIterator>(filesToCompact.size());
    Span span = Trace.start("compact");
    try {
      long entriesCompacted = 0;
      List<SortedKeyValueIterator<Key,Value>> iters = openMapDataFiles(lgName, readers);
     
      if (imm != null) {
        iters.add(imm.compactionIterator());
      }
     
      CountingIterator citr = new CountingIterator(new MultiIterator(iters, extent.toDataRange()));
      DeletingIterator delIter = new DeletingIterator(citr, propogateDeletes);
      ColumnFamilySkippingIterator cfsi = new ColumnFamilySkippingIterator(delIter);
     

      // if(env.getIteratorScope() )
     
      TabletIteratorEnvironment iterEnv;
      if (env.getIteratorScope() == IteratorScope.majc)
        iterEnv = new TabletIteratorEnvironment(IteratorScope.majc, !propogateDeletes, acuTableConf);
      else if (env.getIteratorScope() == IteratorScope.minc)
        iterEnv = new TabletIteratorEnvironment(IteratorScope.minc, acuTableConf);
      else
        throw new IllegalArgumentException();
     
      SortedKeyValueIterator<Key,Value> itr = iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(env.getIteratorScope(), cfsi, extent, acuTableConf,
          iterators, iterEnv));
     
      itr.seek(extent.toDataRange(), columnFamilies, inclusive);
     
      if (!inclusive) {
        mfw.startDefaultLocalityGroup();
      } else {
        mfw.startNewLocalityGroup(lgName, columnFamilies);
      }
     
      Span write = Trace.start("write");
      try {
        while (itr.hasTop() && env.isCompactionEnabled()) {
          mfw.append(itr.getTopKey(), itr.getTopValue());
          itr.next();
          entriesCompacted++;
         
          if (entriesCompacted % 1024 == 0) {
            // Periodically update stats, do not want to do this too often since its volatile
            entriesWritten.addAndGet(1024);
          }
        }

        if (itr.hasTop() && !env.isCompactionEnabled()) {
          // cancel major compaction operation
          try {
            try {
              mfw.close();
            } catch (IOException e) {
              log.error(e, e);
            }
            fs.delete(new Path(outputFile), true);
          } catch (Exception e) {
            log.warn("Failed to delete Canceled compaction output file " + outputFile, e);
          }
          throw new CompactionCanceledException();
        }
       
      } finally {
        CompactionStats lgMajcStats = new CompactionStats(citr.getCount(), entriesCompacted);
        majCStats.add(lgMajcStats);
        write.stop();
      }
     
    } finally {
      // close sequence files opened
      for (FileSKVIterator reader : readers) {
View Full Code Here

    }
  }
 
  @Override
  public FileStatus[] globStatus(Path pathPattern) throws IOException {
    Span span = Trace.start("globStatus");
    if (Trace.isTracing())
      span.data("pattern", pathPattern.toString());
    try {
      return impl.globStatus(pathPattern);
    } finally {
      span.stop();
    }
  }
View Full Code Here

    }
  }
 
  @Override
  public FileStatus[] globStatus(Path pathPattern, PathFilter filter) throws IOException {
    Span span = Trace.start("globStatus");
    if (Trace.isTracing())
      span.data("pattern", pathPattern.toString());
    try {
      return impl.globStatus(pathPattern, filter);
    } finally {
      span.stop();
    }
  }
View Full Code Here

    }
  }
 
  @Override
  public Path getHomeDirectory() {
    Span span = Trace.start("getHomeDirectory");
    try {
      return impl.getHomeDirectory();
    } finally {
      span.stop();
    }
  }
View Full Code Here

    }
  }
 
  @Override
  public boolean mkdirs(Path f) throws IOException {
    Span span = Trace.start("mkdirs");
    if (Trace.isTracing())
      span.data("path", f.toString());
    try {
      return impl.mkdirs(f);
    } finally {
      span.stop();
    }
  }
View Full Code Here

    }
  }
 
  @Override
  public void copyFromLocalFile(Path src, Path dst) throws IOException {
    Span span = Trace.start("copyFromLocalFile");
    if (Trace.isTracing()) {
      span.data("src", src.toString());
      span.data("dst", dst.toString());
    }
    try {
      impl.copyFromLocalFile(src, dst);
    } finally {
      span.stop();
    }
  }
View Full Code Here

    }
  }
 
  @Override
  public void moveFromLocalFile(Path[] srcs, Path dst) throws IOException {
    Span span = Trace.start("moveFromLocalFile");
    if (Trace.isTracing()) {
      span.data("dst", dst.toString());
    }
    try {
      impl.moveFromLocalFile(srcs, dst);
    } finally {
      span.stop();
    }
  }
View Full Code Here

  }
 
  static class Service implements TestService.Iface {
    @Override
    public boolean checkTrace(TInfo t, String message) throws TException {
      Span trace = Trace.start(message);
      try {
        return Trace.isTracing();
      } finally {
        trace.stop();
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.trace.instrument.Span

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.