public void commitSection(FileSummary.Builder summary, SectionName name) throws IOException { long oldOffset = currentOffset; flushSectionOutputStream(); if (codec != null) { sectionOutputStream = codec.createOutputStream(underlyingOutputStream); } else { sectionOutputStream = underlyingOutputStream; } long length = fileChannel.position() - oldOffset; summary.addSections(FileSummary.Section.newBuilder().setName(name.name) .setLength(length).setOffset(currentOffset)); currentOffset += length; }
FileSummary fileSummary = fileSummaryBld.build(); if (LOG.isDebugEnabled()) { LOG.debug("Writing FileSummary: {" +
.setOndiskVersion(FSImageUtil.FILE_VERSION) .setLayoutVersion( context.getSourceNamesystem().getEffectiveLayoutVersion()); b.setCodec(codec.getClass().getCanonicalName()); sectionOutputStream = codec.createOutputStream(underlyingOutputStream); } else { FileSummary summary = b.build(); saveFileSummary(underlyingOutputStream, summary); underlyingOutputStream.close();
CompressionCodec codec = compress.getImageCodec(); if (codec != null) { summary.setCodec(codec.getClass().getCanonicalName());
.setOndiskVersion(FSImageUtil.FILE_VERSION) .setLayoutVersion(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION); b.setCodec(codec.getClass().getCanonicalName()); sectionOutputStream = codec.createOutputStream(underlyingOutputStream); } else { FileSummary summary = b.build(); saveFileSummary(underlyingOutputStream, summary); underlyingOutputStream.close();
.setOndiskVersion(FSImageUtil.FILE_VERSION) .setLayoutVersion(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION); b.setCodec(codec.getClass().getCanonicalName()); sectionOutputStream = codec.createOutputStream(underlyingOutputStream); } else { FileSummary summary = b.build(); saveFileSummary(underlyingOutputStream, summary); underlyingOutputStream.close();
public Builder mergeFrom(org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary other) { if (other == org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.getDefaultInstance()) return this; if (other.hasOndiskVersion()) { setOndiskVersion(other.getOndiskVersion()); setLayoutVersion(other.getLayoutVersion()); onChanged(); bitField0_ = (bitField0_ & ~0x00000008); } else { ensureSectionsIsMutable(); sections_.addAll(other.sections_); onChanged(); sectionsBuilder_ = io.prestosql.hadoop.$internal.com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getSectionsFieldBuilder() : null; } else { sectionsBuilder_.addAllMessages(other.sections_); this.mergeUnknownFields(other.getUnknownFields()); return this;
public Builder mergeFrom(org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary other) { if (other == org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.getDefaultInstance()) return this; if (other.hasOndiskVersion()) { setOndiskVersion(other.getOndiskVersion()); setLayoutVersion(other.getLayoutVersion()); onChanged(); bitField0_ = (bitField0_ & ~0x00000008); } else { ensureSectionsIsMutable(); sections_.addAll(other.sections_); onChanged(); sectionsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getSectionsFieldBuilder() : null; } else { sectionsBuilder_.addAllMessages(other.sections_); this.mergeUnknownFields(other.getUnknownFields()); return this;
FileSummary s = summary.build(); s.writeDelimitedTo(raw); int length = getOndiskSize(s);
/** * <code>repeated .hadoop.hdfs.fsimage.FileSummary.Section sections = 4;</code> */ public Builder addSections( int index, org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.Section value) { if (sectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSectionsIsMutable(); sections_.add(index, value); onChanged(); } else { sectionsBuilder_.addMessage(index, value); } return this; } /**
/** * <code>repeated .hadoop.hdfs.fsimage.FileSummary.Section sections = 4;</code> */ public Builder addSections( int index, org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.Section value) { if (sectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSectionsIsMutable(); sections_.add(index, value); onChanged(); } else { sectionsBuilder_.addMessage(index, value); } return this; } /**
/** * <code>repeated .hadoop.hdfs.fsimage.FileSummary.Section sections = 4;</code> */ public Builder setSections( int index, org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.Section value) { if (sectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSectionsIsMutable(); sections_.set(index, value); onChanged(); } else { sectionsBuilder_.setMessage(index, value); } return this; } /**
/** * <code>repeated .hadoop.hdfs.fsimage.FileSummary.Section sections = 4;</code> */ public Builder setSections( int index, org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.Section value) { if (sectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSectionsIsMutable(); sections_.set(index, value); onChanged(); } else { sectionsBuilder_.setMessage(index, value); } return this; } /**
/** * <code>repeated .hadoop.hdfs.fsimage.FileSummary.Section sections = 4;</code> */ public Builder addSections(org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.Section value) { if (sectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSectionsIsMutable(); sections_.add(value); onChanged(); } else { sectionsBuilder_.addMessage(value); } return this; } /**
/** * <code>repeated .hadoop.hdfs.fsimage.FileSummary.Section sections = 4;</code> */ public Builder addSections(org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.Section value) { if (sectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSectionsIsMutable(); sections_.add(value); onChanged(); } else { sectionsBuilder_.addMessage(value); } return this; } /**
/** * <code>repeated .hadoop.hdfs.fsimage.FileSummary.Section sections = 4;</code> */ public Builder addSections( org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.Section.Builder builderForValue) { if (sectionsBuilder_ == null) { ensureSectionsIsMutable(); sections_.add(builderForValue.build()); onChanged(); } else { sectionsBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .hadoop.hdfs.fsimage.FileSummary.Section sections = 4;</code> */ public Builder setSections( int index, org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.Section.Builder builderForValue) { if (sectionsBuilder_ == null) { ensureSectionsIsMutable(); sections_.set(index, builderForValue.build()); onChanged(); } else { sectionsBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .hadoop.hdfs.fsimage.FileSummary.Section sections = 4;</code> */ public Builder addSections( int index, org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.Section.Builder builderForValue) { if (sectionsBuilder_ == null) { ensureSectionsIsMutable(); sections_.add(index, builderForValue.build()); onChanged(); } else { sectionsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .hadoop.hdfs.fsimage.FileSummary.Section sections = 4;</code> */ public Builder addSections( int index, org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.Section.Builder builderForValue) { if (sectionsBuilder_ == null) { ensureSectionsIsMutable(); sections_.add(index, builderForValue.build()); onChanged(); } else { sectionsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .hadoop.hdfs.fsimage.FileSummary.Section sections = 4;</code> */ public Builder addAllSections( java.lang.Iterable<? extends org.apache.hadoop.hdfs.server.namenode.FsImageProto.FileSummary.Section> values) { if (sectionsBuilder_ == null) { ensureSectionsIsMutable(); super.addAll(values, sections_); onChanged(); } else { sectionsBuilder_.addAllMessages(values); } return this; } /**