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

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

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

HStore.<init>介绍

[英]Constructor
[中]建造师

代码示例

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

  1. /**
  2. * Create a "mock" HStore that uses the tmpDir specified by the user and
  3. * the store dir to compact as source.
  4. */
  5. private static HStore getStore(final Configuration conf, final FileSystem fs,
  6. final Path tableDir, final TableDescriptor htd, final RegionInfo hri,
  7. final String familyName, final Path tempDir) throws IOException {
  8. HRegionFileSystem regionFs = new HRegionFileSystem(conf, fs, tableDir, hri) {
  9. @Override
  10. public Path getTempDir() {
  11. return tempDir;
  12. }
  13. };
  14. HRegion region = new HRegion(regionFs, null, conf, htd, null);
  15. return new HStore(region, htd.getColumnFamily(Bytes.toBytes(familyName)), conf);
  16. }
  17. }

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

  1. protected HStore instantiateHStore(final ColumnFamilyDescriptor family) throws IOException {
  2. if (family.isMobEnabled()) {
  3. if (HFile.getFormatVersion(this.conf) < HFile.MIN_FORMAT_VERSION_WITH_TAGS) {
  4. throw new IOException("A minimum HFile version of "
  5. + HFile.MIN_FORMAT_VERSION_WITH_TAGS
  6. + " is required for MOB feature. Consider setting " + HFile.FORMAT_VERSION_KEY
  7. + " accordingly.");
  8. }
  9. return new HMobStore(this, family, this.conf);
  10. }
  11. return new HStore(this, family, this.conf);
  12. }

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

  1. private HStore init(String methodName, Configuration conf, TableDescriptorBuilder builder,
  2. ColumnFamilyDescriptor hcd, MyStoreHook hook, boolean switchToPread) throws IOException {
  3. initHRegion(methodName, conf, builder, hcd, hook, switchToPread);
  4. if (hook == null) {
  5. store = new HStore(region, hcd, conf);
  6. } else {
  7. store = new MyStore(region, hcd, conf, hook, switchToPread);
  8. }
  9. return store;
  10. }

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

  1. protected void compactingSetUp() throws Exception {
  2. super.internalSetUp();
  3. Configuration conf = new Configuration();
  4. conf.setBoolean(MemStoreLAB.USEMSLAB_KEY, true);
  5. conf.setFloat(MemStoreLAB.CHUNK_POOL_MAXSIZE_KEY, 0.2f);
  6. conf.setInt(HRegion.MEMSTORE_PERIODIC_FLUSH_INTERVAL, 1000);
  7. HBaseTestingUtility hbaseUtility = HBaseTestingUtility.createLocalHTU(conf);
  8. HColumnDescriptor hcd = new HColumnDescriptor(FAMILY);
  9. HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("foobar"));
  10. htd.addFamily(hcd);
  11. HRegionInfo info =
  12. new HRegionInfo(TableName.valueOf("foobar"), null, null, false);
  13. WAL wal = hbaseUtility.createWal(conf, hbaseUtility.getDataTestDir(), info);
  14. this.region = HRegion.createHRegion(info, hbaseUtility.getDataTestDir(), conf, htd, wal, true);
  15. //this.region = hbaseUtility.createTestRegion("foobar", hcd);
  16. this.regionServicesForStores = region.getRegionServicesForStores();
  17. this.store = new HStore(region, hcd, conf);
  18. long globalMemStoreLimit = (long) (ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()
  19. .getMax() * MemorySizeUtil.getGlobalMemStoreHeapPercent(conf, false));
  20. chunkCreator = ChunkCreator.initialize(MemStoreLABImpl.CHUNK_SIZE_DEFAULT, false,
  21. globalMemStoreLimit, 0.4f, MemStoreLAB.POOL_INITIAL_SIZE_DEFAULT,
  22. null);
  23. assertTrue(chunkCreator != null);
  24. }

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

  1. /**
  2. * Setting up a Store
  3. * @throws IOException with error
  4. */
  5. protected void initialize() throws IOException {
  6. Path basedir = new Path(DIR);
  7. String logName = "logs";
  8. Path logdir = new Path(DIR, logName);
  9. HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toBytes("family"));
  10. FileSystem fs = FileSystem.get(conf);
  11. fs.delete(logdir, true);
  12. HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(Bytes.toBytes("table")));
  13. htd.addFamily(hcd);
  14. HRegionInfo info = new HRegionInfo(htd.getTableName(), null, null, false);
  15. hlog = new FSHLog(fs, basedir, logName, conf);
  16. hlog.init();
  17. ChunkCreator.initialize(MemStoreLABImpl.CHUNK_SIZE_DEFAULT, false, 0, 0, 0, null);
  18. region = HRegion.createHRegion(info, basedir, conf, htd, hlog);
  19. region.close();
  20. Path tableDir = FSUtils.getTableDir(basedir, htd.getTableName());
  21. region = new HRegion(tableDir, hlog, fs, conf, info, htd, null);
  22. store = new HStore(region, hcd, conf);
  23. TEST_FILE = region.getRegionFileSystem().createTempName();
  24. fs.createNewFile(TEST_FILE);
  25. }

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

  1. @Before
  2. public void setUp() throws IOException {
  3. // parameterized tests add [#] suffix get rid of [ and ].
  4. table = Bytes.toBytes(name.getMethodName().replaceAll("[\\[\\]]", "_"));
  5. conf = TEST_UTIL.getConfiguration();
  6. conf.setInt(HFile.FORMAT_VERSION_KEY, HFile.MAX_FORMAT_VERSION);
  7. conf.setBoolean(CacheConfig.CACHE_BLOCKS_ON_WRITE_KEY, false);
  8. conf.setBoolean(CacheConfig.CACHE_INDEX_BLOCKS_ON_WRITE_KEY, false);
  9. conf.setBoolean(CacheConfig.CACHE_BLOOM_BLOCKS_ON_WRITE_KEY, false);
  10. fs = HFileSystem.get(conf);
  11. // Create the schema
  12. ColumnFamilyDescriptor hcd = cowType
  13. .modifyFamilySchema(
  14. ColumnFamilyDescriptorBuilder.newBuilder(family).setBloomFilterType(BloomType.ROWCOL))
  15. .build();
  16. TableDescriptor htd =
  17. TableDescriptorBuilder.newBuilder(TableName.valueOf(table)).setColumnFamily(hcd).build();
  18. // Create a store based on the schema
  19. String id = TestCacheOnWriteInSchema.class.getName();
  20. Path logdir = new Path(FSUtils.getRootDir(conf), AbstractFSWALProvider.getWALDirectoryName(id));
  21. fs.delete(logdir, true);
  22. RegionInfo info = RegionInfoBuilder.newBuilder(htd.getTableName()).build();
  23. walFactory = new WALFactory(conf, id);
  24. region = TEST_UTIL.createLocalHRegion(info, htd, walFactory.getWAL(info));
  25. region.setBlockCache(BlockCacheFactory.createBlockCache(conf));
  26. store = new HStore(region, hcd, conf);
  27. }

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

  1. this.store.close();
  2. this.store = new HStore(this.store.getHRegion(), this.store.getColumnFamilyDescriptor(), c);
  3. assertEquals(2, this.store.getStorefilesCount());

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

  1. protected HStore instantiateHStore(final HColumnDescriptor family) throws IOException {
  2. return new HStore(this, family, this.conf);
  3. }

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

  1. /**
  2. * Create a "mock" HStore that uses the tmpDir specified by the user and
  3. * the store dir to compact as source.
  4. */
  5. private static HStore getStore(final Configuration conf, final FileSystem fs,
  6. final Path tableDir, final HTableDescriptor htd, final HRegionInfo hri,
  7. final String familyName, final Path tempDir) throws IOException {
  8. HRegionFileSystem regionFs = new HRegionFileSystem(conf, fs, tableDir, hri) {
  9. @Override
  10. public Path getTempDir() {
  11. return tempDir;
  12. }
  13. };
  14. HRegion region = new HRegion(regionFs, null, conf, htd, null);
  15. return new HStore(region, htd.getFamily(Bytes.toBytes(familyName)), conf);
  16. }
  17. }

