/** * Builds the protobuf message to inform the Master of files being archived. * * @param tn The table the files previously belonged to. * @param archivedFiles The files and their size in bytes that were archived. * @return The protobuf representation */ public RegionServerStatusProtos.FileArchiveNotificationRequest buildFileArchiveRequest( TableName tn, Collection<Entry<String,Long>> archivedFiles) { RegionServerStatusProtos.FileArchiveNotificationRequest.Builder builder = RegionServerStatusProtos.FileArchiveNotificationRequest.newBuilder(); HBaseProtos.TableName protoTn = ProtobufUtil.toProtoTableName(tn); for (Entry<String,Long> archivedFile : archivedFiles) { RegionServerStatusProtos.FileArchiveNotificationRequest.FileWithSize fws = RegionServerStatusProtos.FileArchiveNotificationRequest.FileWithSize.newBuilder() .setName(archivedFile.getKey()) .setSize(archivedFile.getValue()) .setTableName(protoTn) .build(); builder.addArchivedFiles(fws); } final RegionServerStatusProtos.FileArchiveNotificationRequest request = builder.build(); if (LOG.isTraceEnabled()) { LOG.trace("Reporting file archival to Master: " + TextFormat.shortDebugString(request)); } return request; }
public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.FileArchiveNotificationRequest.FileWithSize other) { if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.FileArchiveNotificationRequest.FileWithSize.getDefaultInstance()) return this; if (other.hasTableName()) { mergeTableName(other.getTableName()); } if (other.hasName()) { bitField0_ |= 0x00000002; name_ = other.name_; onChanged(); } if (other.hasSize()) { setSize(other.getSize()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }