當前位置: 首頁>>代碼示例>>Java>>正文


Java Util類代碼示例

本文整理匯總了Java中parquet.format.Util的典型用法代碼示例。如果您正苦於以下問題:Java Util類的具體用法?Java Util怎麽用?Java Util使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Util類屬於parquet.format包,在下文中一共展示了Util類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readPageHeader

import parquet.format.Util; //導入依賴的package包/類
protected PageHeader readPageHeader() throws IOException {
    PageHeader pageHeader;
    int initialPos = this.pos;
    try {
        pageHeader = Util.readPageHeader(this);
    } catch (IOException e) {
        // this is to workaround a bug where the compressedLength
        // of the chunk is missing the size of the header of the dictionary
        // to allow reading older files (using dictionary) we need this.
        // usually 13 to 19 bytes are missing
        // if the last page is smaller than this, the page header itself is truncated in the buffer.
        this.pos = initialPos; // resetting the buffer to the position before we got the error
        LOG.info("completing the column chunk to read the page header");
        pageHeader = Util.readPageHeader(new SequenceInputStream(this, f)); // trying again from the buffer + remainder of the stream.
    }
    return pageHeader;
}
 
開發者ID:grokcoder,項目名稱:pbase,代碼行數:18,代碼來源:ParquetFileReader.java

示例2: readDictionaryPage

import parquet.format.Util; //導入依賴的package包/類
private static DictionaryPage readDictionaryPage(byte[] data, ParquetCodecFactory codecFactory, CompressionCodecName codecName)
{
    try {
        ByteArrayInputStream inputStream = new ByteArrayInputStream(data);
        PageHeader pageHeader = Util.readPageHeader(inputStream);

        if (pageHeader.type != PageType.DICTIONARY_PAGE) {
            return null;
        }

        // todo this wrapper is not needed
        BytesInput compressedData = BytesInput.from(data, data.length - inputStream.available(), pageHeader.getCompressed_page_size());

        BytesDecompressor decompressor = codecFactory.getDecompressor(codecName);
        BytesInput decompressed = decompressor.decompress(compressedData, pageHeader.getUncompressed_page_size());

        DictionaryPageHeader dicHeader = pageHeader.getDictionary_page_header();
        Encoding encoding = Encoding.valueOf(dicHeader.getEncoding().name());
        int dictionarySize = dicHeader.getNum_values();

        return new DictionaryPage(decompressed, dictionarySize, encoding);
    }
    catch (IOException ignored) {
        return null;
    }
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:27,代碼來源:ParquetPredicateUtils.java

示例3: readPageHeader

import parquet.format.Util; //導入依賴的package包/類
public PageHeader readPageHeader() throws IOException{
  return Util.readPageHeader(input);
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:4,代碼來源:ColumnDataReader.java

示例4: readPageHeader

import parquet.format.Util; //導入依賴的package包/類
protected PageHeader readPageHeader()
        throws IOException
{
    return Util.readPageHeader(this);
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:6,代碼來源:ParquetColumnChunk.java


注:本文中的parquet.format.Util類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。