本文整理汇总了Java中org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest.isMajor方法的典型用法代码示例。如果您正苦于以下问题:Java CompactionRequest.isMajor方法的具体用法?Java CompactionRequest.isMajor怎么用?Java CompactionRequest.isMajor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest
的用法示例。
在下文中一共展示了CompactionRequest.isMajor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preCompact
import org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest; //导入方法依赖的package包/类
@Override
public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e,
Store store,
InternalScanner scanner,
ScanType scanType,
CompactionRequest request) throws IOException {
HTableDescriptor desc = e.getEnvironment().getRegion().getTableDesc();
HColumnDescriptor famDesc
= desc.getFamily(Bytes.toBytes(store.getColumnFamilyName()));
boolean omidCompactable = Boolean.valueOf(famDesc.getValue(OMID_COMPACTABLE_CF_FLAG));
// only column families tagged as compactable are compacted
// with omid compactor
if (!omidCompactable) {
return scanner;
} else {
CommitTable.Client commitTableClient = commitTableClientQueue.poll();
if (commitTableClient == null) {
commitTableClient = initAndGetCommitTableClient();
}
boolean isMajorCompaction = request.isMajor();
return new CompactorScanner(e,
scanner,
commitTableClient,
commitTableClientQueue,
isMajorCompaction,
retainNonTransactionallyDeletedCells);
}
}
示例2: record
import org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest; //导入方法依赖的package包/类
/**
* Records the transaction state used for a compaction. This method is called when the compaction starts.
*
* @param request {@link CompactionRequest} for the compaction
* @param snapshot transaction state that will be used for the compaction
*/
public void record(CompactionRequest request, @Nullable TransactionVisibilityState snapshot) {
if (request.isMajor() && snapshot != null) {
Transaction tx = TxUtils.createDummyTransaction(snapshot);
pruneUpperBound = TxUtils.getPruneUpperBound(tx);
if (LOG.isDebugEnabled()) {
LOG.debug(
String.format("Computed prune upper bound %s for compaction request %s using transaction state from time %s",
pruneUpperBound, request, snapshot.getTimestamp()));
}
} else {
pruneUpperBound = -1;
}
}