org.apache.hadoop.hbase.regionserver.HStore.createStoreFileAndReader()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.apache.hadoop.hbase.regionserver.HStore.createStoreFileAndReader()方法的一些代码示例,展示了HStore.createStoreFileAndReader()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HStore.createStoreFileAndReader()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.regionserver.HStore
类名称:HStore
方法名:createStoreFileAndReader

HStore.createStoreFileAndReader介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

public void bulkLoadHFile(StoreFileInfo fileInfo) throws IOException {
 HStoreFile sf = createStoreFileAndReader(fileInfo);
 bulkLoadHFile(sf);
}

代码示例来源:origin: apache/hbase

/**
 * Validates a store file by opening and closing it. In HFileV2 this should not be an expensive
 * operation.
 * @param path the path to the store file
 */
private void validateStoreFile(Path path) throws IOException {
 HStoreFile storeFile = null;
 try {
  storeFile = createStoreFileAndReader(path);
 } catch (IOException e) {
  LOG.error("Failed to open store file : {}, keeping it in tmp location", path, e);
  throw e;
 } finally {
  if (storeFile != null) {
   storeFile.closeStoreFile(false);
  }
 }
}

代码示例来源:origin: apache/hbase

@VisibleForTesting
protected HStoreFile createStoreFileAndReader(final Path p) throws IOException {
 StoreFileInfo info = new StoreFileInfo(conf, this.getFileSystem(), p);
 return createStoreFileAndReader(info);
}

代码示例来源:origin: apache/hbase

HStoreFile moveFileIntoPlace(Path newFile) throws IOException {
 validateStoreFile(newFile);
 // Move the file into the right spot
 Path destPath = fs.commitStoreFile(getColumnFamilyName(), newFile);
 return createStoreFileAndReader(destPath);
}

代码示例来源:origin: apache/hbase

public Path bulkLoadHFile(byte[] family, String srcPathStr, Path dstPath) throws IOException {
 Path srcPath = new Path(srcPathStr);
 try {
  fs.commitStoreFile(srcPath, dstPath);
 } finally {
  if (this.getCoprocessorHost() != null) {
   this.getCoprocessorHost().postCommitStoreFile(family, srcPath, dstPath);
  }
 }
 LOG.info("Loaded HFile " + srcPath + " into store '" + getColumnFamilyName() + "' as "
   + dstPath + " - updating store file list.");
 HStoreFile sf = createStoreFileAndReader(dstPath);
 bulkLoadHFile(sf);
 LOG.info("Successfully loaded store file {} into store {} (new location: {})",
   srcPath, this, dstPath);
 return dstPath;
}

代码示例来源:origin: apache/hbase

for (StoreFileInfo storeFileInfo : files) {
 completionService.submit(() -> this.createStoreFileAndReader(storeFileInfo));
 totalValidStoreFile++;

代码示例来源:origin: apache/hbase

HStoreFile storeFile = createStoreFileAndReader(storeFileInfo);
outputStoreFiles.add(storeFile);

代码示例来源:origin: apache/hbase

/**
 * @param path The pathname of the tmp file into which the store was flushed
 * @param logCacheFlushId
 * @param status
 * @return store file created.
 * @throws IOException
 */
private HStoreFile commitFile(Path path, long logCacheFlushId, MonitoredTask status)
  throws IOException {
 // Write-out finished successfully, move into the right spot
 Path dstPath = fs.commitStoreFile(getColumnFamilyName(), path);
 status.setStatus("Flushing " + this + ": reopening flushed file");
 HStoreFile sf = createStoreFileAndReader(dstPath);
 StoreFileReader r = sf.getReader();
 this.storeSize.addAndGet(r.length());
 this.totalUncompressedBytes.addAndGet(r.getTotalUncompressedBytes());
 if (LOG.isInfoEnabled()) {
  LOG.info("Added " + sf + ", entries=" + r.getEntries() +
   ", sequenceid=" + logCacheFlushId +
   ", filesize=" + TraditionalBinaryPrefix.long2String(r.length(), "", 1));
 }
 return sf;
}

代码示例来源:origin: harbby/presto-connectors

@Override
public void bulkLoadHFile(StoreFileInfo fileInfo) throws IOException {
 StoreFile sf = createStoreFileAndReader(fileInfo);
 bulkLoadHFile(sf);
}

代码示例来源:origin: harbby/presto-connectors

private StoreFile createStoreFileAndReader(final Path p) throws IOException {
 StoreFileInfo info = new StoreFileInfo(conf, this.getFileSystem(), p);
 return createStoreFileAndReader(info);
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Validates a store file by opening and closing it. In HFileV2 this should
 * not be an expensive operation.
 *
 * @param path the path to the store file
 */
private void validateStoreFile(Path path)
  throws IOException {
 StoreFile storeFile = null;
 try {
  storeFile = createStoreFileAndReader(path);
 } catch (IOException e) {
  LOG.error("Failed to open store file : " + path
    + ", keeping it in tmp location", e);
  throw e;
 } finally {
  if (storeFile != null) {
   storeFile.closeReader(false);
  }
 }
}

代码示例来源:origin: harbby/presto-connectors

StoreFile moveFileIntoPlace(final Path newFile) throws IOException {
 validateStoreFile(newFile);
 // Move the file into the right spot
 Path destPath = fs.commitStoreFile(getColumnFamilyName(), newFile);
 return createStoreFileAndReader(destPath);
}

代码示例来源:origin: harbby/presto-connectors

@Override
public Path bulkLoadHFile(String srcPathStr, long seqNum) throws IOException {
 Path srcPath = new Path(srcPathStr);
 Path dstPath = fs.bulkLoadStoreFile(getColumnFamilyName(), srcPath, seqNum);
 LOG.info("Loaded HFile " + srcPath + " into store '" + getColumnFamilyName() + "' as "
   + dstPath + " - updating store file list.");
 StoreFile sf = createStoreFileAndReader(dstPath);
 bulkLoadHFile(sf);
 LOG.info("Successfully loaded store file " + srcPath + " into store " + this
   + " (new location: " + dstPath + ")");
 return dstPath;
}

代码示例来源:origin: harbby/presto-connectors

StoreFile storeFile = createStoreFileAndReader(storeFileInfo);
outputStoreFiles.add(storeFile);

代码示例来源:origin: harbby/presto-connectors

for (Path newFile : newFiles) {
 StoreFile sf = createStoreFileAndReader(newFile);
 sf.closeReader(evictOnClose);
 sfs.add(sf);

代码示例来源:origin: harbby/presto-connectors

private StoreFile commitFile(final Path path, final long logCacheFlushId, MonitoredTask status)
  throws IOException {
 // Write-out finished successfully, move into the right spot
 Path dstPath = fs.commitStoreFile(getColumnFamilyName(), path);
 status.setStatus("Flushing " + this + ": reopening flushed file");
 StoreFile sf = createStoreFileAndReader(dstPath);
 StoreFile.Reader r = sf.getReader();
 this.storeSize += r.length();
 this.totalUncompressedBytes += r.getTotalUncompressedBytes();
 if (LOG.isInfoEnabled()) {
  LOG.info("Added " + sf + ", entries=" + r.getEntries() +
   ", sequenceid=" + logCacheFlushId +
   ", filesize=" + TraditionalBinaryPrefix.long2String(r.length(), "", 1));
 }
 return sf;
}

相关文章

HStore类方法