org.apache.cassandra.io.util.FileUtils.stringifyFileSize()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(181)

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

FileUtils.stringifyFileSize介绍

暂无

代码示例

代码示例来源:origin: jsevellec/cassandra-unit

public String getLoadString()
{
  return FileUtils.stringifyFileSize(StorageMetrics.load.getCount());
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public String getLoadString()
{
  return FileUtils.stringifyFileSize(StorageMetrics.load.getCount());
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

private String format(long bytes, boolean humanReadable)
{
  return humanReadable ? FileUtils.stringifyFileSize(bytes) : Long.toString(bytes);
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public String getLoadString()
{
  return FileUtils.stringifyFileSize(StorageMetrics.load.getCount());
}

代码示例来源:origin: jsevellec/cassandra-unit

private String format(long bytes, boolean humanReadable)
{
  return humanReadable ? FileUtils.stringifyFileSize(bytes) : Long.toString(bytes);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

private String format(long bytes, boolean humanReadable)
{
  return humanReadable ? FileUtils.stringifyFileSize(bytes) : Long.toString(bytes);
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

private String format(long bytes, boolean humanReadable) {
  return humanReadable ? FileUtils.stringifyFileSize(bytes) : Long.toString(bytes);
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public static void from(final String snapshot, final String ks, final String cf, Map.Entry<String, Pair<Long,Long>> snapshotDetail, TabularDataSupport result)
  {
    try
    {
      final String totalSize = FileUtils.stringifyFileSize(snapshotDetail.getValue().left);
      final String liveSize =  FileUtils.stringifyFileSize(snapshotDetail.getValue().right);
      result.put(new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
          new Object[]{ snapshot, ks, cf, liveSize, totalSize }));
    }
    catch (OpenDataException e)
    {
      throw new RuntimeException(e);
    }
  }
}

代码示例来源:origin: jsevellec/cassandra-unit

public static void from(final String snapshot, final String ks, final String cf, Map.Entry<String, Pair<Long,Long>> snapshotDetail, TabularDataSupport result)
  {
    try
    {
      final String totalSize = FileUtils.stringifyFileSize(snapshotDetail.getValue().left);
      final String liveSize =  FileUtils.stringifyFileSize(snapshotDetail.getValue().right);
      result.put(new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
          new Object[]{ snapshot, ks, cf, liveSize, totalSize }));
    }
    catch (OpenDataException e)
    {
      throw new RuntimeException(e);
    }
  }
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public static void from(final String snapshot, final String ks, final String cf, Map.Entry<String, Pair<Long,Long>> snapshotDetail, TabularDataSupport result)
  {
    try
    {
      final String totalSize = FileUtils.stringifyFileSize(snapshotDetail.getValue().left);
      final String liveSize =  FileUtils.stringifyFileSize(snapshotDetail.getValue().right);
      result.put(new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
          new Object[]{ snapshot, ks, cf, liveSize, totalSize }));
    }
    catch (OpenDataException e)
    {
      throw new RuntimeException(e);
    }
  }
}

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

public static void from(final String snapshot, final String ks, final String cf, Map.Entry<String, Pair<Long,Long>> snapshotDetail, TabularDataSupport result)
  {
    try
    {
      final String totalSize = FileUtils.stringifyFileSize(snapshotDetail.getValue().left);
      final String liveSize =  FileUtils.stringifyFileSize(snapshotDetail.getValue().right);
      result.put(new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
          new Object[]{ snapshot, ks, cf, liveSize, totalSize }));
    }
    catch (OpenDataException e)
    {
      throw new RuntimeException(e);
    }
  }
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

public static void from(final String snapshot, final String ks, final String cf, Map.Entry<String, Pair<Long,Long>> snapshotDetail, TabularDataSupport result)
  {
    try
    {
      final String totalSize = FileUtils.stringifyFileSize(snapshotDetail.getValue().left);
      final String liveSize =  FileUtils.stringifyFileSize(snapshotDetail.getValue().right);
      result.put(new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
          new Object[]{ snapshot, ks, cf, liveSize, totalSize }));
    }
    catch (OpenDataException e)
    {
      throw new RuntimeException(e);
    }
  }
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

public String getLoadString()
{
  return FileUtils.stringifyFileSize(getLoad());
}

代码示例来源:origin: jsevellec/cassandra-unit

public Map<String, String> getLoadMap()
{
  Map<String, String> map = new HashMap<>();
  for (Map.Entry<InetAddress,Double> entry : LoadBroadcaster.instance.getLoadInfo().entrySet())
  {
    map.put(entry.getKey().getHostAddress(), FileUtils.stringifyFileSize(entry.getValue()));
  }
  // gossiper doesn't see its own updates, so we need to special-case the local node
  map.put(FBUtilities.getBroadcastAddress().getHostAddress(), getLoadString());
  return map;
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public Map<String, String> getLoadMap()
{
  Map<String, String> map = new HashMap<>();
  for (Map.Entry<InetAddress,Double> entry : LoadBroadcaster.instance.getLoadInfo().entrySet())
  {
    map.put(entry.getKey().getHostAddress(), FileUtils.stringifyFileSize(entry.getValue()));
  }
  // gossiper doesn't see its own updates, so we need to special-case the local node
  map.put(FBUtilities.getBroadcastAddress().getHostAddress(), getLoadString());
  return map;
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public Map<String, String> getLoadMap()
{
  Map<String, String> map = new HashMap<>();
  for (Map.Entry<InetAddress,Double> entry : LoadBroadcaster.instance.getLoadInfo().entrySet())
  {
    map.put(entry.getKey().getHostAddress(), FileUtils.stringifyFileSize(entry.getValue()));
  }
  // gossiper doesn't see its own updates, so we need to special-case the local node
  map.put(FBUtilities.getBroadcastAddress().getHostAddress(), getLoadString());
  return map;
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

public Map<String, String> getLoadMap()
{
  Map<String, String> map = new HashMap<>();
  for (Map.Entry<InetAddress,Double> entry : LoadBroadcaster.instance.getLoadInfo().entrySet())
  {
    map.put(entry.getKey().getHostAddress(), FileUtils.stringifyFileSize(entry.getValue()));
  }
  // gossiper doesn't see its own updates, so we need to special-case the local node
  map.put(FBUtilities.getBroadcastAddress().getHostAddress(), getLoadString());
  return map;
}

代码示例来源:origin: jsevellec/cassandra-unit

String keyspace = c.get("keyspace");
String columnFamily = c.get("columnfamily");
String completedStr = humanReadable ? FileUtils.stringifyFileSize(completed) : Long.toString(completed);
String totalStr = humanReadable ? FileUtils.stringifyFileSize(total) : Long.toString(total);
String unit = c.get("unit");
String percentComplete = total == 0 ? "n/a" : new DecimalFormat("0.00").format((double) completed / total * 100) + "%";

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

String unit = c.get("unit");
boolean toFileSize = humanReadable && Unit.isFileSize(unit);
String completedStr = toFileSize ? FileUtils.stringifyFileSize(completed) : Long.toString(completed);
String totalStr = toFileSize ? FileUtils.stringifyFileSize(total) : Long.toString(total);
String percentComplete = total == 0 ? "n/a" : new DecimalFormat("0.00").format((double) completed / total * 100) + "%";
String id = c.get("compactionId");

代码示例来源:origin: jsevellec/cassandra-unit

System.out.println("\nTotal TrueDiskSpaceUsed: " + FileUtils.stringifyFileSize(trueSnapshotsSize) + "\n");

相关文章