Package org.apache.hadoop.hbase.regionserver

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


      protected boolean restoreEdit(Store s, KeyValue kv) {
        super.restoreEdit(s, kv);
        throw new RuntimeException("Called when it should not have been!");
      }
    };
    long seqid2 = region2.initialize();
    // HRegionServer usually does this. It knows the largest seqid across all regions.
    wal2.setSequenceNumber(seqid2);
    assertTrue(seqid + result.size() < seqid2);

    // Next test.  Add more edits, then 'crash' this region by stealing its wal
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

              boolean b = super.internalFlushcache(wal, myseqid);
              flushcount.incrementAndGet();
              return b;
            };
          };
          long seqid = region.initialize();
          // We flushed during init.
          assertTrue(flushcount.get() > 0);
          assertTrue(seqid > wal.getSequenceNumber());

          Get get = new Get(rowName);
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

    Mockito.doReturn(false).when(rsServices).isAborted();
    Configuration customConf = new Configuration(this.conf);
    customConf.set(DefaultStoreEngine.DEFAULT_STORE_FLUSHER_CLASS_KEY,
        CustomStoreFlusher.class.getName());
    HRegion region = new HRegion(basedir, wal, this.fs, customConf, hri, htd, rsServices);
    long seqid = region.initialize();
    // HRegionServer usually does this. It knows the largest seqid across all
    // regions.
    wal.setSequenceNumber(seqid);

    int writtenRowCount = 10;
View Full Code Here

    runWALSplit(this.conf);
    HLog wal2 = createWAL(this.conf);
    Mockito.doReturn(false).when(rsServices).isAborted();
    HRegion region2 = new HRegion(basedir, wal2, this.fs, this.conf, hri, htd,
        rsServices);
    long seqid2 = region2.initialize();
    // HRegionServer usually does this. It knows the largest seqid across all
    // regions.
    wal2.setSequenceNumber(seqid2);

    scanner = region2.getScanner(new Scan());
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

                    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

    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);

        // I can't close wal1.  Its been appropriated when we split.
        region2.close();
        wal2.closeAndDelete();
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.