serverLoad.addCoprocessors(coprocessorBuilder.setName(coprocessor).build()); RegionLoad.Builder regionLoadBldr = RegionLoad.newBuilder(); RegionSpecifier.Builder regionSpecifier = RegionSpecifier.newBuilder(); for (HRegion region : regions) {
String compactTime = ""; if (load != null) { if (load.getTotalCompactingKVs() > 0) { percentDone = String.format("%.2f", 100 * ((float) load.getCurrentCompactedKVs() / load.getTotalCompactingKVs())) + "%"; if (load.getLastMajorCompactionTs() > 0) { FastDateFormat fdf = FastDateFormat.getInstance("yyyy-MM-dd HH:mm ZZ"); compactTime = fdf.format(load.getLastMajorCompactionTs()); org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getTotalCompactingKVs()), jamonWriter); org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getCurrentCompactedKVs()), jamonWriter);
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getStores()), jamonWriter); org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getStorefiles()), jamonWriter); org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(load.getStoreUncompressedSizeMB() * TraditionalBinaryPrefix.MEGA.value, "B", 1)), jamonWriter); org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(load.getStorefileSizeMB() * TraditionalBinaryPrefix.MEGA.value, "B", 1)), jamonWriter); org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(load.getTotalStaticIndexSizeKB() * TraditionalBinaryPrefix.KILO.value, "B", 1)), jamonWriter); org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(load.getTotalStaticBloomSizeKB() * TraditionalBinaryPrefix.KILO.value, "B", 1)), jamonWriter); org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getDataLocality()), jamonWriter);
result = result && (hasRegionSpecifier() == other.hasRegionSpecifier()); if (hasRegionSpecifier()) { result = result && getRegionSpecifier() .equals(other.getRegionSpecifier()); result = result && (hasStores() == other.hasStores()); if (hasStores()) { result = result && (getStores() == other.getStores()); result = result && (hasStorefiles() == other.hasStorefiles()); if (hasStorefiles()) { result = result && (getStorefiles() == other.getStorefiles()); result = result && (hasStoreUncompressedSizeMB() == other.hasStoreUncompressedSizeMB()); if (hasStoreUncompressedSizeMB()) { result = result && (getStoreUncompressedSizeMB() == other.getStoreUncompressedSizeMB()); result = result && (hasStorefileSizeMB() == other.hasStorefileSizeMB()); if (hasStorefileSizeMB()) { result = result && (getStorefileSizeMB() == other.getStorefileSizeMB()); result = result && (hasMemStoreSizeMB() == other.hasMemStoreSizeMB()); if (hasMemStoreSizeMB()) { result = result && (getMemStoreSizeMB() == other.getMemStoreSizeMB());
hash = (19 * hash) + getDescriptor().hashCode(); if (hasRegionSpecifier()) { hash = (37 * hash) + REGION_SPECIFIER_FIELD_NUMBER; hash = (53 * hash) + getRegionSpecifier().hashCode(); if (hasStores()) { hash = (37 * hash) + STORES_FIELD_NUMBER; hash = (53 * hash) + getStores(); if (hasStorefiles()) { hash = (37 * hash) + STOREFILES_FIELD_NUMBER; hash = (53 * hash) + getStorefiles(); if (hasStoreUncompressedSizeMB()) { hash = (37 * hash) + STORE_UNCOMPRESSED_SIZE_MB_FIELD_NUMBER; hash = (53 * hash) + getStoreUncompressedSizeMB(); if (hasStorefileSizeMB()) { hash = (37 * hash) + STOREFILE_SIZE_MB_FIELD_NUMBER; hash = (53 * hash) + getStorefileSizeMB(); if (hasMemStoreSizeMB()) { hash = (37 * hash) + MEM_STORE_SIZE_MB_FIELD_NUMBER; hash = (53 * hash) + getMemStoreSizeMB(); if (hasStorefileIndexSizeKB()) { hash = (37 * hash) + STOREFILE_INDEX_SIZE_KB_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashLong( getStorefileIndexSizeKB());
public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionLoad other) { if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionLoad.getDefaultInstance()) return this; if (other.hasRegionSpecifier()) { mergeRegionSpecifier(other.getRegionSpecifier()); if (other.hasStores()) { setStores(other.getStores()); if (other.hasStorefiles()) { setStorefiles(other.getStorefiles()); if (other.hasStoreUncompressedSizeMB()) { setStoreUncompressedSizeMB(other.getStoreUncompressedSizeMB()); if (other.hasStorefileSizeMB()) { setStorefileSizeMB(other.getStorefileSizeMB()); if (other.hasMemStoreSizeMB()) { setMemStoreSizeMB(other.getMemStoreSizeMB()); if (other.hasStorefileIndexSizeKB()) { setStorefileIndexSizeKB(other.getStorefileIndexSizeKB()); if (other.hasReadRequestsCount()) { setReadRequestsCount(other.getReadRequestsCount()); if (other.hasWriteRequestsCount()) { setWriteRequestsCount(other.getWriteRequestsCount()); if (other.hasTotalCompactingKVs()) {
public static ClusterStatusProtos.RegionLoad toRegionLoad(RegionMetrics regionMetrics) { return ClusterStatusProtos.RegionLoad.newBuilder() .setRegionSpecifier(HBaseProtos.RegionSpecifier .newBuilder().setType(HBaseProtos.RegionSpecifier.RegionSpecifierType.REGION_NAME)
public static RegionMetrics toRegionMetrics(ClusterStatusProtos.RegionLoad regionLoadPB) { return RegionMetricsBuilder .newBuilder(regionLoadPB.getRegionSpecifier().getValue().toByteArray()) .setBloomFilterSize(new Size(regionLoadPB.getTotalStaticBloomSizeKB(), Size.Unit.KILOBYTE)) .setCompactedCellCount(regionLoadPB.getCurrentCompactedKVs()) .setCompactingCellCount(regionLoadPB.getTotalCompactingKVs()) .setCompletedSequenceId(regionLoadPB.getCompleteSequenceId()) .setDataLocality(regionLoadPB.hasDataLocality() ? regionLoadPB.getDataLocality() : 0.0f) .setFilteredReadRequestCount(regionLoadPB.getFilteredReadRequestsCount()) .setStoreFileUncompressedDataIndexSize(new Size(regionLoadPB.getTotalStaticIndexSizeKB(), Size.Unit.KILOBYTE)) .setLastMajorCompactionTimestamp(regionLoadPB.getLastMajorCompactionTs()) .setMemStoreSize(new Size(regionLoadPB.getMemStoreSizeMB(), Size.Unit.MEGABYTE)) .setReadRequestCount(regionLoadPB.getReadRequestsCount()) .setWriteRequestCount(regionLoadPB.getWriteRequestsCount()) .setStoreFileIndexSize(new Size(regionLoadPB.getStorefileIndexSizeKB(), Size.Unit.KILOBYTE)) .setStoreFileRootLevelIndexSize(new Size(regionLoadPB.getRootIndexSizeKB(), Size.Unit.KILOBYTE)) .setStoreCount(regionLoadPB.getStores()) .setStoreFileCount(regionLoadPB.getStorefiles()) .setStoreFileSize(new Size(regionLoadPB.getStorefileSizeMB(), Size.Unit.MEGABYTE)) .setStoreSequenceIds(regionLoadPB.getStoreCompleteSequenceIdList().stream() .collect(Collectors.toMap( (ClusterStatusProtos.StoreSequenceId s) -> s.getFamilyName().toByteArray(), ClusterStatusProtos.StoreSequenceId::getSequenceId))) .setUncompressedStoreFileSize( new Size(regionLoadPB.getStoreUncompressedSizeMB(),Size.Unit.MEGABYTE)) .build(); }
private ClusterStatusProtos.ServerLoad createServerLoadProto() { HBaseProtos.RegionSpecifier rSpecOne = HBaseProtos.RegionSpecifier.newBuilder() .setType(HBaseProtos.RegionSpecifier.RegionSpecifierType.ENCODED_REGION_NAME) .setValue(ByteString.copyFromUtf8("ASDFGQWERT")).build(); HBaseProtos.RegionSpecifier rSpecTwo = HBaseProtos.RegionSpecifier.newBuilder() .setType(HBaseProtos.RegionSpecifier.RegionSpecifierType.ENCODED_REGION_NAME) .setValue(ByteString.copyFromUtf8("QWERTYUIOP")).build(); ClusterStatusProtos.RegionLoad rlOne = ClusterStatusProtos.RegionLoad.newBuilder().setRegionSpecifier(rSpecOne).setStores(10) .setStorefiles(101).setStoreUncompressedSizeMB(106).setStorefileSizeMB(520) .setFilteredReadRequestsCount(100).setStorefileIndexSizeKB(42).setRootIndexSizeKB(201) .setReadRequestsCount(Integer.MAX_VALUE).setWriteRequestsCount(Integer.MAX_VALUE) .build(); ClusterStatusProtos.RegionLoad rlTwo = ClusterStatusProtos.RegionLoad.newBuilder().setRegionSpecifier(rSpecTwo).setStores(3) .setStorefiles(13).setStoreUncompressedSizeMB(23).setStorefileSizeMB(300) .setFilteredReadRequestsCount(200).setStorefileIndexSizeKB(40).setRootIndexSizeKB(303) .setReadRequestsCount(Integer.MAX_VALUE).setWriteRequestsCount(Integer.MAX_VALUE) .build(); ClusterStatusProtos.ServerLoad sl = ClusterStatusProtos.ServerLoad.newBuilder().addRegionLoads(rlOne). addRegionLoads(rlTwo).build(); return sl; }
private ClusterStatusProtos.ServerLoad createServerLoadProto() { HBaseProtos.RegionSpecifier rSpecOne = HBaseProtos.RegionSpecifier.newBuilder() .setType(HBaseProtos.RegionSpecifier.RegionSpecifierType.ENCODED_REGION_NAME) .setValue(ByteString.copyFromUtf8("ASDFGQWERT")).build(); HBaseProtos.RegionSpecifier rSpecTwo = HBaseProtos.RegionSpecifier.newBuilder() .setType(HBaseProtos.RegionSpecifier.RegionSpecifierType.ENCODED_REGION_NAME) .setValue(ByteString.copyFromUtf8("QWERTYUIOP")).build(); ClusterStatusProtos.RegionLoad rlOne = ClusterStatusProtos.RegionLoad.newBuilder().setRegionSpecifier(rSpecOne).setStores(10) .setStorefiles(101).setStoreUncompressedSizeMB(106).setStorefileSizeMB(520) .setFilteredReadRequestsCount(100).setStorefileIndexSizeKB(42).setRootIndexSizeKB(201) .setReadRequestsCount(Integer.MAX_VALUE).setWriteRequestsCount(Integer.MAX_VALUE).build(); ClusterStatusProtos.RegionLoad rlTwo = ClusterStatusProtos.RegionLoad.newBuilder().setRegionSpecifier(rSpecTwo).setStores(3) .setStorefiles(13).setStoreUncompressedSizeMB(23).setStorefileSizeMB(300) .setFilteredReadRequestsCount(200).setStorefileIndexSizeKB(40).setRootIndexSizeKB(303) .setReadRequestsCount(Integer.MAX_VALUE).setWriteRequestsCount(Integer.MAX_VALUE).build(); ClusterStatusProtos.ServerLoad sl = ClusterStatusProtos.ServerLoad.newBuilder().addRegionLoads(rlOne). addRegionLoads(rlTwo).build(); return sl; }
private RegionServerStatusProtos.RegionServerReportRequest.Builder makeRSReportRequestWithRegions(final ServerName sn, HRegionInfo... regions) { ClusterStatusProtos.ServerLoad.Builder sl = ClusterStatusProtos.ServerLoad.newBuilder(); for (int i = 0; i < regions.length; i++) { HBaseProtos.RegionSpecifier.Builder rs = HBaseProtos.RegionSpecifier.newBuilder(); rs.setType(HBaseProtos.RegionSpecifier.RegionSpecifierType.REGION_NAME); rs.setValue(UnsafeByteOperations.unsafeWrap(regions[i].getRegionName())); ClusterStatusProtos.RegionLoad.Builder rl = ClusterStatusProtos.RegionLoad.newBuilder() .setRegionSpecifier(rs.build()); sl.addRegionLoads(i, rl.build()); } return RegionServerStatusProtos.RegionServerReportRequest.newBuilder() .setServer(ProtobufUtil.toServerName(sn)) .setLoad(sl); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public static long getTotalRequestsCount(RegionLoad rl) { if (rl == null) { return 0; } return rl.getReadRequestsCount() + rl.getWriteRequestsCount(); }
public static ClusterStatusProtos.RegionLoad toRegionLoad(RegionMetrics regionMetrics) { return ClusterStatusProtos.RegionLoad.newBuilder() .setRegionSpecifier(HBaseProtos.RegionSpecifier .newBuilder().setType(HBaseProtos.RegionSpecifier.RegionSpecifierType.REGION_NAME)
public static RegionMetrics toRegionMetrics(ClusterStatusProtos.RegionLoad regionLoadPB) { return RegionMetricsBuilder .newBuilder(regionLoadPB.getRegionSpecifier().getValue().toByteArray()) .setBloomFilterSize(new Size(regionLoadPB.getTotalStaticBloomSizeKB(), Size.Unit.KILOBYTE)) .setCompactedCellCount(regionLoadPB.getCurrentCompactedKVs()) .setCompactingCellCount(regionLoadPB.getTotalCompactingKVs()) .setCompletedSequenceId(regionLoadPB.getCompleteSequenceId()) .setDataLocality(regionLoadPB.hasDataLocality() ? regionLoadPB.getDataLocality() : 0.0f) .setFilteredReadRequestCount(regionLoadPB.getFilteredReadRequestsCount()) .setStoreFileUncompressedDataIndexSize(new Size(regionLoadPB.getTotalStaticIndexSizeKB(), Size.Unit.KILOBYTE)) .setLastMajorCompactionTimestamp(regionLoadPB.getLastMajorCompactionTs()) .setMemStoreSize(new Size(regionLoadPB.getMemStoreSizeMB(), Size.Unit.MEGABYTE)) .setReadRequestCount(regionLoadPB.getReadRequestsCount()) .setWriteRequestCount(regionLoadPB.getWriteRequestsCount()) .setStoreFileIndexSize(new Size(regionLoadPB.getStorefileIndexSizeKB(), Size.Unit.KILOBYTE)) .setStoreFileRootLevelIndexSize(new Size(regionLoadPB.getRootIndexSizeKB(), Size.Unit.KILOBYTE)) .setStoreCount(regionLoadPB.getStores()) .setStoreFileCount(regionLoadPB.getStorefiles()) .setStoreFileSize(new Size(regionLoadPB.getStorefileSizeMB(), Size.Unit.MEGABYTE)) .setStoreSequenceIds(regionLoadPB.getStoreCompleteSequenceIdList().stream() .collect(Collectors.toMap( (ClusterStatusProtos.StoreSequenceId s) -> s.getFamilyName().toByteArray(), ClusterStatusProtos.StoreSequenceId::getSequenceId))) .setUncompressedStoreFileSize( new Size(regionLoadPB.getStoreUncompressedSizeMB(),Size.Unit.MEGABYTE)) .build(); }
public static long getTotalRequestsCount(RegionLoad rl) { if (rl == null) { return 0; } return rl.getReadRequestsCount() + rl.getWriteRequestsCount(); }
result = result && (hasRegionSpecifier() == other.hasRegionSpecifier()); if (hasRegionSpecifier()) { result = result && getRegionSpecifier() .equals(other.getRegionSpecifier()); result = result && (hasStores() == other.hasStores()); if (hasStores()) { result = result && (getStores() == other.getStores()); result = result && (hasStorefiles() == other.hasStorefiles()); if (hasStorefiles()) { result = result && (getStorefiles() == other.getStorefiles()); result = result && (hasStoreUncompressedSizeMB() == other.hasStoreUncompressedSizeMB()); if (hasStoreUncompressedSizeMB()) { result = result && (getStoreUncompressedSizeMB() == other.getStoreUncompressedSizeMB()); result = result && (hasStorefileSizeMB() == other.hasStorefileSizeMB()); if (hasStorefileSizeMB()) { result = result && (getStorefileSizeMB() == other.getStorefileSizeMB()); result = result && (hasMemStoreSizeMB() == other.hasMemStoreSizeMB()); if (hasMemStoreSizeMB()) { result = result && (getMemStoreSizeMB() == other.getMemStoreSizeMB());
hash = (19 * hash) + getDescriptor().hashCode(); if (hasRegionSpecifier()) { hash = (37 * hash) + REGION_SPECIFIER_FIELD_NUMBER; hash = (53 * hash) + getRegionSpecifier().hashCode(); if (hasStores()) { hash = (37 * hash) + STORES_FIELD_NUMBER; hash = (53 * hash) + getStores(); if (hasStorefiles()) { hash = (37 * hash) + STOREFILES_FIELD_NUMBER; hash = (53 * hash) + getStorefiles(); if (hasStoreUncompressedSizeMB()) { hash = (37 * hash) + STORE_UNCOMPRESSED_SIZE_MB_FIELD_NUMBER; hash = (53 * hash) + getStoreUncompressedSizeMB(); if (hasStorefileSizeMB()) { hash = (37 * hash) + STOREFILE_SIZE_MB_FIELD_NUMBER; hash = (53 * hash) + getStorefileSizeMB(); if (hasMemStoreSizeMB()) { hash = (37 * hash) + MEM_STORE_SIZE_MB_FIELD_NUMBER; hash = (53 * hash) + getMemStoreSizeMB(); if (hasStorefileIndexSizeKB()) { hash = (37 * hash) + STOREFILE_INDEX_SIZE_KB_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashLong( getStorefileIndexSizeKB());
r.getHDFSBlocksDistribution().getBlockLocalityIndex(serverName.getHostname()); if (regionLoadBldr == null) { regionLoadBldr = RegionLoad.newBuilder();
public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionLoad other) { if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionLoad.getDefaultInstance()) return this; if (other.hasRegionSpecifier()) { mergeRegionSpecifier(other.getRegionSpecifier()); if (other.hasStores()) { setStores(other.getStores()); if (other.hasStorefiles()) { setStorefiles(other.getStorefiles()); if (other.hasStoreUncompressedSizeMB()) { setStoreUncompressedSizeMB(other.getStoreUncompressedSizeMB()); if (other.hasStorefileSizeMB()) { setStorefileSizeMB(other.getStorefileSizeMB()); if (other.hasMemStoreSizeMB()) { setMemStoreSizeMB(other.getMemStoreSizeMB()); if (other.hasStorefileIndexSizeKB()) { setStorefileIndexSizeKB(other.getStorefileIndexSizeKB()); if (other.hasReadRequestsCount()) { setReadRequestsCount(other.getReadRequestsCount()); if (other.hasWriteRequestsCount()) { setWriteRequestsCount(other.getWriteRequestsCount()); if (other.hasTotalCompactingKVs()) {