Search in sources :

Example 1 with StripeMultiFileWriter

use of org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter 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

KeyValue (org.apache.hadoop.hbase.KeyValue)1 StripeMultiFileWriter (org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter)1 StripeStoreFlusher (org.apache.hadoop.hbase.regionserver.StripeStoreFlusher)1 StoreFileWritersCapture (org.apache.hadoop.hbase.regionserver.compactions.TestCompactor.StoreFileWritersCapture)1