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


Java MemStoreSnapshot类代码示例

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


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

示例1: flushSnapshot

import org.apache.hadoop.hbase.regionserver.MemStoreSnapshot; //导入依赖的package包/类
@Override
public List<Path> flushSnapshot(MemStoreSnapshot snapshot, long cacheFlushId,
    MonitoredTask status) throws IOException {
  if (throwExceptionWhenFlushing.get()) {
    throw new IOException("Simulated exception by tests");
  }
  return super.flushSnapshot(snapshot, cacheFlushId, status);
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:9,代码来源:TestWALReplay.java

示例2: flushSnapshot

import org.apache.hadoop.hbase.regionserver.MemStoreSnapshot; //导入依赖的package包/类
@Override
public List<Path> flushSnapshot(MemStoreSnapshot snapshot, long cacheFlushId,
    MonitoredTask status, ThroughputController throughputController,
    FlushLifeCycleTracker tracker) throws IOException {
  if (throwExceptionWhenFlushing.get()) {
    throw new IOException("Simulated exception by tests");
  }
  return super.flushSnapshot(snapshot, cacheFlushId, status, throughputController, tracker);
}
 
开发者ID:apache,项目名称:hbase,代码行数:10,代码来源:AbstractTestWALReplay.java

示例3: flushSnapshot

import org.apache.hadoop.hbase.regionserver.MemStoreSnapshot; //导入依赖的package包/类
/**
 * Flushes the snapshot of the MemStore.
 * If this store is not a mob store, flush the cells in the snapshot to store files of HBase.
 * If the store is a mob one, the flusher flushes the MemStore into two places.
 * One is the store files of HBase, the other is the mob files.
 * <ol>
 * <li>Cells that are not PUT type or have the delete mark will be directly flushed to
 * HBase.</li>
 * <li>If the size of a cell value is larger than a threshold, it'll be
 * flushed to a mob file, another cell with the path of this file will be flushed to HBase.</li>
 * <li>If the size of a cell value is smaller than or equal with a threshold, it'll be flushed to
 * HBase directly.</li>
 * </ol>
 */
@Override
public List<Path> flushSnapshot(MemStoreSnapshot snapshot, long cacheFlushId,
    MonitoredTask status, ThroughputController throughputController,
    FlushLifeCycleTracker tracker) throws IOException {
  ArrayList<Path> result = new ArrayList<>();
  long cellsCount = snapshot.getCellsCount();
  if (cellsCount == 0) return result; // don't flush if there are no entries

  // Use a store scanner to find which rows to flush.
  long smallestReadPoint = store.getSmallestReadPoint();
  InternalScanner scanner = createScanner(snapshot.getScanners(), smallestReadPoint, tracker);
  StoreFileWriter writer;
  try {
    // TODO: We can fail in the below block before we complete adding this flush to
    // list of store files. Add cleanup of anything put on filesystem if we fail.
    synchronized (flushLock) {
      status.setStatus("Flushing " + store + ": creating writer");
      // Write the map out to the disk
      writer = store.createWriterInTmp(cellsCount, store.getColumnFamilyDescriptor().getCompressionType(),
          false, true, true, false);
      IOException e = null;
      try {
        // It's a mob store, flush the cells in a mob way. This is the difference of flushing
        // between a normal and a mob store.
        performMobFlush(snapshot, cacheFlushId, scanner, writer, status, throughputController);
      } catch (IOException ioe) {
        e = ioe;
        // throw the exception out
        throw ioe;
      } finally {
        if (e != null) {
          writer.close();
        } else {
          finalizeWriter(writer, cacheFlushId, status);
        }
      }
    }
  } finally {
    scanner.close();
  }
  LOG.info("Mob store is flushed, sequenceid=" + cacheFlushId + ", memsize="
      + StringUtils.TraditionalBinaryPrefix.long2String(snapshot.getDataSize(), "", 1) +
      ", hasBloomFilter=" + writer.hasGeneralBloom() +
      ", into tmp file " + writer.getPath());
  result.add(writer.getPath());
  return result;
}
 
开发者ID:apache,项目名称:hbase,代码行数:62,代码来源:DefaultMobStoreFlusher.java


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