Package org.apache.hadoop.hbase.regionserver

Examples of org.apache.hadoop.hbase.regionserver.HRegion.initialize()


      throws IOException {
    //HRegionInfo info = new HRegionInfo(tableName, null, null, false);
    HRegion r = new HRegion(closedRegion.getTableDir(), closedRegion.getLog(),
        closedRegion.getFilesystem(), closedRegion.getConf(),
        closedRegion.getRegionInfo(), closedRegion.getTableDesc(), null);
    r.initialize();

    // this following piece is a hack. currently a coprocessorHost
    // is secretly loaded at OpenRegionHandler. we don't really
    // start a region server here, so just manually create cphost
    // and set it to region.
View Full Code Here


        Path tableDir =
          HTableDescriptor.getTableDir(hbaseRootDir, hri.getTableName());
        HRegion region = new HRegion(tableDir, wal2, FileSystem.get(newConf),
          newConf, hri, htd, TEST_UTIL.getHBaseCluster().getRegionServer(0));

        long seqid2 = region.initialize();
        SampleRegionWALObserver cp2 =
          (SampleRegionWALObserver)region.getCoprocessorHost().findCoprocessor(
              SampleRegionWALObserver.class.getName());
        // TODO: asserting here is problematic.
        assertNotNull(cp2);
View Full Code Here

  }

  protected HRegion openClosedRegion(final HRegion closedRegion)
  throws IOException {
    HRegion r = new HRegion(closedRegion);
    r.initialize();
    return r;
  }

  /**
   * Create a table of name <code>name</code> with {@link COLUMNS} for
View Full Code Here

  protected HRegion openClosedRegion(final HRegion closedRegion)
  throws IOException {
    HRegion r = new HRegion(closedRegion.getBaseDir(), closedRegion.getLog(),
        closedRegion.getFilesystem(), closedRegion.getConf(),
        closedRegion.getRegionInfo(), null);
    r.initialize(null, null);
    return r;
  }
 
  /**
   * Create a table of name <code>name</code> with {@link COLUMNS} for
View Full Code Here

                    oldRegionInfo, false),
                metaHLog,
                conf,
                oldDesc,
                null);
        region.initialize();
        //Run major compaction to archive old stores
        //to keep any snapshots to _acl_ unbroken
        region.compactStores(true);
        region.waitForFlushesAndCompactions();
        region.close();
View Full Code Here

    private HRegion openRegion(final Path tableDir, final FileSystem fs,
        final Configuration conf, final HRegionInfo hri,
        final HTableDescriptor htd) throws IOException {
      HRegion r = HRegion.newHRegion(tableDir, null, fs, conf, hri, htd, null);
      r.initialize(null);
      return r;
    }

    @Override
    public boolean nextKeyValue() throws IOException, InterruptedException {
View Full Code Here

    HLog wal3 = createWAL(this.conf);
    wal3.setSequenceNumber(wal2.getSequenceNumber());
    try {
      final HRegion region = new HRegion(basedir, wal3, this.fs, this.conf, hri,
        htd, null);
      long seqid = region.initialize();
      assertTrue(seqid > wal3.getSequenceNumber());

      // TODO: Scan all.
      region.close();
    } finally {
View Full Code Here

      public Object run() throws Exception {
        runWALSplit(newConf);
        HLog wal2 = createWAL(newConf);
        HRegion region2 = new HRegion(basedir, wal2, FileSystem.get(newConf),
          newConf, hri, htd, null);
        long seqid2 = region2.initialize();
        assertTrue(seqid2 > -1);
        assertEquals(rowsInsertedCount, getScannedCount(region2.getScanner(new Scan())));

        // I can't close wal1.  Its been appropriated when we split.
        region2.close();
View Full Code Here

      public Object run() throws Exception {
        runWALSplit(newConf);
        HLog wal2 = createWAL(newConf);
        HRegion region2 = new HRegion(basedir, wal2, FileSystem.get(newConf),
            newConf, hri, htd, null);
        long seqid2 = region2.initialize();
        assertTrue(seqid2 > -1);
        assertEquals(rowsInsertedCount, getScannedCount(region2.getScanner(new Scan())));

        // I can't close wal1.  Its been appropriated when we split.
        region2.close();
View Full Code Here

    // Write countPerFamily edits into the three families.  Do a flush on one
    // of the families during the load of edits so its seqid is not same as
    // others to test we do right thing when different seqids.
    HLog wal = createWAL(this.conf);
    HRegion region = new HRegion(basedir, wal, this.fs, this.conf, hri, htd, null);
    long seqid = region.initialize();
    // HRegionServer usually does this. It knows the largest seqid across all regions.
    wal.setSequenceNumber(seqid);
    boolean first = true;
    for (HColumnDescriptor hcd: htd.getFamilies()) {
      addRegionEdits(rowName, hcd.getName(), countPerFamily, this.ee, region, "x");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.