private void writeAndRead(BloomType bloomType, int numStoreFiles) throws IOException {
    Configuration conf = HBaseConfiguration.create();
    FileSystem fs = FileSystem.get(conf);

    ColumnFamilyDescriptor hcd = ColumnFamilyDescriptorBuilder.newBuilder(family)
      .setCompressionType(Compression.Algorithm.GZ).setBloomFilterType(bloomType)
      .setConfiguration(BloomFilterUtil.PREFIX_LENGTH_KEY, "3").build();
    init(name.getMethodName(), conf, hcd);

    for (int i = 1; i <= numStoreFiles; i++) {
      byte[] row = Bytes.toBytes("row" + i);
      LOG.info("Adding some data for the store file #" + i);
      long timeStamp = EnvironmentEdgeManager.currentTime();
      this.store.add(new KeyValue(row, family, qf1, timeStamp, (byte[]) null), null);
      this.store.add(new KeyValue(row, family, qf2, timeStamp, (byte[]) null), null);
      this.store.add(new KeyValue(row, family, qf3, timeStamp, (byte[]) null), null);
      flush(i);
    }

    // Verify the total number of store files
    assertEquals(numStoreFiles, this.store.getStorefiles().size());

    TreeSet<byte[]> columns = new TreeSet<>(Bytes.BYTES_COMPARATOR);
    columns.add(qf1);

    for (int i = 1; i <= numStoreFiles; i++) {
      KeyValueScanner scanner =
        store.getScanner(new Scan(new Get(Bytes.toBytes("row" + i))), columns, 0);
      scanner.peek();
    }
  }
Test we do not lose data if we fail a flush and then close. Part of HBase-10466
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java