本文整理汇总了C#中Reader.getStripes方法的典型用法代码示例。如果您正苦于以下问题:C# Reader.getStripes方法的具体用法?C# Reader.getStripes怎么用?C# Reader.getStripes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reader
的用法示例。
在下文中一共展示了Reader.getStripes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: discoverOriginalKeyBounds
/**
* Find the key range for original bucket files.
* @param reader the reader
* @param bucket the bucket number we are reading
* @param options the options for reading with
* @
*/
private void discoverOriginalKeyBounds(Reader reader, int bucket,
Reader.Options options
)
{
long rowLength = 0;
long rowOffset = 0;
long offset = options.getOffset();
long maxOffset = options.getMaxOffset();
bool isTail = true;
foreach (StripeInformation stripe in reader.getStripes())
{
if (offset > stripe.getOffset())
{
rowOffset += stripe.getNumberOfRows();
}
else if (maxOffset > stripe.getOffset())
{
rowLength += stripe.getNumberOfRows();
}
else
{
isTail = false;
break;
}
}
if (rowOffset > 0)
{
minKey = new RecordIdentifier(0, bucket, rowOffset - 1);
}
if (!isTail)
{
maxKey = new RecordIdentifier(0, bucket, rowOffset + rowLength - 1);
}
}
示例2: discoverKeyBounds
/**
* Find the key range for bucket files.
* @param reader the reader
* @param options the options for reading with
* @
*/
private void discoverKeyBounds(Reader reader,
Reader.Options options)
{
RecordIdentifier[] keyIndex = OrcRecordUpdater.parseKeyIndex(reader);
long offset = options.getOffset();
long maxOffset = options.getMaxOffset();
int firstStripe = 0;
int stripeCount = 0;
bool isTail = true;
List<StripeInformation> stripes = reader.getStripes();
foreach (StripeInformation stripe in stripes)
{
if (offset > stripe.getOffset())
{
firstStripe += 1;
}
else if (maxOffset > stripe.getOffset())
{
stripeCount += 1;
}
else
{
isTail = false;
break;
}
}
if (firstStripe != 0)
{
minKey = keyIndex[firstStripe - 1];
}
if (!isTail)
{
maxKey = keyIndex[firstStripe + stripeCount - 1];
}
}