代码示例来源:origin: com.aliyun.hbase/alihbase-mapreduce

  1. /**
  2. * Create a "mock" HStore that uses the tmpDir specified by the user and
  3. * the store dir to compact as source.
  4. */
  5. private static HStore getStore(final Configuration conf, final FileSystem fs,
  6. final Path tableDir, final TableDescriptor htd, final RegionInfo hri,
  7. final String familyName, final Path tempDir) throws IOException {
  8. HRegionFileSystem regionFs = new HRegionFileSystem(conf, fs, tableDir, hri) {
  9. @Override
  10. public Path getTempDir() {
  11. return tempDir;
  12. }
  13. };
  14. HRegion region = new HRegion(regionFs, null, conf, htd, null);
  15. return new HStore(region, htd.getColumnFamily(Bytes.toBytes(familyName)), conf);
  16. }
  17. }

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

  1. /**
  2. * Create a "mock" HStore that uses the tmpDir specified by the user and
  3. * the store dir to compact as source.
  4. */
  5. private static HStore getStore(final Configuration conf, final FileSystem fs,
  6. final Path tableDir, final TableDescriptor htd, final RegionInfo hri,
  7. final String familyName, final Path tempDir) throws IOException {
  8. HRegionFileSystem regionFs = new HRegionFileSystem(conf, fs, tableDir, hri) {
  9. @Override
  10. public Path getTempDir() {
  11. return tempDir;
  12. }
  13. };
  14. HRegion region = new HRegion(regionFs, null, conf, htd, null);
  15. return new HStore(region, htd.getColumnFamily(Bytes.toBytes(familyName)), conf);
  16. }
  17. }

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

  1. private HStore init(String methodName, Configuration conf, TableDescriptorBuilder builder,
  2. ColumnFamilyDescriptor hcd, MyStoreHook hook, boolean switchToPread) throws IOException {
  3. initHRegion(methodName, conf, builder, hcd, hook, switchToPread);
  4. if (hook == null) {
  5. store = new HStore(region, hcd, conf);
  6. } else {
  7. store = new MyStore(region, hcd, conf, hook, switchToPread);
  8. }
  9. return store;
  10. }

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

  1. protected void compactingSetUp() throws Exception {
  2. super.internalSetUp();
  3. Configuration conf = new Configuration();
  4. conf.setBoolean(MemStoreLAB.USEMSLAB_KEY, true);
  5. conf.setFloat(MemStoreLAB.CHUNK_POOL_MAXSIZE_KEY, 0.2f);
  6. conf.setInt(HRegion.MEMSTORE_PERIODIC_FLUSH_INTERVAL, 1000);
  7. HBaseTestingUtility hbaseUtility = HBaseTestingUtility.createLocalHTU(conf);
  8. HColumnDescriptor hcd = new HColumnDescriptor(FAMILY);
  9. HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("foobar"));
  10. htd.addFamily(hcd);
  11. HRegionInfo info =
  12. new HRegionInfo(TableName.valueOf("foobar"), null, null, false);
  13. WAL wal = hbaseUtility.createWal(conf, hbaseUtility.getDataTestDir(), info);
  14. this.region = HRegion.createHRegion(info, hbaseUtility.getDataTestDir(), conf, htd, wal, true);
  15. //this.region = hbaseUtility.createTestRegion("foobar", hcd);
  16. this.regionServicesForStores = region.getRegionServicesForStores();
  17. this.store = new HStore(region, hcd, conf);
  18. long globalMemStoreLimit = (long) (ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()
  19. .getMax() * MemorySizeUtil.getGlobalMemStoreHeapPercent(conf, false));
  20. chunkCreator = ChunkCreator.initialize(MemStoreLABImpl.CHUNK_SIZE_DEFAULT, false,
  21. globalMemStoreLimit, 0.4f, MemStoreLAB.POOL_INITIAL_SIZE_DEFAULT,
  22. null);
  23. assertTrue(chunkCreator != null);
  24. }

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

  1. /**
  2. * Setting up a Store
  3. * @throws IOException with error
  4. */
  5. protected void initialize() throws IOException {
  6. Path basedir = new Path(DIR);
  7. String logName = "logs";
  8. Path logdir = new Path(DIR, logName);
  9. HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toBytes("family"));
  10. FileSystem fs = FileSystem.get(conf);
  11. fs.delete(logdir, true);
  12. HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(Bytes.toBytes("table")));
  13. htd.addFamily(hcd);
  14. HRegionInfo info = new HRegionInfo(htd.getTableName(), null, null, false);
  15. hlog = new FSHLog(fs, basedir, logName, conf);
  16. ChunkCreator.initialize(MemStoreLABImpl.CHUNK_SIZE_DEFAULT, false, 0, 0, 0, null);
  17. region = HRegion.createHRegion(info, basedir, conf, htd, hlog);
  18. region.close();
  19. Path tableDir = FSUtils.getTableDir(basedir, htd.getTableName());
  20. region = new HRegion(tableDir, hlog, fs, conf, info, htd, null);
  21. store = new HStore(region, hcd, conf);
  22. TEST_FILE = region.getRegionFileSystem().createTempName();
  23. fs.createNewFile(TEST_FILE);
  24. }

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

  1. @Before
  2. public void setUp() throws IOException {
  3. // parameterized tests add [#] suffix get rid of [ and ].
  4. table = Bytes.toBytes(name.getMethodName().replaceAll("[\\[\\]]", "_"));
  5. conf = TEST_UTIL.getConfiguration();
  6. conf.setInt(HFile.FORMAT_VERSION_KEY, HFile.MAX_FORMAT_VERSION);
  7. conf.setBoolean(CacheConfig.CACHE_BLOCKS_ON_WRITE_KEY, false);
  8. conf.setBoolean(CacheConfig.CACHE_INDEX_BLOCKS_ON_WRITE_KEY, false);
  9. conf.setBoolean(CacheConfig.CACHE_BLOOM_BLOCKS_ON_WRITE_KEY, false);
  10. CacheConfig.instantiateBlockCache(conf);
  11. fs = HFileSystem.get(conf);
  12. // Create the schema
  13. ColumnFamilyDescriptor hcd = cowType
  14. .modifyFamilySchema(
  15. ColumnFamilyDescriptorBuilder.newBuilder(family).setBloomFilterType(BloomType.ROWCOL))
  16. .build();
  17. TableDescriptor htd =
  18. TableDescriptorBuilder.newBuilder(TableName.valueOf(table)).setColumnFamily(hcd).build();
  19. // Create a store based on the schema
  20. String id = TestCacheOnWriteInSchema.class.getName();
  21. Path logdir = new Path(FSUtils.getRootDir(conf), AbstractFSWALProvider.getWALDirectoryName(id));
  22. fs.delete(logdir, true);
  23. RegionInfo info = RegionInfoBuilder.newBuilder(htd.getTableName()).build();
  24. walFactory = new WALFactory(conf, id);
  25. region = TEST_UTIL.createLocalHRegion(info, htd, walFactory.getWAL(info));
  26. store = new HStore(region, hcd, conf);
  27. }

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

  1. this.store.close();
  2. this.store = new HStore(this.store.getHRegion(), this.store.getColumnFamilyDescriptor(), c);
  3. assertEquals(2, this.store.getStorefilesCount());

相关文章

HStore类方法