• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BufferedIndexInput类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.lucene.store.BufferedIndexInput的典型用法代码示例。如果您正苦于以下问题:Java BufferedIndexInput类的具体用法?Java BufferedIndexInput怎么用?Java BufferedIndexInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BufferedIndexInput类属于org.apache.lucene.store包,在下文中一共展示了BufferedIndexInput类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: MultiLevelSkipListReader

import org.apache.lucene.store.BufferedIndexInput; //导入依赖的package包/类
/** Creates a {@code MultiLevelSkipListReader}. */
protected MultiLevelSkipListReader(IndexInput skipStream, int maxSkipLevels, int skipInterval, int skipMultiplier) {
  this.skipStream = new IndexInput[maxSkipLevels];
  this.skipPointer = new long[maxSkipLevels];
  this.childPointer = new long[maxSkipLevels];
  this.numSkipped = new int[maxSkipLevels];
  this.maxNumberOfSkipLevels = maxSkipLevels;
  this.skipInterval = new int[maxSkipLevels];
  this.skipMultiplier = skipMultiplier;
  this.skipStream [0]= skipStream;
  this.inputIsBuffered = (skipStream instanceof BufferedIndexInput);
  this.skipInterval[0] = skipInterval;
  for (int i = 1; i < maxSkipLevels; i++) {
    // cache skip intervals
    this.skipInterval[i] = this.skipInterval[i - 1] * skipMultiplier;
  }
  skipDoc = new int[maxSkipLevels];
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:MultiLevelSkipListReader.java


示例2: slice

import org.apache.lucene.store.BufferedIndexInput; //导入依赖的package包/类
@Override
public IndexInput slice(final String sliceDescription, final long offset, final long length) throws IOException {
    // TODO Auto-generated method stub
    logger.debug("FetchOnBufferReadJdbcIndexInput.slice()");

    final RAMInputStream r = null;
    final BufferedIndexInput b = null;
    final ChecksumIndexInput c = null;
    return new SlicedIndexInput(sliceDescription, this, offset, length);
}
 
开发者ID:unkascrack,项目名称:lucene-jdbcdirectory,代码行数:11,代码来源:FetchOnBufferReadJdbcIndexInput.java


示例3: SlicedIndexInput

import org.apache.lucene.store.BufferedIndexInput; //导入依赖的package包/类
SlicedIndexInput(final String sliceDescription, final IndexInput base, final long offset, final long length) {
    super(sliceDescription == null ? base.toString() : base.toString() + " [slice=" + sliceDescription + "]",
            BufferedIndexInput.BUFFER_SIZE);
    if (offset < 0 || length < 0 || offset + length > base.length()) {
        throw new IllegalArgumentException("slice() " + sliceDescription + " out of bounds: " + base);
    }
    this.base = base.clone();
    fileOffset = offset;
    this.length = length;
}
 
开发者ID:unkascrack,项目名称:lucene-jdbcdirectory,代码行数:11,代码来源:FetchOnBufferReadJdbcIndexInput.java


示例4: TermInfosReader

import org.apache.lucene.store.BufferedIndexInput; //导入依赖的package包/类
TermInfosReader(Directory dir, String seg, FieldInfos fis)
     throws CorruptIndexException, IOException {
  this(dir, seg, fis, BufferedIndexInput.BUFFER_SIZE);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:5,代码来源:TermInfosReader.java


示例5: loadSkipLevels

import org.apache.lucene.store.BufferedIndexInput; //导入依赖的package包/类
/** Loads the skip levels  */
private void loadSkipLevels() throws IOException {
  if (docCount <= skipInterval[0]) {
    numberOfSkipLevels = 1;
  } else {
    numberOfSkipLevels = 1+MathUtil.log(docCount/skipInterval[0], skipMultiplier);
  }

  if (numberOfSkipLevels > maxNumberOfSkipLevels) {
    numberOfSkipLevels = maxNumberOfSkipLevels;
  }

  skipStream[0].seek(skipPointer[0]);
  
  int toBuffer = numberOfLevelsToBuffer;
  
  for (int i = numberOfSkipLevels - 1; i > 0; i--) {
    // the length of the current level
    long length = skipStream[0].readVLong();
    
    // the start pointer of the current level
    skipPointer[i] = skipStream[0].getFilePointer();
    if (toBuffer > 0) {
      // buffer this level
      skipStream[i] = new SkipBuffer(skipStream[0], (int) length);
      toBuffer--;
    } else {
      // clone this stream, it is already at the start of the current level
      skipStream[i] = skipStream[0].clone();
      if (inputIsBuffered && length < BufferedIndexInput.BUFFER_SIZE) {
        ((BufferedIndexInput) skipStream[i]).setBufferSize(Math.max(BufferedIndexInput.MIN_BUFFER_SIZE, (int) length));
      }
      
      // move base stream beyond the current level
      skipStream[0].seek(skipStream[0].getFilePointer() + length);
    }
  }
 
  // use base stream for the lowest level
  skipPointer[0] = skipStream[0].getFilePointer();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:42,代码来源:MultiLevelSkipListReader.java


示例6: slice

import org.apache.lucene.store.BufferedIndexInput; //导入依赖的package包/类
@Override
public IndexInput slice(String description, long offset, long length) throws IOException {
    return BufferedIndexInput.wrap(description, this, offset, length);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:5,代码来源:LZFCompressedIndexInput.java


示例7: FaultyIndexInput

import org.apache.lucene.store.BufferedIndexInput; //导入依赖的package包/类
private FaultyIndexInput(IndexInput delegate) {
  super("FaultyIndexInput(" + delegate + ")", BufferedIndexInput.BUFFER_SIZE);
  this.delegate = delegate;
}
 
开发者ID:europeana,项目名称:search,代码行数:5,代码来源:TestFieldsReader.java


示例8: slice

import org.apache.lucene.store.BufferedIndexInput; //导入依赖的package包/类
@Override
public IndexInput slice(String sliceDescription, long offset, long length) throws IOException {
  return BufferedIndexInput.wrap(sliceDescription, this, offset, length);
}
 
开发者ID:europeana,项目名称:search,代码行数:5,代码来源:CustomBufferedIndexInput.java


示例9: MockIndexInput

import org.apache.lucene.store.BufferedIndexInput; //导入依赖的package包/类
public MockIndexInput(byte[] bytes) {
    super("MockIndexInput", BufferedIndexInput.BUFFER_SIZE);
    buffer = bytes;
    length = bytes.length;
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:6,代码来源:MockIndexInput.java


示例10: loadSkipLevels

import org.apache.lucene.store.BufferedIndexInput; //导入依赖的package包/类
/** Loads the skip levels  */
private void loadSkipLevels() throws IOException {
  if (docCount <= skipInterval[0]) {
    numberOfSkipLevels = 1;
  } else {
    numberOfSkipLevels = 1+MathUtil.log(docCount/skipInterval[0], skipMultiplier);
  }

  if (numberOfSkipLevels > maxNumberOfSkipLevels) {
    numberOfSkipLevels = maxNumberOfSkipLevels;
  }

  skipStream[0].seek(skipPointer[0]);
  
  int toBuffer = numberOfLevelsToBuffer;
  
  for (int i = numberOfSkipLevels - 1; i > 0; i--) {
    // the length of the current level
    long length = skipStream[0].readVLong();
    
    // the start pointer of the current level
    skipPointer[i] = skipStream[0].getFilePointer();
    if (toBuffer > 0) {
      // buffer this level
      skipStream[i] = new SkipBuffer(skipStream[0], (int) length);
      toBuffer--;
    } else {
      // clone this stream, it is already at the start of the current level
      skipStream[i] = skipStream[0].clone();
      if (inputIsBuffered && length < BufferedIndexInput.BUFFER_SIZE) {
        ((BufferedIndexInput) skipStream[i]).setBufferSize((int) length);
      }
      
      // move base stream beyond the current level
      skipStream[0].seek(skipStream[0].getFilePointer() + length);
    }
  }
 
  // use base stream for the lowest level
  skipPointer[0] = skipStream[0].getFilePointer();
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:42,代码来源:MultiLevelSkipListReader.java


示例11: openInput

import org.apache.lucene.store.BufferedIndexInput; //导入依赖的package包/类
synchronized public IndexInput openInput(String name) throws IOException {
    return openInput(name, BufferedIndexInput.BUFFER_SIZE);
}
 
开发者ID:xuzhikethinker,项目名称:t4f-data,代码行数:4,代码来源:TrackingFSDirectory.java



注:本文中的org.apache.lucene.store.BufferedIndexInput类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TabClosingPolicy类代码示例发布时间:2022-05-21
下一篇:
Java ICommonContentExtensionSite类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap