Package org.apache.blur.trace

Examples of org.apache.blur.trace.Tracer


      Boolean b = _symlinkMap.get(name);
      if (b != null) {
        return b;
      }
    }
    Tracer trace = Trace.trace("filesystem - isSymlink", Trace.param("name", name));
    try {
      boolean exists = _fileSystem.exists(new Path(_path, name + LNK));
      if (_useCache) {
        _symlinkMap.put(name, exists);
      }
      return exists;
    } finally {
      trace.done();
    }
  }
View Full Code Here


    return fileModified(name);
  }

  protected long fileModified(String name) throws IOException {
    Path path = getPath(name);
    Tracer trace = Trace.trace("filesystem - fileModified", Trace.param("path", path));
    try {
      return _fileSystem.getFileStatus(path).getModificationTime();
    } finally {
      trace.done();
    }
  }
View Full Code Here

  }

  @Override
  public final List<String> getShardList(String table) {
    checkTable(table);
    Tracer trace = Trace.trace("filesystem - getShardList", Trace.param("table", table));
    List<String> result = new ArrayList<String>();
    try {
      TableContext tableContext = getTableContext(table);
      TableDescriptor descriptor = tableContext.getDescriptor();
      Path tablePath = new Path(descriptor.tableUri);
      FileSystem fileSystem = FileSystem.get(tablePath.toUri(), _configuration);
      if (!fileSystem.exists(tablePath)) {
        LOG.error("Table [{0}] is missing, defined location [{1}]", table, tablePath.toUri());
        throw new RuntimeException("Table [" + table + "] is missing, defined location [" + tablePath.toUri() + "]");
      }
      FileStatus[] listStatus = fileSystem.listStatus(tablePath);
      for (FileStatus status : listStatus) {
        if (status.isDir()) {
          String name = status.getPath().getName();
          if (name.startsWith(SHARD_PREFIX)) {
            result.add(name);
          }
        }
      }
      return result;
    } catch (IOException e) {
      throw new RuntimeException(e);
    } finally {
      trace.done();
    }
  }
View Full Code Here

    int sessionTimeout = getSessionTimeout();
    if (sessionTimeout == 0) {
      sessionTimeout = internalSessionTimeout;
    }
    while (true) {
      Tracer trace = Trace.trace("remote call - zookeeper", Trace.param("method", executor._name),
          Trace.param("toString", executor.toString()));
      try {
        return executor.execute();
      } catch (KeeperException e) {
        if (e.code() == Code.CONNECTIONLOSS && timestmap + sessionTimeout >= System.currentTimeMillis()) {
          LOG.warn("Connection loss");
          ZkUtils.pause(this);
          continue;
        }
        throw e;
      } finally {
        trace.done();
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.blur.trace.Tracer

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.