Search in sources :

Example 6 with StoreFileWritersCapture

use of org.apache.hadoop.hbase.regionserver.compactions.TestCompactor.StoreFileWritersCapture in project hbase by apache.

the class TestStripeCompactionPolicy method verifyFlush.

/** Verify arbitrary flush. */
protected void verifyFlush(StripeCompactionPolicy policy, StripeInformationProvider si, KeyValue[] input, KeyValue[][] expected, byte[][] boundaries) throws IOException {
    StoreFileWritersCapture writers = new StoreFileWritersCapture();
    StripeStoreFlusher.StripeFlushRequest req = policy.selectFlush(CellComparator.COMPARATOR, si, input.length);
    StripeMultiFileWriter mw = req.createWriter();
    mw.init(null, writers);
    for (KeyValue kv : input) {
        mw.append(kv);
    }
    boolean hasMetadata = boundaries != null;
    mw.commitWriters(0, false);
    writers.verifyKvs(expected, true, hasMetadata);
    if (hasMetadata) {
        writers.verifyBoundaries(boundaries);
    }
}
Also used : KeyValue(org.apache.hadoop.hbase.KeyValue) StripeStoreFlusher(org.apache.hadoop.hbase.regionserver.StripeStoreFlusher) StripeMultiFileWriter(org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter) StoreFileWritersCapture(org.apache.hadoop.hbase.regionserver.compactions.TestCompactor.StoreFileWritersCapture)

Aggregations

StoreFileWritersCapture (org.apache.hadoop.hbase.regionserver.compactions.TestCompactor.StoreFileWritersCapture)6 Path (org.apache.hadoop.fs.Path)4 ArrayList (java.util.ArrayList)2 ImmutableList (com.google.common.collect.ImmutableList)1 List (java.util.List)1 Configuration (org.apache.hadoop.conf.Configuration)1 HBaseConfiguration (org.apache.hadoop.hbase.HBaseConfiguration)1 HColumnDescriptor (org.apache.hadoop.hbase.HColumnDescriptor)1 HRegionInfo (org.apache.hadoop.hbase.HRegionInfo)1 KeyValue (org.apache.hadoop.hbase.KeyValue)1 InternalScanner (org.apache.hadoop.hbase.regionserver.InternalScanner)1 ScanType (org.apache.hadoop.hbase.regionserver.ScanType)1 Store (org.apache.hadoop.hbase.regionserver.Store)1 StoreFile (org.apache.hadoop.hbase.regionserver.StoreFile)1 StoreFileScanner (org.apache.hadoop.hbase.regionserver.StoreFileScanner)1 StripeMultiFileWriter (org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter)1 StripeStoreFlusher (org.apache.hadoop.hbase.regionserver.StripeStoreFlusher)1 TestCompactor.createDummyStoreFile (org.apache.hadoop.hbase.regionserver.compactions.TestCompactor.createDummyStoreFile)1 Test (org.junit.Test)1