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

x33g5p2x  于2022-01-30 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(147)

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

Store.getHFilesSize介绍

暂无

代码示例

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

/**
 * Computes total FileSystem size for the given {@link Region}.
 *
 * @param r The region
 * @return The size, in bytes, of the Region.
 */
long computeSize(Region r) {
 long regionSize = 0L;
 for (Store store : r.getStores()) {
  regionSize += store.getHFilesSize();
 }
 if (LOG.isTraceEnabled()) {
  LOG.trace("Size of " + r + " is " + regionSize);
 }
 return regionSize;
}

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

/**
 * Creates a region with a number of Stores equal to the length of {@code storeSizes}. Each
 * {@link Store} will have a reported size corresponding to the element in {@code storeSizes}.
 *
 * @param storeSizes A list of sizes for each Store.
 * @return A mocked Region.
 */
private Region mockRegionWithSize(Collection<Long> storeSizes) {
 final Region r = mock(Region.class);
 final RegionInfo info = mock(RegionInfo.class);
 when(r.getRegionInfo()).thenReturn(info);
 List<Store> stores = new ArrayList<>();
 when(r.getStores()).thenReturn((List) stores);
 for (Long storeSize : storeSizes) {
  final Store s = mock(Store.class);
  stores.add(s);
  when(s.getHFilesSize()).thenReturn(storeSize);
 }
 return r;
}

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

private Region mockRegionWithHFileLinks(Collection<Long> storeSizes, Collection<Long> hfileSizes) {
 final Region r = mock(Region.class);
 final RegionInfo info = mock(RegionInfo.class);
 when(r.getRegionInfo()).thenReturn(info);
 List<Store> stores = new ArrayList<>();
 when(r.getStores()).thenReturn((List) stores);
 assertEquals(
   "Logic error, storeSizes and linkSizes must be equal in size", storeSizes.size(),
   hfileSizes.size());
 Iterator<Long> storeSizeIter = storeSizes.iterator();
 Iterator<Long> hfileSizeIter = hfileSizes.iterator();
 while (storeSizeIter.hasNext() && hfileSizeIter.hasNext()) {
  final long storeSize = storeSizeIter.next();
  final long hfileSize = hfileSizeIter.next();
  final Store s = mock(Store.class);
  stores.add(s);
  when(s.getStorefilesSize()).thenReturn(storeSize);
  when(s.getHFilesSize()).thenReturn(hfileSize);
 }
 return r;
}

代码示例来源:origin: org.apache.hbase/hbase-server

/**
 * Creates a region with a number of Stores equal to the length of {@code storeSizes}. Each
 * {@link Store} will have a reported size corresponding to the element in {@code storeSizes}.
 *
 * @param storeSizes A list of sizes for each Store.
 * @return A mocked Region.
 */
private Region mockRegionWithSize(Collection<Long> storeSizes) {
 final Region r = mock(Region.class);
 final RegionInfo info = mock(RegionInfo.class);
 when(r.getRegionInfo()).thenReturn(info);
 List<Store> stores = new ArrayList<>();
 when(r.getStores()).thenReturn((List) stores);
 for (Long storeSize : storeSizes) {
  final Store s = mock(Store.class);
  stores.add(s);
  when(s.getHFilesSize()).thenReturn(storeSize);
 }
 return r;
}

代码示例来源:origin: org.apache.hbase/hbase-server

private Region mockRegionWithHFileLinks(Collection<Long> storeSizes, Collection<Long> hfileSizes) {
 final Region r = mock(Region.class);
 final RegionInfo info = mock(RegionInfo.class);
 when(r.getRegionInfo()).thenReturn(info);
 List<Store> stores = new ArrayList<>();
 when(r.getStores()).thenReturn((List) stores);
 assertEquals(
   "Logic error, storeSizes and linkSizes must be equal in size", storeSizes.size(),
   hfileSizes.size());
 Iterator<Long> storeSizeIter = storeSizes.iterator();
 Iterator<Long> hfileSizeIter = hfileSizes.iterator();
 while (storeSizeIter.hasNext() && hfileSizeIter.hasNext()) {
  final long storeSize = storeSizeIter.next();
  final long hfileSize = hfileSizeIter.next();
  final Store s = mock(Store.class);
  stores.add(s);
  when(s.getStorefilesSize()).thenReturn(storeSize);
  when(s.getHFilesSize()).thenReturn(hfileSize);
 }
 return r;
}

相关文章