private long getAvgShardSizeInBytes() throws IOException { long sum = 0; int count = 0; for (IndexShard indexShard : this) { sum += indexShard.store().stats().sizeInBytes(); count++; } if (count == 0) { return -1L; } else { return sum / count; } }
static void buildShardLevelInfo(Logger logger, ShardStats[] stats, ImmutableOpenMap.Builder<String, Long> newShardSizes, ImmutableOpenMap.Builder<ShardRouting, String> newShardRoutingToDataPath, ClusterState state) { for (ShardStats s : stats) { newShardRoutingToDataPath.put(s.getShardRouting(), s.getDataPath()); long size = s.getStats().getStore().sizeInBytes(); String sid = ClusterInfo.shardIdentifierFromRouting(s.getShardRouting()); if (logger.isTraceEnabled()) { logger.trace("shard: {} size: {}", sid, size); } newShardSizes.put(sid, size); } }
private long getAvgShardSizeInBytes() throws IOException { long sum = 0; int count = 0; for(IndexShard indexShard : this) { sum += indexShard.store().stats().sizeInBytes(); count++; } if (count == 0) { return -1L; } else { return sum / count; } }
private long getAvgShardSizeInBytes() throws IOException { long sum = 0; int count = 0; for (IndexShard indexShard : this) { sum += indexShard.store().stats().sizeInBytes(); count++; } if (count == 0) { return -1L; } else { return sum / count; } }
private long getAvgShardSizeInBytes() throws IOException { long sum = 0; int count = 0; for (IndexShard indexShard : this) { sum += indexShard.store().stats().sizeInBytes(); count++; } if (count == 0) { return -1L; } else { return sum / count; } }
private long getAvgShardSizeInBytes() throws IOException { long sum = 0; int count = 0; for (IndexShard indexShard : this) { sum += indexShard.store().stats().sizeInBytes(); count++; } if (count == 0) { return -1L; } else { return sum / count; } }
private void sendStoreStats(String type, StoreStats storeStats) { sendInt(type, "sizeInBytes", storeStats.sizeInBytes()); sendInt(type, "throttleTimeInNanos", storeStats.throttleTime().getNanos()); }
static void buildShardLevelInfo(Logger logger, ShardStats[] stats, ImmutableOpenMap.Builder<String, Long> newShardSizes, ImmutableOpenMap.Builder<ShardRouting, String> newShardRoutingToDataPath, ClusterState state) { for (ShardStats s : stats) { newShardRoutingToDataPath.put(s.getShardRouting(), s.getDataPath()); long size = s.getStats().getStore().sizeInBytes(); String sid = ClusterInfo.shardIdentifierFromRouting(s.getShardRouting()); if (logger.isTraceEnabled()) { logger.trace("shard: {} size: {}", sid, size); } newShardSizes.put(sid, size); } }
static void buildShardLevelInfo(Logger logger, ShardStats[] stats, ImmutableOpenMap.Builder<String, Long> newShardSizes, ImmutableOpenMap.Builder<ShardRouting, String> newShardRoutingToDataPath, ClusterState state) { for (ShardStats s : stats) { newShardRoutingToDataPath.put(s.getShardRouting(), s.getDataPath()); long size = s.getStats().getStore().sizeInBytes(); String sid = ClusterInfo.shardIdentifierFromRouting(s.getShardRouting()); if (logger.isTraceEnabled()) { logger.trace("shard: {} size: {}", sid, size); } newShardSizes.put(sid, size); } }
static void buildShardLevelInfo(ESLogger logger, ShardStats[] stats, HashMap<String, Long> newShardSizes, HashMap<ShardRouting, String> newShardRoutingToDataPath, ClusterState state) { MetaData meta = state.getMetaData(); for (ShardStats s : stats) { IndexMetaData indexMeta = meta.index(s.getShardRouting().index()); Settings indexSettings = indexMeta == null ? null : indexMeta.getSettings(); newShardRoutingToDataPath.put(s.getShardRouting(), s.getDataPath()); long size = s.getStats().getStore().sizeInBytes(); String sid = ClusterInfo.shardIdentifierFromRouting(s.getShardRouting()); if (logger.isTraceEnabled()) { logger.trace("shard: {} size: {}", sid, size); } if (indexSettings != null && IndexMetaData.isIndexUsingShadowReplicas(indexSettings)) { // Shards on a shared filesystem should be considered of size 0 if (logger.isTraceEnabled()) { logger.trace("shard: {} is using shadow replicas and will be treated as size 0", sid); } size = 0; } newShardSizes.put(sid, size); } }
static void buildShardLevelInfo(Logger logger, ShardStats[] stats, ImmutableOpenMap.Builder<String, Long> newShardSizes, ImmutableOpenMap.Builder<ShardRouting, String> newShardRoutingToDataPath, ClusterState state) { MetaData meta = state.getMetaData(); for (ShardStats s : stats) { IndexMetaData indexMeta = meta.index(s.getShardRouting().index()); Settings indexSettings = indexMeta == null ? null : indexMeta.getSettings(); newShardRoutingToDataPath.put(s.getShardRouting(), s.getDataPath()); long size = s.getStats().getStore().sizeInBytes(); String sid = ClusterInfo.shardIdentifierFromRouting(s.getShardRouting()); if (logger.isTraceEnabled()) { logger.trace("shard: {} size: {}", sid, size); } if (indexSettings != null && IndexMetaData.isIndexUsingShadowReplicas(indexSettings)) { // Shards on a shared filesystem should be considered of size 0 if (logger.isTraceEnabled()) { logger.trace("shard: {} is using shadow replicas and will be treated as size 0", sid); } size = 0; } newShardSizes.put(sid, size); } }