001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase;
019
020import java.util.Collections;
021import java.util.List;
022import java.util.Map;
023import java.util.stream.Collectors;
024import org.apache.hadoop.hbase.client.CompactionState;
025import org.apache.hadoop.hbase.util.Strings;
026import org.apache.yetus.audience.InterfaceAudience;
027
028import org.apache.hbase.thirdparty.com.google.common.base.Preconditions;
029import org.apache.hbase.thirdparty.com.google.protobuf.UnsafeByteOperations;
030
031import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
032import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos;
033import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos;
034import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos;
035
036@InterfaceAudience.Private
037public final class RegionMetricsBuilder {
038
039  public static List<RegionMetrics>
040    toRegionMetrics(AdminProtos.GetRegionLoadResponse regionLoadResponse) {
041    return regionLoadResponse.getRegionLoadsList().stream()
042      .map(RegionMetricsBuilder::toRegionMetrics).collect(Collectors.toList());
043  }
044
045  public static RegionMetrics toRegionMetrics(ClusterStatusProtos.RegionLoad regionLoadPB) {
046    return RegionMetricsBuilder
047      .newBuilder(regionLoadPB.getRegionSpecifier().getValue().toByteArray())
048      .setBloomFilterSize(new Size(regionLoadPB.getTotalStaticBloomSizeKB(), Size.Unit.KILOBYTE))
049      .setCompactedCellCount(regionLoadPB.getCurrentCompactedKVs())
050      .setCompactingCellCount(regionLoadPB.getTotalCompactingKVs())
051      .setCompletedSequenceId(regionLoadPB.getCompleteSequenceId())
052      .setDataLocality(regionLoadPB.hasDataLocality() ? regionLoadPB.getDataLocality() : 0.0f)
053      .setDataLocalityForSsd(
054        regionLoadPB.hasDataLocalityForSsd() ? regionLoadPB.getDataLocalityForSsd() : 0.0f)
055      .setBlocksLocalWeight(
056        regionLoadPB.hasBlocksLocalWeight() ? regionLoadPB.getBlocksLocalWeight() : 0)
057      .setBlocksLocalWithSsdWeight(
058        regionLoadPB.hasBlocksLocalWithSsdWeight() ? regionLoadPB.getBlocksLocalWithSsdWeight() : 0)
059      .setBlocksTotalWeight(regionLoadPB.getBlocksTotalWeight())
060      .setCompactionState(
061        ProtobufUtil.createCompactionStateForRegionLoad(regionLoadPB.getCompactionState()))
062      .setFilteredReadRequestCount(regionLoadPB.getFilteredReadRequestsCount())
063      .setStoreFileUncompressedDataIndexSize(
064        new Size(regionLoadPB.getTotalStaticIndexSizeKB(), Size.Unit.KILOBYTE))
065      .setLastMajorCompactionTimestamp(regionLoadPB.getLastMajorCompactionTs())
066      .setMemStoreSize(new Size(regionLoadPB.getMemStoreSizeMB(), Size.Unit.MEGABYTE))
067      .setReadRequestCount(regionLoadPB.getReadRequestsCount())
068      .setCpRequestCount(regionLoadPB.getCpRequestsCount())
069      .setWriteRequestCount(regionLoadPB.getWriteRequestsCount())
070      .setStoreFileIndexSize(new Size(regionLoadPB.getStorefileIndexSizeKB(), Size.Unit.KILOBYTE))
071      .setStoreFileRootLevelIndexSize(
072        new Size(regionLoadPB.getRootIndexSizeKB(), Size.Unit.KILOBYTE))
073      .setStoreCount(regionLoadPB.getStores()).setStoreFileCount(regionLoadPB.getStorefiles())
074      .setStoreRefCount(regionLoadPB.getStoreRefCount())
075      .setMaxCompactedStoreFileRefCount(regionLoadPB.getMaxCompactedStoreFileRefCount())
076      .setStoreFileSize(new Size(regionLoadPB.getStorefileSizeMB(), Size.Unit.MEGABYTE))
077      .setStoreSequenceIds(regionLoadPB.getStoreCompleteSequenceIdList().stream()
078        .collect(Collectors.toMap(
079          (ClusterStatusProtos.StoreSequenceId s) -> s.getFamilyName().toByteArray(),
080          ClusterStatusProtos.StoreSequenceId::getSequenceId)))
081      .setUncompressedStoreFileSize(
082        new Size(regionLoadPB.getStoreUncompressedSizeMB(), Size.Unit.MEGABYTE))
083      .setRegionSizeMB(new Size(regionLoadPB.getRegionSizeMB(), Size.Unit.MEGABYTE))
084      .setCurrentRegionCachedRatio(regionLoadPB.getCurrentRegionCachedRatio()).build();
085  }
086
087  private static List<ClusterStatusProtos.StoreSequenceId>
088    toStoreSequenceId(Map<byte[], Long> ids) {
089    return ids.entrySet().stream()
090      .map(e -> ClusterStatusProtos.StoreSequenceId.newBuilder()
091        .setFamilyName(UnsafeByteOperations.unsafeWrap(e.getKey())).setSequenceId(e.getValue())
092        .build())
093      .collect(Collectors.toList());
094  }
095
096  public static ClusterStatusProtos.RegionLoad toRegionLoad(RegionMetrics regionMetrics) {
097    return ClusterStatusProtos.RegionLoad.newBuilder()
098      .setRegionSpecifier(HBaseProtos.RegionSpecifier.newBuilder()
099        .setType(HBaseProtos.RegionSpecifier.RegionSpecifierType.REGION_NAME)
100        .setValue(UnsafeByteOperations.unsafeWrap(regionMetrics.getRegionName())).build())
101      .setTotalStaticBloomSizeKB((int) regionMetrics.getBloomFilterSize().get(Size.Unit.KILOBYTE))
102      .setCurrentCompactedKVs(regionMetrics.getCompactedCellCount())
103      .setTotalCompactingKVs(regionMetrics.getCompactingCellCount())
104      .setCompleteSequenceId(regionMetrics.getCompletedSequenceId())
105      .setDataLocality(regionMetrics.getDataLocality())
106      .setFilteredReadRequestsCount(regionMetrics.getFilteredReadRequestCount())
107      .setTotalStaticIndexSizeKB(
108        (int) regionMetrics.getStoreFileUncompressedDataIndexSize().get(Size.Unit.KILOBYTE))
109      .setLastMajorCompactionTs(regionMetrics.getLastMajorCompactionTimestamp())
110      .setMemStoreSizeMB((int) regionMetrics.getMemStoreSize().get(Size.Unit.MEGABYTE))
111      .setReadRequestsCount(regionMetrics.getReadRequestCount())
112      .setCpRequestsCount(regionMetrics.getCpRequestCount())
113      .setWriteRequestsCount(regionMetrics.getWriteRequestCount())
114      .setStorefileIndexSizeKB((long) regionMetrics.getStoreFileIndexSize().get(Size.Unit.KILOBYTE))
115      .setRootIndexSizeKB(
116        (int) regionMetrics.getStoreFileRootLevelIndexSize().get(Size.Unit.KILOBYTE))
117      .setStores(regionMetrics.getStoreCount()).setStorefiles(regionMetrics.getStoreFileCount())
118      .setStoreRefCount(regionMetrics.getStoreRefCount())
119      .setMaxCompactedStoreFileRefCount(regionMetrics.getMaxCompactedStoreFileRefCount())
120      .setStorefileSizeMB((int) regionMetrics.getStoreFileSize().get(Size.Unit.MEGABYTE))
121      .addAllStoreCompleteSequenceId(toStoreSequenceId(regionMetrics.getStoreSequenceId()))
122      .setStoreUncompressedSizeMB(
123        (int) regionMetrics.getUncompressedStoreFileSize().get(Size.Unit.MEGABYTE))
124      .setRegionSizeMB((int) regionMetrics.getRegionSizeMB().get(Size.Unit.MEGABYTE))
125      .setCurrentRegionCachedRatio(regionMetrics.getCurrentRegionCachedRatio()).build();
126  }
127
128  public static RegionMetricsBuilder newBuilder(byte[] name) {
129    return new RegionMetricsBuilder(name);
130  }
131
132  private final byte[] name;
133  private int storeCount;
134  private int storeFileCount;
135  private int storeRefCount;
136  private int maxCompactedStoreFileRefCount;
137  private long compactingCellCount;
138  private long compactedCellCount;
139  private Size storeFileSize = Size.ZERO;
140  private Size memStoreSize = Size.ZERO;
141  private Size indexSize = Size.ZERO;
142  private Size rootLevelIndexSize = Size.ZERO;
143  private Size uncompressedDataIndexSize = Size.ZERO;
144  private Size bloomFilterSize = Size.ZERO;
145  private Size uncompressedStoreFileSize = Size.ZERO;
146  private long writeRequestCount;
147  private long readRequestCount;
148  private long cpRequestCount;
149  private long filteredReadRequestCount;
150  private long completedSequenceId;
151  private Map<byte[], Long> storeSequenceIds = Collections.emptyMap();
152  private float dataLocality;
153  private long lastMajorCompactionTimestamp;
154  private float dataLocalityForSsd;
155  private long blocksLocalWeight;
156  private long blocksLocalWithSsdWeight;
157  private long blocksTotalWeight;
158  private CompactionState compactionState;
159  private Size regionSizeMB = Size.ZERO;
160  private float currentRegionCachedRatio;
161
162  private RegionMetricsBuilder(byte[] name) {
163    this.name = name;
164  }
165
166  public RegionMetricsBuilder setStoreCount(int value) {
167    this.storeCount = value;
168    return this;
169  }
170
171  public RegionMetricsBuilder setStoreFileCount(int value) {
172    this.storeFileCount = value;
173    return this;
174  }
175
176  public RegionMetricsBuilder setStoreRefCount(int value) {
177    this.storeRefCount = value;
178    return this;
179  }
180
181  public RegionMetricsBuilder setMaxCompactedStoreFileRefCount(int value) {
182    this.maxCompactedStoreFileRefCount = value;
183    return this;
184  }
185
186  public RegionMetricsBuilder setCompactingCellCount(long value) {
187    this.compactingCellCount = value;
188    return this;
189  }
190
191  public RegionMetricsBuilder setCompactedCellCount(long value) {
192    this.compactedCellCount = value;
193    return this;
194  }
195
196  public RegionMetricsBuilder setStoreFileSize(Size value) {
197    this.storeFileSize = value;
198    return this;
199  }
200
201  public RegionMetricsBuilder setMemStoreSize(Size value) {
202    this.memStoreSize = value;
203    return this;
204  }
205
206  public RegionMetricsBuilder setStoreFileIndexSize(Size value) {
207    this.indexSize = value;
208    return this;
209  }
210
211  public RegionMetricsBuilder setStoreFileRootLevelIndexSize(Size value) {
212    this.rootLevelIndexSize = value;
213    return this;
214  }
215
216  public RegionMetricsBuilder setStoreFileUncompressedDataIndexSize(Size value) {
217    this.uncompressedDataIndexSize = value;
218    return this;
219  }
220
221  public RegionMetricsBuilder setBloomFilterSize(Size value) {
222    this.bloomFilterSize = value;
223    return this;
224  }
225
226  public RegionMetricsBuilder setUncompressedStoreFileSize(Size value) {
227    this.uncompressedStoreFileSize = value;
228    return this;
229  }
230
231  public RegionMetricsBuilder setWriteRequestCount(long value) {
232    this.writeRequestCount = value;
233    return this;
234  }
235
236  public RegionMetricsBuilder setReadRequestCount(long value) {
237    this.readRequestCount = value;
238    return this;
239  }
240
241  public RegionMetricsBuilder setCpRequestCount(long value) {
242    this.cpRequestCount = value;
243    return this;
244  }
245
246  public RegionMetricsBuilder setFilteredReadRequestCount(long value) {
247    this.filteredReadRequestCount = value;
248    return this;
249  }
250
251  public RegionMetricsBuilder setCompletedSequenceId(long value) {
252    this.completedSequenceId = value;
253    return this;
254  }
255
256  public RegionMetricsBuilder setStoreSequenceIds(Map<byte[], Long> value) {
257    this.storeSequenceIds = value;
258    return this;
259  }
260
261  public RegionMetricsBuilder setDataLocality(float value) {
262    this.dataLocality = value;
263    return this;
264  }
265
266  public RegionMetricsBuilder setLastMajorCompactionTimestamp(long value) {
267    this.lastMajorCompactionTimestamp = value;
268    return this;
269  }
270
271  public RegionMetricsBuilder setDataLocalityForSsd(float value) {
272    this.dataLocalityForSsd = value;
273    return this;
274  }
275
276  public RegionMetricsBuilder setBlocksLocalWeight(long value) {
277    this.blocksLocalWeight = value;
278    return this;
279  }
280
281  public RegionMetricsBuilder setBlocksLocalWithSsdWeight(long value) {
282    this.blocksLocalWithSsdWeight = value;
283    return this;
284  }
285
286  public RegionMetricsBuilder setBlocksTotalWeight(long value) {
287    this.blocksTotalWeight = value;
288    return this;
289  }
290
291  public RegionMetricsBuilder setCompactionState(CompactionState compactionState) {
292    this.compactionState = compactionState;
293    return this;
294  }
295
296  public RegionMetricsBuilder setRegionSizeMB(Size value) {
297    this.regionSizeMB = value;
298    return this;
299  }
300
301  public RegionMetricsBuilder setCurrentRegionCachedRatio(float value) {
302    this.currentRegionCachedRatio = value;
303    return this;
304  }
305
306  public RegionMetrics build() {
307    return new RegionMetricsImpl(name, storeCount, storeFileCount, storeRefCount,
308      maxCompactedStoreFileRefCount, compactingCellCount, compactedCellCount, storeFileSize,
309      memStoreSize, indexSize, rootLevelIndexSize, uncompressedDataIndexSize, bloomFilterSize,
310      uncompressedStoreFileSize, writeRequestCount, readRequestCount, cpRequestCount,
311      filteredReadRequestCount, completedSequenceId, storeSequenceIds, dataLocality,
312      lastMajorCompactionTimestamp, dataLocalityForSsd, blocksLocalWeight, blocksLocalWithSsdWeight,
313      blocksTotalWeight, compactionState, regionSizeMB, currentRegionCachedRatio);
314  }
315
316  private static class RegionMetricsImpl implements RegionMetrics {
317    private final byte[] name;
318    private final int storeCount;
319    private final int storeFileCount;
320    private final int storeRefCount;
321    private final int maxCompactedStoreFileRefCount;
322    private final long compactingCellCount;
323    private final long compactedCellCount;
324    private final Size storeFileSize;
325    private final Size memStoreSize;
326    private final Size indexSize;
327    private final Size rootLevelIndexSize;
328    private final Size uncompressedDataIndexSize;
329    private final Size bloomFilterSize;
330    private final Size uncompressedStoreFileSize;
331    private final long writeRequestCount;
332    private final long readRequestCount;
333    private final long cpRequestCount;
334    private final long filteredReadRequestCount;
335    private final long completedSequenceId;
336    private final Map<byte[], Long> storeSequenceIds;
337    private final float dataLocality;
338    private final long lastMajorCompactionTimestamp;
339    private final float dataLocalityForSsd;
340    private final long blocksLocalWeight;
341    private final long blocksLocalWithSsdWeight;
342    private final long blocksTotalWeight;
343    private final CompactionState compactionState;
344    private final Size regionSizeMB;
345    private final float currentRegionCachedRatio;
346
347    RegionMetricsImpl(byte[] name, int storeCount, int storeFileCount, int storeRefCount,
348      int maxCompactedStoreFileRefCount, final long compactingCellCount, long compactedCellCount,
349      Size storeFileSize, Size memStoreSize, Size indexSize, Size rootLevelIndexSize,
350      Size uncompressedDataIndexSize, Size bloomFilterSize, Size uncompressedStoreFileSize,
351      long writeRequestCount, long readRequestCount, long cpRequestCount,
352      long filteredReadRequestCount, long completedSequenceId, Map<byte[], Long> storeSequenceIds,
353      float dataLocality, long lastMajorCompactionTimestamp, float dataLocalityForSsd,
354      long blocksLocalWeight, long blocksLocalWithSsdWeight, long blocksTotalWeight,
355      CompactionState compactionState, Size regionSizeMB, float currentRegionCachedRatio) {
356      this.name = Preconditions.checkNotNull(name);
357      this.storeCount = storeCount;
358      this.storeFileCount = storeFileCount;
359      this.storeRefCount = storeRefCount;
360      this.maxCompactedStoreFileRefCount = maxCompactedStoreFileRefCount;
361      this.compactingCellCount = compactingCellCount;
362      this.compactedCellCount = compactedCellCount;
363      this.storeFileSize = Preconditions.checkNotNull(storeFileSize);
364      this.memStoreSize = Preconditions.checkNotNull(memStoreSize);
365      this.indexSize = Preconditions.checkNotNull(indexSize);
366      this.rootLevelIndexSize = Preconditions.checkNotNull(rootLevelIndexSize);
367      this.uncompressedDataIndexSize = Preconditions.checkNotNull(uncompressedDataIndexSize);
368      this.bloomFilterSize = Preconditions.checkNotNull(bloomFilterSize);
369      this.uncompressedStoreFileSize = Preconditions.checkNotNull(uncompressedStoreFileSize);
370      this.writeRequestCount = writeRequestCount;
371      this.readRequestCount = readRequestCount;
372      this.cpRequestCount = cpRequestCount;
373      this.filteredReadRequestCount = filteredReadRequestCount;
374      this.completedSequenceId = completedSequenceId;
375      this.storeSequenceIds = Preconditions.checkNotNull(storeSequenceIds);
376      this.dataLocality = dataLocality;
377      this.lastMajorCompactionTimestamp = lastMajorCompactionTimestamp;
378      this.dataLocalityForSsd = dataLocalityForSsd;
379      this.blocksLocalWeight = blocksLocalWeight;
380      this.blocksLocalWithSsdWeight = blocksLocalWithSsdWeight;
381      this.blocksTotalWeight = blocksTotalWeight;
382      this.compactionState = compactionState;
383      this.regionSizeMB = regionSizeMB;
384      this.currentRegionCachedRatio = currentRegionCachedRatio;
385    }
386
387    @Override
388    public byte[] getRegionName() {
389      return name;
390    }
391
392    @Override
393    public int getStoreCount() {
394      return storeCount;
395    }
396
397    @Override
398    public int getStoreFileCount() {
399      return storeFileCount;
400    }
401
402    @Override
403    public int getStoreRefCount() {
404      return storeRefCount;
405    }
406
407    @Override
408    public int getMaxCompactedStoreFileRefCount() {
409      return maxCompactedStoreFileRefCount;
410    }
411
412    @Override
413    public Size getStoreFileSize() {
414      return storeFileSize;
415    }
416
417    @Override
418    public Size getMemStoreSize() {
419      return memStoreSize;
420    }
421
422    @Override
423    public long getReadRequestCount() {
424      return readRequestCount;
425    }
426
427    @Override
428    public long getCpRequestCount() {
429      return cpRequestCount;
430    }
431
432    @Override
433    public long getFilteredReadRequestCount() {
434      return filteredReadRequestCount;
435    }
436
437    @Override
438    public long getWriteRequestCount() {
439      return writeRequestCount;
440    }
441
442    @Override
443    public Size getStoreFileIndexSize() {
444      return indexSize;
445    }
446
447    @Override
448    public Size getStoreFileRootLevelIndexSize() {
449      return rootLevelIndexSize;
450    }
451
452    @Override
453    public Size getStoreFileUncompressedDataIndexSize() {
454      return uncompressedDataIndexSize;
455    }
456
457    @Override
458    public Size getBloomFilterSize() {
459      return bloomFilterSize;
460    }
461
462    @Override
463    public long getCompactingCellCount() {
464      return compactingCellCount;
465    }
466
467    @Override
468    public long getCompactedCellCount() {
469      return compactedCellCount;
470    }
471
472    @Override
473    public long getCompletedSequenceId() {
474      return completedSequenceId;
475    }
476
477    @Override
478    public Map<byte[], Long> getStoreSequenceId() {
479      return Collections.unmodifiableMap(storeSequenceIds);
480    }
481
482    @Override
483    public Size getUncompressedStoreFileSize() {
484      return uncompressedStoreFileSize;
485    }
486
487    @Override
488    public float getDataLocality() {
489      return dataLocality;
490    }
491
492    @Override
493    public long getLastMajorCompactionTimestamp() {
494      return lastMajorCompactionTimestamp;
495    }
496
497    @Override
498    public float getDataLocalityForSsd() {
499      return dataLocalityForSsd;
500    }
501
502    @Override
503    public long getBlocksLocalWeight() {
504      return blocksLocalWeight;
505    }
506
507    @Override
508    public long getBlocksLocalWithSsdWeight() {
509      return blocksLocalWithSsdWeight;
510    }
511
512    @Override
513    public long getBlocksTotalWeight() {
514      return blocksTotalWeight;
515    }
516
517    @Override
518    public CompactionState getCompactionState() {
519      return compactionState;
520    }
521
522    @Override
523    public Size getRegionSizeMB() {
524      return regionSizeMB;
525    }
526
527    @Override
528    public float getCurrentRegionCachedRatio() {
529      return currentRegionCachedRatio;
530    }
531
532    @Override
533    public String toString() {
534      StringBuilder sb =
535        Strings.appendKeyValue(new StringBuilder(), "storeCount", this.getStoreCount());
536      Strings.appendKeyValue(sb, "storeFileCount", this.getStoreFileCount());
537      Strings.appendKeyValue(sb, "storeRefCount", this.getStoreRefCount());
538      Strings.appendKeyValue(sb, "maxCompactedStoreFileRefCount",
539        this.getMaxCompactedStoreFileRefCount());
540      Strings.appendKeyValue(sb, "uncompressedStoreFileSize", this.getUncompressedStoreFileSize());
541      Strings.appendKeyValue(sb, "lastMajorCompactionTimestamp",
542        this.getLastMajorCompactionTimestamp());
543      Strings.appendKeyValue(sb, "storeFileSize", this.getStoreFileSize());
544      if (this.getUncompressedStoreFileSize().get() != 0) {
545        Strings.appendKeyValue(sb, "compressionRatio",
546          String.format("%.4f", (float) this.getStoreFileSize().get(Size.Unit.MEGABYTE)
547            / (float) this.getUncompressedStoreFileSize().get(Size.Unit.MEGABYTE)));
548      }
549      Strings.appendKeyValue(sb, "memStoreSize", this.getMemStoreSize());
550      Strings.appendKeyValue(sb, "readRequestCount", this.getReadRequestCount());
551      Strings.appendKeyValue(sb, "cpRequestCount", this.getCpRequestCount());
552      Strings.appendKeyValue(sb, "writeRequestCount", this.getWriteRequestCount());
553      Strings.appendKeyValue(sb, "rootLevelIndexSize", this.getStoreFileRootLevelIndexSize());
554      Strings.appendKeyValue(sb, "uncompressedDataIndexSize",
555        this.getStoreFileUncompressedDataIndexSize());
556      Strings.appendKeyValue(sb, "bloomFilterSize", this.getBloomFilterSize());
557      Strings.appendKeyValue(sb, "compactingCellCount", this.getCompactingCellCount());
558      Strings.appendKeyValue(sb, "compactedCellCount", this.getCompactedCellCount());
559      float compactionProgressPct = Float.NaN;
560      if (this.getCompactingCellCount() > 0) {
561        compactionProgressPct =
562          ((float) this.getCompactedCellCount() / (float) this.getCompactingCellCount());
563      }
564      Strings.appendKeyValue(sb, "compactionProgressPct", compactionProgressPct);
565      Strings.appendKeyValue(sb, "completedSequenceId", this.getCompletedSequenceId());
566      Strings.appendKeyValue(sb, "dataLocality", this.getDataLocality());
567      Strings.appendKeyValue(sb, "dataLocalityForSsd", this.getDataLocalityForSsd());
568      Strings.appendKeyValue(sb, "blocksLocalWeight", blocksLocalWeight);
569      Strings.appendKeyValue(sb, "blocksLocalWithSsdWeight", blocksLocalWithSsdWeight);
570      Strings.appendKeyValue(sb, "blocksTotalWeight", blocksTotalWeight);
571      Strings.appendKeyValue(sb, "compactionState", compactionState);
572      Strings.appendKeyValue(sb, "regionSizeMB", regionSizeMB);
573      Strings.appendKeyValue(sb, "currentRegionCachedRatio", currentRegionCachedRatio);
574      return sb.toString();
575    }
576  }
577
578}