private List<StripeInformation> createStripes(long... rowCounts) { long offset = 0; List<StripeInformation> result = new ArrayList<StripeInformation>(rowCounts.length); for(long count: rowCounts) { OrcProto.StripeInformation.Builder stripe = OrcProto.StripeInformation.newBuilder(); stripe.setDataLength(800).setIndexLength(100).setFooterLength(100) .setNumberOfRows(count).setOffset(offset); offset += 1000; result.add(new ReaderImpl.StripeInformationImpl(stripe.build())); } return result; }
footer.addStripes(OrcProto.StripeInformation.newBuilder() .setOffset(offset) .setIndexLength(0) .setDataLength(stripeLength-10) .setFooterLength(10)
.setOffset(start) .setNumberOfRows(rowsInStripe) .setIndexLength(stripeInfo.getIndexLength()) .setDataLength(stripeInfo.getDataLength()) .setFooterLength(stripeInfo.getFooterLength())
.setOffset(start) .setNumberOfRows(rowsInStripe) .setIndexLength(indexSize) .setDataLength(dataSize) .setFooterLength(footerLength).build();
.setOffset(start) .setNumberOfRows(rowsInStripe) .setIndexLength(indexSize) .setDataLength(dataSize) .setFooterLength(footerLength).build();
.setOffset(start) .setNumberOfRows(rowsInStripe) .setIndexLength(stripeInfo.getIndexLength()) .setDataLength(stripeInfo.getDataLength()) .setFooterLength(stripeInfo.getFooterLength())
dirEntry.setIndexLength(indexSize).setDataLength(dataSize);
@Override public void appendStripe(byte[] stripe, int offset, int length, StripeInformation stripeInfo, OrcProto.StripeStatistics stripeStatistics) throws IOException { checkArgument(stripe != null, "Stripe must not be null"); checkArgument(length <= stripe.length, "Specified length must not be greater specified array length"); checkArgument(stripeInfo != null, "Stripe information must not be null"); checkArgument(stripeStatistics != null, "Stripe statistics must not be null"); rowsInStripe = stripeInfo.getNumberOfRows(); // update stripe information OrcProto.StripeInformation.Builder dirEntry = OrcProto.StripeInformation .newBuilder() .setNumberOfRows(rowsInStripe) .setIndexLength(stripeInfo.getIndexLength()) .setDataLength(stripeInfo.getDataLength()) .setFooterLength(stripeInfo.getFooterLength()); physicalWriter.appendRawStripe(ByteBuffer.wrap(stripe, offset, length), dirEntry); // since we have already written the stripe, just update stripe statistics treeWriter.updateFileStatistics(stripeStatistics); fileMetadata.addStripeStats(stripeStatistics); stripes.add(dirEntry.build()); // reset it after writing the stripe rowCount += rowsInStripe; rowsInStripe = 0; }
public Builder mergeFrom(org.apache.orc.OrcProto.StripeInformation other) { if (other == org.apache.orc.OrcProto.StripeInformation.getDefaultInstance()) return this; if (other.hasOffset()) { setOffset(other.getOffset()); } if (other.hasIndexLength()) { setIndexLength(other.getIndexLength()); } if (other.hasDataLength()) { setDataLength(other.getDataLength()); } if (other.hasFooterLength()) { setFooterLength(other.getFooterLength()); } if (other.hasNumberOfRows()) { setNumberOfRows(other.getNumberOfRows()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }