Package org.apache.hadoop.hbase.regionserver

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


    Configuration hc = initSplit();
    HRegion region = initHRegion(tableName, getName(), hc,
      new Class<?>[]{CoprocessorImpl.class}, families);
    for (int i = 0; i < 3; i++) {
      addContent(region, fam3);
      region.flushcache();
    }

    region.compactStores();

    byte [] splitRow = region.checkSplit();
View Full Code Here


    // put a row and flush it to disk
    Put put = new Put(ROW);
    put.add(A, A, A);
    region.put(put);
    region.flushcache();
    Get get = new Get(ROW);
    Result r = region.get(get);
    assertNull(
      "Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: "
          + r, r.list());
View Full Code Here

      Put p = new Put(Bytes.toBytes((char)('a'+i) + "row"));
      p.setDurability(Durability.SKIP_WAL);
      p.add(family, qualifier, Bytes.toBytes(String.valueOf(111+i)));
      testRegion.put(p);
    }
    testRegion.flushcache();

    // rows starting with "b"
    PrefixFilter pf = new PrefixFilter(new byte[] {'b'}) ;
    // rows with value of column 'q1' set to '113'
    SingleColumnValueFilter scvf = new SingleColumnValueFilter(
View Full Code Here

      Put p = new Put(Bytes.toBytes("row" + i));
      p.setWriteToWAL(false);
      p.add(FAMILIES[0], columnStatus, Bytes.toBytes(i%2));
      testRegion.put(p);
    }
    testRegion.flushcache();
    // 1. got rows > "row4"
    Filter rowFilter = new RowFilter(CompareOp.GREATER, new BinaryComparator(
        Bytes.toBytes("row4")));
    Scan s1 = new Scan();
    s1.setFilter(rowFilter);
View Full Code Here

        byte[] value = dataGenerator.generateRandomSizeValue(key, col);
        put.add(CF_BYTES, col, value);
        region.put(put);
      }
      if (i % NUM_ROWS_PER_FLUSH == 0) {
        region.flushcache();
      }
    }

    for (int doneCompaction = 0; doneCompaction <= 1; ++doneCompaction) {
      // Read
View Full Code Here

    assertEquals(startBlockCount, cache.getBlockCount());
    assertEquals(startBlockHits, cache.getStats().getHitCount());
    assertEquals(startBlockMiss, cache.getStats().getMissCount());
    // flush the data
    System.out.println("Flushing cache");
    region.flushcache();
    // expect one more block in cache, no change in hits/misses
    long expectedBlockCount = startBlockCount + 1;
    long expectedBlockHits = startBlockHits;
    long expectedBlockMiss = startBlockMiss;
    assertEquals(expectedBlockCount, cache.getBlockCount());
View Full Code Here

    assertEquals(expectedBlockCount, cache.getBlockCount());
    assertEquals(++expectedBlockHits, cache.getStats().getHitCount());
    assertEquals(expectedBlockMiss, cache.getStats().getMissCount());
    // flush, one new block
    System.out.println("Flushing cache");
    region.flushcache();
    assertEquals(++expectedBlockCount, cache.getBlockCount());
    assertEquals(expectedBlockHits, cache.getStats().getHitCount());
    assertEquals(expectedBlockMiss, cache.getStats().getMissCount());
    // compact, net minus two blocks, two hits, no misses
    System.out.println("Compacting");
View Full Code Here

          put.add(FAMILY_BYTES, Bytes.toBytes("col" + iCol),
              Bytes.toBytes("value" + iFile + "_" + iRow + "_" + iCol));
        }
        region.put(put);
      }
      region.flushcache();
    }

    Scan scan = new Scan(Bytes.toBytes("aaa"), Bytes.toBytes("aaz"));
    CacheConfig cacheConf = new CacheConfig(conf);
    LruBlockCache cache = (LruBlockCache) cacheConf.getBlockCache();
View Full Code Here

    HRegion region = initHRegion(tableName, getName(), hc,
      new Class<?>[]{}, families);

    for (int i = 0; i < 3; i++) {
      addContent(region, fam3);
      region.flushcache();
    }

    region.compactStores();

    byte [] splitRow = region.checkSplit();
View Full Code Here

    boolean first = true;
    for (HColumnDescriptor hcd: hri.getTableDesc().getFamilies()) {
      addRegionEdits(rowName, hcd.getName(), countPerFamily, this.ee, region, "x");
      if (first ) {
        // If first, so we have at least one family w/ different seqid to rest.
        region.flushcache();
        first = false;
      }
    }
    // Now assert edits made it in.
    Get g = new Get(rowName);
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.