Package org.apache.hadoop.hbase.regionserver

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


    // 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


    region.close(true);
    wal.close();
    runWALSplit(this.conf);
    HLog wal2 = createWAL(this.conf);
    HRegion region2 = new HRegion(basedir, wal2, this.fs, this.conf, hri, htd, null);
    long seqid2 = region2.initialize();
    // HRegionServer usually does this. It knows the largest seqid across all regions.
    wal2.setSequenceNumber(seqid2);
    assertTrue(seqid + result.size() < seqid2);
    final Result result1b = region2.get(g, null);
    assertEquals(result.size(), result1b.size());
View Full Code Here

            boolean b = super.restoreEdit(s, kv);
            countOfRestoredEdits.incrementAndGet();
            return b;
          }
        };
        long seqid3 = region3.initialize();
        // HRegionServer usually does this. It knows the largest seqid across all regions.
        wal3.setSequenceNumber(seqid3);
        Result result3 = region3.get(g, null);
        // Assert that count of cells is same as before crash.
        assertEquals(result2.size(), result3.size());
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);
    for (HColumnDescriptor hcd: htd.getFamilies()) {
      addRegionEdits(rowName, hcd.getName(), countPerFamily, this.ee, region, "x");
    }
View Full Code Here

    // Let us try to split and recover
    runWALSplit(this.conf);
    HLog wal2 = createWAL(this.conf);
    HRegion region2 = new HRegion(basedir, wal2, this.fs, this.conf, hri, htd, null);
    long seqid2 = region2.initialize();
    // HRegionServer usually does this. It knows the largest seqid across all regions.
    wal2.setSequenceNumber(seqid2);
    assertTrue(seqid + result.size() < seqid2);

    final Result result1b = region2.get(g, null);
View Full Code Here

                  Mockito.mock(MonitoredTask.class));
              flushcount.incrementAndGet();
              return b;
            };
          };
          long seqid = region.initialize();
          // We flushed during init.
          assertTrue("Flushcount=" + flushcount.get(), flushcount.get() > 0);
          assertTrue(seqid > wal.getSequenceNumber());

          Get get = new Get(rowName);
View Full Code Here

      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

          currentRegion.initialize();
          currentSize = currentRegion.getLargestHStoreSize();
        }
        nextRegion = HRegion.newHRegion(tabledir, hlog, fs, conf, info[i + 1],
          this.htd, null);
        nextRegion.initialize();
        nextSize = nextRegion.getLargestHStoreSize();

        if ((currentSize + nextSize) <= (maxFilesize / 2)) {
          // We merge two adjacent regions if their total size is less than
          // one half of the desired maximum size
View Full Code Here

            boolean b = super.restoreEdit(s, kv);
            countOfRestoredEdits.incrementAndGet();
            return b;
          }
        };
        long seqid3 = region3.initialize();
        // HRegionServer usually does this. It knows the largest seqid across all regions.
        wal3.setSequenceNumber(seqid3);
        Result result3 = region3.get(g);
        // Assert that count of cells is same as before crash.
        assertEquals(result2.size(), result3.size());
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.