private void debugDumpState(String string) { if (!LOG.isDebugEnabled()) return; StringBuilder sb = new StringBuilder(); sb.append("\n" + string + "; current stripe state is as such:"); sb.append("\n level 0 with ") .append(state.level0Files.size()) .append( " files: " + TraditionalBinaryPrefix.long2String( StripeCompactionPolicy.getTotalFileSize(state.level0Files), "", 1) + ";"); for (int i = 0; i < state.stripeFiles.size(); ++i) { String endRow = (i == state.stripeEndRows.length) ? "(end)" : "[" + Bytes.toString(state.stripeEndRows[i]) + "]"; sb.append("\n stripe ending in ") .append(endRow) .append(" with ") .append(state.stripeFiles.get(i).size()) .append( " files: " + TraditionalBinaryPrefix.long2String( StripeCompactionPolicy.getTotalFileSize(state.stripeFiles.get(i)), "", 1) + ";"); } sb.append("\n").append(state.stripeFiles.size()).append(" stripes total."); sb.append("\n").append(getStorefileCount()).append(" files total."); LOG.debug(sb.toString()); }
private void debugDumpState(String string) { if (!LOG.isDebugEnabled()) return; StringBuilder sb = new StringBuilder(); sb.append("\n" + string + "; current stripe state is as such:"); sb.append("\n level 0 with ").append(state.level0Files.size()) .append( " files: " + StringUtils.humanReadableInt(StripeCompactionPolicy .getTotalFileSize(state.level0Files)) + ";"); for (int i = 0; i < state.stripeFiles.size(); ++i) { String endRow = (i == state.stripeEndRows.length) ? "(end)" : "[" + Bytes.toString(state.stripeEndRows[i]) + "]"; sb.append("\n stripe ending in ").append(endRow).append(" with ") .append(state.stripeFiles.get(i).size()) .append( " files: " + StringUtils.humanReadableInt(StripeCompactionPolicy .getTotalFileSize(state.stripeFiles.get(i))) + ";"); } sb.append("\n").append(state.stripeFiles.size()).append(" stripes total."); sb.append("\n").append(getStorefileCount()).append(" files total."); LOG.debug(sb.toString()); }
@Override protected void createComponents( Configuration conf, Store store, KVComparator comparator) throws IOException { this.config = new StripeStoreConfig(conf, store); this.compactionPolicy = new StripeCompactionPolicy(conf, store, config); this.storeFileManager = new StripeStoreFileManager(comparator, conf, this.config); this.storeFlusher = new StripeStoreFlusher( conf, store, this.compactionPolicy, this.storeFileManager); this.compactor = new StripeCompactor(conf, store); }
@Test public void testCreateBasedOnConfig() throws Exception { Configuration conf = HBaseConfiguration.create(); conf.set(StoreEngine.STORE_ENGINE_CLASS_KEY, TestStoreEngine.class.getName()); StripeStoreEngine se = createEngine(conf); assertTrue(se.getCompactionPolicy() instanceof StripeCompactionPolicy); }
@Override protected void createComponents( Configuration conf, HStore store, CellComparator comparator) throws IOException { this.config = new StripeStoreConfig(conf, store); this.compactionPolicy = new StripeCompactionPolicy(conf, store, config); this.storeFileManager = new StripeStoreFileManager(comparator, conf, this.config); this.storeFlusher = new StripeStoreFlusher( conf, store, this.compactionPolicy, this.storeFileManager); this.compactor = new StripeCompactor(conf, store); }
public StripeStoreFlusher(Configuration conf, Store store, StripeCompactionPolicy policy, StripeStoreFileManager stripes) { super(conf, store); this.policy = policy; this.stripes = stripes; }
public StripeStoreFlusher(Configuration conf, HStore store, StripeCompactionPolicy policy, StripeStoreFileManager stripes) { super(conf, store); this.policy = policy; this.stripes = stripes; }