Java 类org.apache.hadoop.hbase.regionserver.StripeStoreFlusher 实例源码

项目:ditb    文件:TestStripeCompactionPolicy.java   
/** 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(si, input.length);
  StripeMultiFileWriter mw = req.createWriter();
  mw.init(null, writers, new KeyValue.KVComparator());
  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);
  }
}
项目:pbase    文件:TestStripeCompactionPolicy.java   
/** 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(si, input.length);
  StripeMultiFileWriter mw = req.createWriter();
  mw.init(null, writers, new KeyValue.KVComparator());
  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);
  }
}
项目:HIndex    文件:TestStripeCompactionPolicy.java   
/** 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(si, input.length);
  StripeMultiFileWriter mw = req.createWriter();
  mw.init(null, writers, new KeyValue.KVComparator());
  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);
  }
}
项目:hbase    文件:TestStripeCompactionPolicy.java   
/** 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(CellComparatorImpl.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);
  }
}
项目:PyroDB    文件:TestStripeCompactionPolicy.java   
/** 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(si, input.length);
  StripeMultiFileWriter mw = req.createWriter();
  mw.init(null, writers, new KeyValue.KVComparator());
  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);
  }
}
项目:ditb    文件:StripeCompactionPolicy.java   
public StripeStoreFlusher.StripeFlushRequest selectFlush(
    StripeInformationProvider si, int kvCount) {
  if (this.config.isUsingL0Flush()) {
    return new StripeStoreFlusher.StripeFlushRequest(); // L0 is used, return dumb request.
  }
  if (si.getStripeCount() == 0) {
    // No stripes - start with the requisite count, derive KVs per stripe.
    int initialCount = this.config.getInitialCount();
    return new StripeStoreFlusher.SizeStripeFlushRequest(initialCount, kvCount / initialCount);
  }
  // There are stripes - do according to the boundaries.
  return new StripeStoreFlusher.BoundaryStripeFlushRequest(si.getStripeBoundaries());
}
项目:pbase    文件:StripeCompactionPolicy.java   
public StripeStoreFlusher.StripeFlushRequest selectFlush(
    StripeInformationProvider si, int kvCount) {
  if (this.config.isUsingL0Flush()) {
    return new StripeStoreFlusher.StripeFlushRequest(); // L0 is used, return dumb request.
  }
  if (si.getStripeCount() == 0) {
    // No stripes - start with the requisite count, derive KVs per stripe.
    int initialCount = this.config.getInitialCount();
    return new StripeStoreFlusher.SizeStripeFlushRequest(initialCount, kvCount / initialCount);
  }
  // There are stripes - do according to the boundaries.
  return new StripeStoreFlusher.BoundaryStripeFlushRequest(si.getStripeBoundaries());
}
项目:HIndex    文件:StripeCompactionPolicy.java   
public StripeStoreFlusher.StripeFlushRequest selectFlush(
    StripeInformationProvider si, int kvCount) {
  if (this.config.isUsingL0Flush()) {
    return new StripeStoreFlusher.StripeFlushRequest(); // L0 is used, return dumb request.
  }
  if (si.getStripeCount() == 0) {
    // No stripes - start with the requisite count, derive KVs per stripe.
    int initialCount = this.config.getInitialCount();
    return new StripeStoreFlusher.SizeStripeFlushRequest(initialCount, kvCount / initialCount);
  }
  // There are stripes - do according to the boundaries.
  return new StripeStoreFlusher.BoundaryStripeFlushRequest(si.getStripeBoundaries());
}
项目:hbase    文件:StripeCompactionPolicy.java   
public StripeStoreFlusher.StripeFlushRequest selectFlush(CellComparator comparator,
    StripeInformationProvider si, int kvCount) {
  if (this.config.isUsingL0Flush()) {
    // L0 is used, return dumb request.
    return new StripeStoreFlusher.StripeFlushRequest(comparator);
  }
  if (si.getStripeCount() == 0) {
    // No stripes - start with the requisite count, derive KVs per stripe.
    int initialCount = this.config.getInitialCount();
    return new StripeStoreFlusher.SizeStripeFlushRequest(comparator, initialCount,
        kvCount / initialCount);
  }
  // There are stripes - do according to the boundaries.
  return new StripeStoreFlusher.BoundaryStripeFlushRequest(comparator, si.getStripeBoundaries());
}
项目:PyroDB    文件:StripeCompactionPolicy.java   
public StripeStoreFlusher.StripeFlushRequest selectFlush(
    StripeInformationProvider si, int kvCount) {
  if (this.config.isUsingL0Flush()) {
    return new StripeStoreFlusher.StripeFlushRequest(); // L0 is used, return dumb request.
  }
  if (si.getStripeCount() == 0) {
    // No stripes - start with the requisite count, derive KVs per stripe.
    int initialCount = this.config.getInitialCount();
    return new StripeStoreFlusher.SizeStripeFlushRequest(initialCount, kvCount / initialCount);
  }
  // There are stripes - do according to the boundaries.
  return new StripeStoreFlusher.BoundaryStripeFlushRequest(si.getStripeBoundaries());
}