当前位置: 首页>>代码示例>>Java>>正文


Java Version类代码示例

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


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

示例1: TFileMeta

import org.apache.hadoop.io.file.tfile.Utils.Version; //导入依赖的package包/类
public TFileMeta(DataInput in) throws IOException {
  version = new Version(in);
  if (!version.compatibleWith(TFile.API_VERSION)) {
    throw new RuntimeException("Incompatible TFile fileVersion.");
  }
  recordCount = Utils.readVLong(in);
  strComparator = Utils.readString(in);
  comparator = makeComparator(strComparator);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:10,代码来源:TFile.java

示例2: Reader

import org.apache.hadoop.io.file.tfile.Utils.Version; //导入依赖的package包/类
/**
 * Constructor
 * 
 * @param fin
 *          FS input stream.
 * @param fileLength
 *          Length of the corresponding file
 * @throws IOException
 */
public Reader(FSDataInputStream fin, long fileLength, Configuration conf)
    throws IOException {
  this.in = fin;
  this.conf = conf;

  // move the cursor to the beginning of the tail, containing: offset to the
  // meta block index, version and magic
  fin.seek(fileLength - Magic.size() - Version.size() - Long.SIZE
      / Byte.SIZE);
  long offsetIndexMeta = fin.readLong();
  version = new Version(fin);
  Magic.readAndVerify(fin);

  if (!version.compatibleWith(BCFile.API_VERSION)) {
    throw new RuntimeException("Incompatible BCFile fileBCFileVersion.");
  }

  // read meta index
  fin.seek(offsetIndexMeta);
  metaIndex = new MetaIndex(fin);

  // read data:BCFile.index, the data block index
  BlockReader blockR = getMetaBlock(DataIndex.BLOCK_NAME);
  try {
    dataIndex = new DataIndex(blockR);
  } finally {
    blockR.close();
  }
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:39,代码来源:BCFile.java

示例3: Reader

import org.apache.hadoop.io.file.tfile.Utils.Version; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param fin
 *          FS input stream.
 * @param fileLength
 *          Length of the corresponding file
 * @throws IOException
 */
public Reader(FSDataInputStream fin, long fileLength, Configuration conf)
    throws IOException {
  this.in = fin;
  this.conf = conf;
  // A reader buffer to read the block
  baos = new ByteArrayOutputStream(DTFile.getFSInputBufferSize(conf) * 2);
  this.cacheKeys = new ArrayList<String>();
  // move the cursor to the beginning of the tail, containing: offset to the
  // meta block index, version and magic
  fin.seek(fileLength - Magic.size() - Version.size() - Long.SIZE
      / Byte.SIZE);
  long offsetIndexMeta = fin.readLong();
  version = new Version(fin);
  Magic.readAndVerify(fin);

  if (!version.compatibleWith(DTBCFile.API_VERSION)) {
    throw new RuntimeException("Incompatible BCFile fileBCFileVersion.");
  }

  // read meta index
  fin.seek(offsetIndexMeta);
  metaIndex = new MetaIndex(fin);

  // read data:BCFile.index, the data block index
  BlockReader blockR = getMetaBlock(DataIndex.BLOCK_NAME);
  try {
    dataIndex = new DataIndex(blockR);
  } finally {
    blockR.close();
  }
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:41,代码来源:DTBCFile.java

示例4: TFileMeta

import org.apache.hadoop.io.file.tfile.Utils.Version; //导入依赖的package包/类
public TFileMeta(DataInput in) throws IOException {
  version = new Version(in);
  if (!version.compatibleWith(DTFile.API_VERSION)) {
    throw new RuntimeException("Incompatible TFile fileVersion.");
  }
  recordCount = Utils.readVLong(in);
  strComparator = Utils.readString(in);
  comparator = makeComparator(strComparator);
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:10,代码来源:DTFile.java

示例5: getVersion

import org.apache.hadoop.io.file.tfile.Utils.Version; //导入依赖的package包/类
public Version getVersion() {
  return version;
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:4,代码来源:TFile.java


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