当前位置: 首页>>代码示例>>Java>>正文


Java IsolationLevel.READ_UNCOMMITTED属性代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.client.IsolationLevel.READ_UNCOMMITTED属性的典型用法代码示例。如果您正苦于以下问题:Java IsolationLevel.READ_UNCOMMITTED属性的具体用法?Java IsolationLevel.READ_UNCOMMITTED怎么用?Java IsolationLevel.READ_UNCOMMITTED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.hbase.client.IsolationLevel的用法示例。


在下文中一共展示了IsolationLevel.READ_UNCOMMITTED属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getReadpoint

@Override public long getReadpoint(IsolationLevel isolationLevel) {
  if (isolationLevel == IsolationLevel.READ_UNCOMMITTED) {
    // This scan can read even uncommitted transactions
    return Long.MAX_VALUE;
  }
  return mvcc.getReadPoint();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:HRegion.java

示例2: getReadpoint

public long getReadpoint(IsolationLevel isolationLevel) {
    if (isolationLevel == IsolationLevel.READ_UNCOMMITTED) {
        // This scan can read even uncommitted transactions
        return Long.MAX_VALUE;
    }
    return mvcc.memstoreReadPoint();
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:7,代码来源:HRegion.java

示例3: getReadpoint

public long getReadpoint(IsolationLevel isolationLevel) {
  if (isolationLevel == IsolationLevel.READ_UNCOMMITTED) {
    // This scan can read even uncommitted transactions
    return Long.MAX_VALUE;
  }
  return mvcc.memstoreReadPoint();
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:7,代码来源:HRegion.java

示例4: getReadPoint

/**
 * @return readpoint considering given IsolationLevel. Pass {@code null} for default
 */
public long getReadPoint(IsolationLevel isolationLevel) {
  if (isolationLevel != null && isolationLevel == IsolationLevel.READ_UNCOMMITTED) {
    // This scan can read even uncommitted transactions
    return Long.MAX_VALUE;
  }
  return mvcc.getReadPoint();
}
 
开发者ID:apache,项目名称:hbase,代码行数:10,代码来源:HRegion.java

示例5: RegionScannerImpl

RegionScannerImpl(Scan scan, List<KeyValueScanner> additionalScanners, HRegion region)
    throws IOException {
  // DebugPrint.println("HRegionScanner.<init>");
  this.region = region;
  this.filter = scan.getFilter();
  this.batch = scan.getBatch();
  if (Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW)) {
    this.stopRow = null;
  } else {
    this.stopRow = scan.getStopRow();
  }
  // If we are doing a get, we want to be [startRow,endRow] normally
  // it is [startRow,endRow) and if startRow=endRow we get nothing.
  this.isScan = scan.isGetScan() ? -1 : 0;

  // synchronize on scannerReadPoints so that nobody calculates
  // getSmallestReadPoint, before scannerReadPoints is updated.
  IsolationLevel isolationLevel = scan.getIsolationLevel();
  synchronized(scannerReadPoints) {
    if (isolationLevel == IsolationLevel.READ_UNCOMMITTED) {
      // This scan can read even uncommitted transactions
      this.readPt = Long.MAX_VALUE;
      MultiVersionConsistencyControl.setThreadReadPoint(this.readPt);
    } else {
      this.readPt = MultiVersionConsistencyControl.resetThreadReadPoint(mvcc);
    }
    scannerReadPoints.put(this, this.readPt);
  }

  // Here we separate all scanners into two lists - scanner that provide data required
  // by the filter to operate (scanners list) and all others (joinedScanners list).
  List<KeyValueScanner> scanners = new ArrayList<KeyValueScanner>();
  List<KeyValueScanner> joinedScanners = new ArrayList<KeyValueScanner>();
  if (additionalScanners != null) {
    scanners.addAll(additionalScanners);
  }

  for (Map.Entry<byte[], NavigableSet<byte[]>> entry :
      scan.getFamilyMap().entrySet()) {
    Store store = stores.get(entry.getKey());
    KeyValueScanner scanner = store.getScanner(scan, entry.getValue());
    if (this.filter == null || !scan.doLoadColumnFamiliesOnDemand()
      || FilterBase.isFamilyEssential(this.filter, entry.getKey())) {
      scanners.add(scanner);
    } else {
      joinedScanners.add(scanner);
    }
  }
  this.storeHeap = new KeyValueHeap(scanners, comparator);
  if (!joinedScanners.isEmpty()) {
    this.joinedHeap = new KeyValueHeap(joinedScanners, comparator);
  }
  
  // whether to use index
  byte[] tmpvalue=scan.getAttribute(IndexConstants.SCAN_WITH_INDEX);
  if(tmpvalue!=null){        
    this.useIndex = Bytes.toBoolean(tmpvalue);
  }
  tmpvalue=scan.getAttribute(IndexConstants.MAX_SCAN_SCALE);
  float maxScale=IndexConstants.DEFAULT_MAX_SCAN_SCALE;
  if(tmpvalue!=null){
    maxScale = Bytes.toFloat(tmpvalue);
  }
  if (this.useIndex) {
    indexTree = ScanPreprocess.preprocess(this.region, scan.getFilter(), maxScale);
    if (indexTree!=null) {
      useIndex = true;
      long buildStartTime = System.currentTimeMillis();
      generateCandidateRows(scan);
      this.indexReadTime = (System.currentTimeMillis() - buildStartTime) - this.indexMergeTime - this.indexSortTime;
    } else {
      useIndex = false;
      LOG.debug("skip using index");
    }
  }
}
 
开发者ID:wanhao,项目名称:IRIndex,代码行数:76,代码来源:HRegion.java

示例6: RegionScannerImpl

RegionScannerImpl(Scan scan, List<KeyValueScanner> additionalScanners, HRegion region)
    throws IOException {

  this.region = region;
  this.maxResultSize = scan.getMaxResultSize();
  if (scan.hasFilter()) {
    this.filter = new FilterWrapper(scan.getFilter());
  } else {
    this.filter = null;
  }

  this.batch = scan.getBatch();
  if (Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW) && !scan.isGetScan()) {
    this.stopRow = null;
  } else {
    this.stopRow = scan.getStopRow();
  }
  // If we are doing a get, we want to be [startRow,endRow] normally
  // it is [startRow,endRow) and if startRow=endRow we get nothing.
  this.isScan = scan.isGetScan() ? -1 : 0;

  // synchronize on scannerReadPoints so that nobody calculates
  // getSmallestReadPoint, before scannerReadPoints is updated.
  IsolationLevel isolationLevel = scan.getIsolationLevel();
  synchronized(scannerReadPoints) {
    if (isolationLevel == IsolationLevel.READ_UNCOMMITTED) {
      // This scan can read even uncommitted transactions
      this.readPt = Long.MAX_VALUE;
      MultiVersionConsistencyControl.setThreadReadPoint(this.readPt);
    } else {
      this.readPt = MultiVersionConsistencyControl.resetThreadReadPoint(mvcc);
    }
    scannerReadPoints.put(this, this.readPt);
  }

  // Here we separate all scanners into two lists - scanner that provide data required
  // by the filter to operate (scanners list) and all others (joinedScanners list).
  List<KeyValueScanner> scanners = new ArrayList<KeyValueScanner>();
  List<KeyValueScanner> joinedScanners = new ArrayList<KeyValueScanner>();
  if (additionalScanners != null) {
    scanners.addAll(additionalScanners);
  }

  for (Map.Entry<byte[], NavigableSet<byte[]>> entry :
      scan.getFamilyMap().entrySet()) {
    Store store = stores.get(entry.getKey());
    KeyValueScanner scanner = store.getScanner(scan, entry.getValue());
    if (this.filter == null || !scan.doLoadColumnFamiliesOnDemand()
      || this.filter.isFamilyEssential(entry.getKey())) {
      scanners.add(scanner);
    } else {
      joinedScanners.add(scanner);
    }
  }
  this.storeHeap = new KeyValueHeap(scanners, comparator);
  if (!joinedScanners.isEmpty()) {
    this.joinedHeap = new KeyValueHeap(joinedScanners, comparator);
  }
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:59,代码来源:HRegion.java

示例7: RegionScannerImpl

RegionScannerImpl(Scan scan, List<KeyValueScanner> additionalScanners, HRegion region)
    throws IOException {
  // DebugPrint.println("HRegionScanner.<init>");
  this.region = region;
  this.filter = scan.getFilter();
  this.batch = scan.getBatch();
  if (Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW)) {
    this.stopRow = null;
  } else {
    this.stopRow = scan.getStopRow();
  }
  // If we are doing a get, we want to be [startRow,endRow] normally
  // it is [startRow,endRow) and if startRow=endRow we get nothing.
  this.isScan = scan.isGetScan() ? -1 : 0;

  // synchronize on scannerReadPoints so that nobody calculates
  // getSmallestReadPoint, before scannerReadPoints is updated.
  IsolationLevel isolationLevel = scan.getIsolationLevel();
  synchronized(scannerReadPoints) {
    if (isolationLevel == IsolationLevel.READ_UNCOMMITTED) {
      // This scan can read even uncommitted transactions
      this.readPt = Long.MAX_VALUE;
      MultiVersionConsistencyControl.setThreadReadPoint(this.readPt);
    } else {
      this.readPt = MultiVersionConsistencyControl.resetThreadReadPoint(mvcc);
    }
    scannerReadPoints.put(this, this.readPt);
  }

  // Here we separate all scanners into two lists - scanner that provide data required
  // by the filter to operate (scanners list) and all others (joinedScanners list).
  List<KeyValueScanner> scanners = new ArrayList<KeyValueScanner>();
  List<KeyValueScanner> joinedScanners = new ArrayList<KeyValueScanner>();
  if (additionalScanners != null) {
    scanners.addAll(additionalScanners);
  }

  for (Map.Entry<byte[], NavigableSet<byte[]>> entry :
      scan.getFamilyMap().entrySet()) {
    Store store = stores.get(entry.getKey());
    KeyValueScanner scanner = store.getScanner(scan, entry.getValue());
    if (this.filter == null || !scan.doLoadColumnFamiliesOnDemand()
      || FilterBase.isFamilyEssential(this.filter, entry.getKey())) {
      scanners.add(scanner);
    } else {
      joinedScanners.add(scanner);
    }
  }
  this.storeHeap = new KeyValueHeap(scanners, comparator);
  if (!joinedScanners.isEmpty()) {
    this.joinedHeap = new KeyValueHeap(joinedScanners, comparator);
  }
}
 
开发者ID:zwqjsj0404,项目名称:HBase-Research,代码行数:53,代码来源:HRegion.java

示例8: RegionScannerImpl

RegionScannerImpl(Scan scan, List<KeyValueScanner> additionalScanners) throws IOException {
  //DebugPrint.println("HRegionScanner.<init>");

  this.maxResultSize = scan.getMaxResultSize();
  if (scan.hasFilter()) {
    this.filter = new FilterWrapper(scan.getFilter());
  } else {
    this.filter = null;
  }

  this.batch = scan.getBatch();
  if (Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW)) {
    this.stopRow = null;
  } else {
    this.stopRow = scan.getStopRow();
  }
  // If we are doing a get, we want to be [startRow,endRow] normally
  // it is [startRow,endRow) and if startRow=endRow we get nothing.
  this.isScan = scan.isGetScan() ? -1 : 0;

  // synchronize on scannerReadPoints so that nobody calculates
  // getSmallestReadPoint, before scannerReadPoints is updated.
  IsolationLevel isolationLevel = scan.getIsolationLevel();
  synchronized(scannerReadPoints) {
    if (isolationLevel == IsolationLevel.READ_UNCOMMITTED) {
      // This scan can read even uncommitted transactions
      this.readPt = Long.MAX_VALUE;
      MultiVersionConsistencyControl.setThreadReadPoint(this.readPt);
    } else {
      this.readPt = MultiVersionConsistencyControl.resetThreadReadPoint(mvcc);
    }
    scannerReadPoints.put(this, this.readPt);
  }

  // Here we separate all scanners into two lists - scanner that provide data required
  // by the filter to operate (scanners list) and all others (joinedScanners list).
  List<KeyValueScanner> scanners = new ArrayList<KeyValueScanner>();
  List<KeyValueScanner> joinedScanners = new ArrayList<KeyValueScanner>();
  if (additionalScanners != null) {
    scanners.addAll(additionalScanners);
  }

  for (Map.Entry<byte[], NavigableSet<byte[]>> entry :
      scan.getFamilyMap().entrySet()) {
    Store store = stores.get(entry.getKey());
    KeyValueScanner scanner = store.getScanner(scan, entry.getValue());
    if (this.filter == null || !scan.doLoadColumnFamiliesOnDemand()
      || this.filter.isFamilyEssential(entry.getKey())) {
      scanners.add(scanner);
    } else {
      joinedScanners.add(scanner);
    }
  }
  this.storeHeap = new KeyValueHeap(scanners, comparator);
  if (!joinedScanners.isEmpty()) {
    this.joinedHeap = new KeyValueHeap(joinedScanners, comparator);
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:58,代码来源:HRegion.java


注:本文中的org.apache.hadoop.hbase.client.IsolationLevel.READ_UNCOMMITTED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。