本文整理了Java中org.apache.hadoop.hbase.regionserver.Region.getMemStoreHeapSize
方法的一些代码示例,展示了Region.getMemStoreHeapSize
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Region.getMemStoreHeapSize
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.regionserver.Region
类名称:Region
方法名:getMemStoreHeapSize
暂无
代码示例来源:origin: apache/hbase
private void doPut(Table table, long memstoreFlushSize) throws IOException, InterruptedException {
Region region = getRegionWithName(table.getName()).getFirst();
// cf1 4B per row, cf2 40B per row and cf3 400B per row
byte[] qf = Bytes.toBytes("qf");
Random rand = new Random();
byte[] value1 = new byte[100];
byte[] value2 = new byte[200];
byte[] value3 = new byte[400];
for (int i = 0; i < 10000; i++) {
Put put = new Put(Bytes.toBytes("row-" + i));
rand.setSeed(i);
rand.nextBytes(value1);
rand.nextBytes(value2);
rand.nextBytes(value3);
put.addColumn(FAMILY1, qf, value1);
put.addColumn(FAMILY2, qf, value2);
put.addColumn(FAMILY3, qf, value3);
table.put(put);
// slow down to let regionserver flush region.
while (region.getMemStoreHeapSize() > memstoreFlushSize) {
Thread.sleep(100);
}
}
}
代码示例来源:origin: apache/hbase
int load = (int) ((region.getMemStoreHeapSize() * 100)
/ flushSizeBytes);
LOG.debug("Done writing some data to "+tableName);
代码示例来源:origin: apache/phoenix
private void commitBatch(Region region, List<Mutation> mutations, long blockingMemstoreSize) throws IOException {
if (mutations.isEmpty()) {
return;
}
Mutation[] mutationArray = new Mutation[mutations.size()];
// When memstore size reaches blockingMemstoreSize we are waiting 3 seconds for the
// flush happen which decrease the memstore size and then writes allowed on the region.
for (int i = 0; blockingMemstoreSize > 0 && (region.getMemStoreHeapSize() + region.getMemStoreOffHeapSize()) > blockingMemstoreSize
&& i < 30; i++) {
try {
checkForRegionClosing();
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOException(e);
}
}
// TODO: should we use the one that is all or none?
logger.debug("Committing batch of " + mutations.size() + " mutations for " + region.getRegionInfo().getTable().getNameAsString());
region.batchMutate(mutations.toArray(mutationArray));
}
代码示例来源:origin: org.apache.phoenix/phoenix-core
private void commitBatch(Region region, List<Mutation> mutations, long blockingMemstoreSize) throws IOException {
if (mutations.isEmpty()) {
return;
}
Mutation[] mutationArray = new Mutation[mutations.size()];
// When memstore size reaches blockingMemstoreSize we are waiting 3 seconds for the
// flush happen which decrease the memstore size and then writes allowed on the region.
for (int i = 0; blockingMemstoreSize > 0 && (region.getMemStoreHeapSize() + region.getMemStoreOffHeapSize()) > blockingMemstoreSize
&& i < 30; i++) {
try {
checkForRegionClosing();
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOException(e);
}
}
// TODO: should we use the one that is all or none?
logger.debug("Committing batch of " + mutations.size() + " mutations for " + region.getRegionInfo().getTable().getNameAsString());
region.batchMutate(mutations.toArray(mutationArray));
}
代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core
private void commitBatch(Region region, List<Mutation> mutations, long blockingMemstoreSize) throws IOException {
if (mutations.isEmpty()) {
return;
}
Mutation[] mutationArray = new Mutation[mutations.size()];
// When memstore size reaches blockingMemstoreSize we are waiting 3 seconds for the
// flush happen which decrease the memstore size and then writes allowed on the region.
for (int i = 0; blockingMemstoreSize > 0 && (region.getMemStoreHeapSize() + region.getMemStoreOffHeapSize()) > blockingMemstoreSize
&& i < 30; i++) {
try {
checkForRegionClosing();
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOException(e);
}
}
// TODO: should we use the one that is all or none?
logger.debug("Committing batch of " + mutations.size() + " mutations for " + region.getRegionInfo().getTable().getNameAsString());
region.batchMutate(mutations.toArray(mutationArray));
}
代码示例来源:origin: org.apache.hbase/hbase-server
private void doPut(Table table, long memstoreFlushSize) throws IOException, InterruptedException {
Region region = getRegionWithName(table.getName()).getFirst();
// cf1 4B per row, cf2 40B per row and cf3 400B per row
byte[] qf = Bytes.toBytes("qf");
Random rand = new Random();
byte[] value1 = new byte[100];
byte[] value2 = new byte[200];
byte[] value3 = new byte[400];
for (int i = 0; i < 10000; i++) {
Put put = new Put(Bytes.toBytes("row-" + i));
rand.setSeed(i);
rand.nextBytes(value1);
rand.nextBytes(value2);
rand.nextBytes(value3);
put.addColumn(FAMILY1, qf, value1);
put.addColumn(FAMILY2, qf, value2);
put.addColumn(FAMILY3, qf, value3);
table.put(put);
// slow down to let regionserver flush region.
while (region.getMemStoreHeapSize() > memstoreFlushSize) {
Thread.sleep(100);
}
}
}
代码示例来源:origin: org.apache.hbase/hbase-server
int load = (int) ((region.getMemStoreHeapSize() * 100)
/ flushSizeBytes);
LOG.debug("Done writing some data to "+tableName);
内容来源于网络,如有侵权,请联系作者删除!