Examples of flushcache()


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

      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

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

        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

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

    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

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

    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

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

          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

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

    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

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

    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

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

    Result result = region.get(g, null);
    assertEquals(countPerFamily * htd.getFamilies().size(),
      result.size());

    // Let us flush the region
    region.flushcache();
    region.close(true);
    wal.close();

    // delete the store files in the second column family to simulate a failure
    // in between the flushcache();
View Full Code Here

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

    assertEquals(writtenRowCount, getScannedCount(scanner));

    // Let us flush the region
    throwExceptionWhenFlushing.set(true);
    try {
      region.flushcache();
      fail("Injected exception hasn't been thrown");
    } catch (Throwable t) {
      LOG.info("Expected simulated exception when flushing region,"
          + t.getMessage());
      // simulated to abort server
View Full Code Here

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

    }
    writtenRowCount += moreRow;
    // call flush again
    throwExceptionWhenFlushing.set(false);
    try {
      region.flushcache();
    } catch (IOException t) {
      LOG.info("Expected exception when flushing region because server is stopped,"
          + t.getMessage());
    }
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.