MCPcopy Index your code
hub / github.com/apache/orc / findStripeInfo

Method findStripeInfo

java/tools/src/java/org/apache/orc/tools/ScanData.java:86–99  ·  view source on GitHub ↗

Given a row, find the stripe that contains that row. @param reader the file reader @param row the global row number in the file @return the information about that row in the file

(Reader reader, long row)

Source from the content-addressed store, hash-verified

84 * @return the information about that row in the file
85 */
86 static LocationInfo findStripeInfo(Reader reader, long row) {
87 long firstRow = 0;
88 int stripeId = 0;
89 for (StripeInformation stripe: reader.getStripes()) {
90 long lastRow = firstRow + stripe.getNumberOfRows();
91 if (firstRow <= row && row < lastRow) {
92 return new LocationInfo(firstRow, lastRow, stripeId, row);
93 }
94 firstRow = lastRow;
95 stripeId += 1;
96 }
97 return new LocationInfo(reader.getNumberOfRows(),
98 reader.getNumberOfRows(), reader.getStripes().size(), row);
99 }
100
101 /**
102 * Given a failure point, find the first place that the ORC reader can

Callers 2

findRecoveryPointMethod · 0.95
mainMethod · 0.95

Calls 3

getStripesMethod · 0.65
getNumberOfRowsMethod · 0.65
sizeMethod · 0.65

Tested by

no test coverage detected