org.apache.jackrabbit.oak.commons.IOUtils.humanReadableByteCount()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中org.apache.jackrabbit.oak.commons.IOUtils.humanReadableByteCount()方法的一些代码示例,展示了IOUtils.humanReadableByteCount()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IOUtils.humanReadableByteCount()方法的具体详情如下:
包路径:org.apache.jackrabbit.oak.commons.IOUtils
类名称:IOUtils
方法名:humanReadableByteCount

IOUtils.humanReadableByteCount介绍

[英]Returns a human-readable version of the file size, where the input represents a specific number of bytes. Based on http://stackoverflow.com/a/3758880/1035417
[中]返回文件大小的可读版本,其中输入表示特定的字节数。基于http://stackoverflow.com/a/3758880/1035417

代码示例

代码示例来源:origin: apache/jackrabbit-oak

@Override
public String getBytesRead() {
  return IOUtils.humanReadableByteCount(totalBytesRead);
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public String getDownloadSize() {
  return humanReadableByteCount(downloadSize.get());
}

代码示例来源:origin: org.apache.jackrabbit/oak-lucene

@Override
public String getUploadSize() {
  return humanReadableByteCount(uploadSize.get());
}

代码示例来源:origin: org.apache.jackrabbit/oak-lucene

@Override
public String getCopyInProgressSize() {
  return humanReadableByteCount(copyInProgressSize.get());
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public String getUploadSize() {
  return humanReadableByteCount(uploadSize.get());
}

代码示例来源:origin: org.apache.jackrabbit/oak-lucene

@Override
public String getGarbageCollectedSize() {
  return humanReadableByteCount(garbageCollectedSize.get());
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public String toString() {
  return String.format(" %d (Time Taken %s, Bytes Read %s, Extracted text size %s)",
      count,
      timeInWords(totalTime),
      humanReadableByteCount(totalBytesRead),
      humanReadableByteCount(totalTextLength));
}

代码示例来源:origin: apache/jackrabbit-oak

public String deleteLog(){
  return String.format("%s (%s, %d attempts, %d s)", name,
      humanReadableByteCount(size), deleteAttemptCount, timeTaken());
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public String getGarbageSize() {
  long garbageSize = 0;
  for (LocalIndexFile failedToDeleteFile : failedToDeleteFiles.values()){
    garbageSize += failedToDeleteFile.getSize();
  }
  return humanReadableByteCount(garbageSize);
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public String getLocalIndexSize() {
  return humanReadableByteCount(indexRootDirectory.getSize());
}

代码示例来源:origin: apache/jackrabbit-oak

public String copyLog(){
  return String.format("%s (%s, %1.1f%%, %s, %d s)", name,
      humanReadableByteCount(actualSize()),
      copyProgress(),
      humanReadableByteCount(size), timeTaken());
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public String fileStoreInfoAsString() {
  return String.format("Segment store size : %s%n" +
      "Number of tar files : %d",
      IOUtils.humanReadableByteCount(getApproximateSize()),
      getTarFileCount());
}

代码示例来源:origin: org.apache.jackrabbit/oak-blob-plugins

@Override
public String blobStoreInfoAsString() {
  return String.format("Uploads - size = %s, count = %d%nDownloads - size = %s, count = %d",
      humanReadableByteCount(getUploadTotalSize()),
      getUploadCount(),
      humanReadableByteCount(getDownloadTotalSize()),
      getDownloadCount()
  );
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public String blobStoreInfoAsString() {
  return String.format("Uploads - size = %s, count = %d%nDownloads - size = %s, count = %d",
      humanReadableByteCount(getUploadTotalSize()),
      getUploadCount(),
      humanReadableByteCount(getDownloadTotalSize()),
      getDownloadCount()
  );
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public String blobStoreInfoAsString() {
  return String.format("Uploads - size = %s, count = %d%nDownloads - size = %s, count = %d",
      humanReadableByteCount(getUploadTotalSize()),
      getUploadCount(),
      humanReadableByteCount(getDownloadTotalSize()),
      getDownloadCount()
  );
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

private CompositeDataSupport toCompositeData(GarbageCollectionRepoStats statObj) throws OpenDataException {
  Object[] values = new Object[] {
      statObj.getRepositoryId() + (statObj.isLocal() ? " *" : ""),
      (statObj.getStartTime() == 0 ? "" : (new Date(statObj.getStartTime()))).toString(),
      (statObj.getEndTime() == 0 ? "" : (new Date(statObj.getEndTime()))).toString(),
      statObj.getLength(),
      humanReadableByteCount(statObj.getLength()),
      statObj.getNumLines()
  };
  return new CompositeDataSupport(TYPE, FIELD_NAMES, values);
}

代码示例来源:origin: apache/jackrabbit-oak

private CompositeDataSupport toCompositeData(GarbageCollectionRepoStats statObj) throws OpenDataException {
  Object[] values = new Object[] {
      statObj.getRepositoryId() + (statObj.isLocal() ? " *" : ""),
      (statObj.getStartTime() == 0 ? "" : (new Date(statObj.getStartTime()))).toString(),
      (statObj.getEndTime() == 0 ? "" : (new Date(statObj.getEndTime()))).toString(),
      statObj.getLength(),
      humanReadableByteCount(statObj.getLength()),
      statObj.getNumLines()
  };
  return new CompositeDataSupport(MARK_TYPE, MARK_FIELD_NAMES, values);
}

代码示例来源:origin: org.apache.jackrabbit/oak-blob-plugins

private CompositeDataSupport toCompositeData(GarbageCollectionRepoStats statObj) throws OpenDataException {
  Object[] values = new Object[] {
      statObj.getRepositoryId() + (statObj.isLocal() ? " *" : ""),
      (statObj.getStartTime() == 0 ? "" : (new Date(statObj.getStartTime()))).toString(),
      (statObj.getEndTime() == 0 ? "" : (new Date(statObj.getEndTime()))).toString(),
      statObj.getLength(),
      humanReadableByteCount(statObj.getLength()),
      statObj.getNumLines()
  };
  return new CompositeDataSupport(MARK_TYPE, MARK_FIELD_NAMES, values);
}

代码示例来源:origin: org.apache.jackrabbit/oak-lucene

public IndexStats(String path, LuceneIndexNode indexNode) throws IOException {
  this.path = path;
  numDocs = indexNode.getSearcher().getIndexReader().numDocs();
  maxDoc = indexNode.getSearcher().getIndexReader().maxDoc();
  numDeletedDocs = indexNode.getSearcher().getIndexReader().numDeletedDocs();
  indexSize = getIndexSize(indexNode.getPrimaryReaders());
  indexSizeStr = humanReadableByteCount(indexSize);
  suggesterSize = dirSize(indexNode.getSuggestDirectory());
  suggesterSizeStr = humanReadableByteCount(suggesterSize);
  nrtIndexSize = getIndexSize(indexNode.getNRTReaders());
  numDocsNRT = getNumDocs(indexNode.getNRTReaders());
  nrtIndexSizeStr = humanReadableByteCount(nrtIndexSize);
}

代码示例来源:origin: apache/jackrabbit-oak

private void printStats() throws IOException {
  fileStore.flush();
  FileStoreStats stats = fileStore.getStats();
  long sizeOfDirectory = FileUtils.sizeOfDirectory(new File(fdsDir));
  String fdsSize = (sizeOfDirectory / (1024 * 1000)) + " MB";
  double time = evaluateQuery(FOO_QUERY);
  System.err.println("||codec||min record length||merge policy||segment size||FDS size||query time||");
  System.err.println("|" + codec + "|" + minRecordLength + "|" + mergePolicy + "|" + IOUtils.humanReadableByteCount(
      stats.getApproximateSize()) + "|" + fdsSize + "|" + time + " s|");
  if (indexOnFS) {
    long sizeOfFSIndex = FileUtils.sizeOfDirectory(new File(indexPath));
    System.out.println("Index on FS size : " + FileUtils.byteCountToDisplaySize(sizeOfFSIndex));
  }
}

相关文章