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


Java LeaseStillHeldException类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException的典型用法代码示例。如果您正苦于以下问题:Java LeaseStillHeldException类的具体用法?Java LeaseStillHeldException怎么用?Java LeaseStillHeldException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: addScanner

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
private RegionScannerHolder addScanner(String scannerName, RegionScanner s, Shipper shipper,
    HRegion r, boolean needCursor) throws LeaseStillHeldException {
  Lease lease = regionServer.leases.createLease(scannerName, this.scannerLeaseTimeoutPeriod,
    new ScannerListener(scannerName));
  RpcCallback shippedCallback = new RegionScannerShippedCallBack(scannerName, shipper, lease);
  RpcCallback closeCallback;
  if (s instanceof RpcCallback) {
    closeCallback = (RpcCallback) s;
  } else {
    closeCallback = new RegionScannerCloseCallBack(s);
  }
  RegionScannerHolder rsh =
      new RegionScannerHolder(scannerName, s, r, closeCallback, shippedCallback, needCursor);
  RegionScannerHolder existing = scanners.putIfAbsent(scannerName, rsh);
  assert existing == null : "scannerId must be unique within regionserver's whole lifecycle! " +
    scannerName;
  return rsh;
}
 
开发者ID:apache,项目名称:hbase,代码行数:19,代码来源:RSRpcServices.java

示例2: addScanner

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
long addScanner(RegionScanner s, Region r) throws LeaseStillHeldException {
  long scannerId = this.scannerIdGen.incrementAndGet();
  String scannerName = String.valueOf(scannerId);

  RegionScannerHolder existing =
    scanners.putIfAbsent(scannerName, new RegionScannerHolder(s, r));
  assert existing == null : "scannerId must be unique within regionserver's whole lifecycle!";

  regionServer.leases.createLease(scannerName, this.scannerLeaseTimeoutPeriod,
      new ScannerListener(scannerName));
  return scannerId;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:13,代码来源:RSRpcServices.java

示例3: addScanner

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
protected long addScanner(RegionScanner s) throws LeaseStillHeldException {
  long scannerId = -1L;
  scannerId = rand.nextLong();
  String scannerName = String.valueOf(scannerId);
  scanners.put(scannerName, s);
  this.leases.createLease(scannerName, new ScannerListener(scannerName));
  return scannerId;
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:9,代码来源:HRegionServer.java

示例4: addRowLock

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
protected long addRowLock(Integer r, HRegion region) throws LeaseStillHeldException {
  long lockId = -1L;
  lockId = rand.nextLong();
  String lockName = String.valueOf(lockId);
  rowlocks.put(lockName, r);
  this.leases.createLease(lockName, new RowLockListener(lockName, region));
  return lockId;
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:9,代码来源:HRegionServer.java

示例5: addScanner

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
long addScanner(RegionScanner s, HRegion r) throws LeaseStillHeldException {
    long scannerId = this.scannerIdGen.incrementAndGet();
    String scannerName = String.valueOf(scannerId);

    RegionScannerHolder existing =
            scanners.putIfAbsent(scannerName, new RegionScannerHolder(s, r));
    assert existing == null : "scannerId must be unique within regionserver's whole lifecycle!";

    regionServer.leases.createLease(scannerName, this.scannerLeaseTimeoutPeriod,
            new ScannerListener(scannerName));
    return scannerId;
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:13,代码来源:RSRpcServices.java

示例6: addPScanner

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
long addPScanner(PRegionScanner s, HRegion r) throws LeaseStillHeldException {
    long scannerId = this.scannerIdGen.incrementAndGet();
    String scannerName = String.valueOf(scannerId);

    PRegionScannerHolder existing =
            pscanners.putIfAbsent(scannerName, new PRegionScannerHolder(s, r));
    assert existing == null : "scannerId must be unique within regionserver's whole lifecycle!";


    //todo:
   /* regionServer.leases.createLease(scannerName, this.scannerLeaseTimeoutPeriod,
            new ScannerListener(scannerName));*/
    return scannerId;
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:15,代码来源:RSRpcServices.java

示例7: addScanner

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
protected long addScanner(RegionScanner s, HRegion r) throws LeaseStillHeldException {
  long scannerId = this.scannerIdGen.incrementAndGet();
  String scannerName = String.valueOf(scannerId);

  RegionScannerHolder existing =
    scanners.putIfAbsent(scannerName, new RegionScannerHolder(s, r));
  assert existing == null : "scannerId must be unique within regionserver's whole lifecycle!";

  this.leases.createLease(scannerName, this.scannerLeaseTimeoutPeriod,
      new ScannerListener(scannerName));

  return scannerId;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:14,代码来源:HRegionServer.java

示例8: addRowLock

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
protected long addRowLock(Integer r, HRegion region)
    throws LeaseStillHeldException {
  long lockId = -1L;
  lockId = rand.nextLong();
  String lockName = String.valueOf(lockId);
  rowlocks.put(lockName, r);
  this.leases.createLease(lockName, new RowLockListener(lockName, region));
  return lockId;
}
 
开发者ID:wanhao,项目名称:IRIndex,代码行数:10,代码来源:HRegionServer.java

示例9: addScannerLeaseBack

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
private void addScannerLeaseBack(Leases.Lease lease) {
  try {
    regionServer.leases.addLease(lease);
  } catch (LeaseStillHeldException e) {
    // should not happen as the scanner id is unique.
    throw new AssertionError(e);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:9,代码来源:RSRpcServices.java

示例10: addScanner

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
long addScanner(RegionScanner s, HRegion r) throws LeaseStillHeldException {
  long scannerId = this.scannerIdGen.incrementAndGet();
  String scannerName = String.valueOf(scannerId);

  RegionScannerHolder existing =
    scanners.putIfAbsent(scannerName, new RegionScannerHolder(s, r));
  assert existing == null : "scannerId must be unique within regionserver's whole lifecycle!";

  regionServer.leases.createLease(scannerName, this.scannerLeaseTimeoutPeriod,
      new ScannerListener(scannerName));
  return scannerId;
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:13,代码来源:RSRpcServices.java

示例11: addScanner

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
protected long addScanner(RegionScanner s, HRegion r) throws LeaseStillHeldException {
  long scannerId = -1;
  while (true) {
    scannerId = Math.abs(rand.nextLong() << 24) ^ startcode;
    String scannerName = String.valueOf(scannerId);
    RegionScannerHolder existing =
      scanners.putIfAbsent(scannerName, new RegionScannerHolder(s, r));
    if (existing == null) {
      this.leases.createLease(scannerName, this.scannerLeaseTimeoutPeriod,
        new ScannerListener(scannerName));
      break;
    }
  }
  return scannerId;
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:16,代码来源:HRegionServer.java

示例12: addRowLock

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
protected long addRowLock(Integer r, HRegion region) throws LeaseStillHeldException {
  String lockName = null;
  long lockId;
  do {
    lockId = nextLong();
    lockName = String.valueOf(lockId);
  } while (rowlocks.putIfAbsent(lockName, r) != null);
  this.leases.createLease(lockName, this.rowLockLeaseTimeoutPeriod, new RowLockListener(lockName,
      region));
  return lockId;
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:12,代码来源:HRegionServer.java

示例13: addScanner

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
protected long addScanner(RegionScanner s) throws LeaseStillHeldException {
  long scannerId = -1;
  while (true) {
    scannerId = rand.nextLong();
    if (scannerId == -1) continue;
    String scannerName = String.valueOf(scannerId);
    RegionScannerHolder existing = scanners.putIfAbsent(scannerName, new RegionScannerHolder(s));
    if (existing == null) {
      this.leases.createLease(scannerName, this.scannerLeaseTimeoutPeriod,
          new ScannerListener(scannerName));
      break;
    }
  }
  return scannerId;
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:16,代码来源:HRegionServer.java

示例14: beginTransaction

import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; //导入依赖的package包/类
/**
 * @param transactionId
 * @throws IOException
 */
public void beginTransaction(final long transactionId) throws IOException {
    checkClosing();
    String key = String.valueOf(transactionId);
    if (transactionsById.get(key) != null) {
        TransactionState alias = getTransactionState(transactionId);
        if (alias != null) {
            alias.setStatus(Status.ABORTED);
            retireTransaction(alias);
        }
        LOG.error("Existing trasaction with id [" + key + "] in region ["
                + super.getRegionInfo().getRegionNameAsString() + "]");
        throw new IOException("Already exiting transaction id: " + key);
    }

    TransactionState state = new TransactionState(transactionId, super.getLog().getSequenceNumber(),
            super.getRegionInfo());

    state.setStartSequenceNumber(nextSequenceId.get());
    List<TransactionState> commitPendingCopy = new ArrayList<TransactionState>(commitPendingTransactions);
    for (TransactionState commitPending : commitPendingCopy) {
        state.addTransactionToCheck(commitPending);
    }

    synchronized (transactionsById) {
        transactionsById.put(key, state);
    }
    try {
        transactionLeases.createLease(getLeaseId(transactionId), new TransactionLeaseListener(key));
    } catch (LeaseStillHeldException e) {
        LOG.error("Lease still held for [" + key + "] in region [" + super.getRegionInfo().getRegionNameAsString()
                + "]");
        throw new RuntimeException(e);
    }
    LOG.debug("Begining transaction " + key + " in region " + super.getRegionInfo().getRegionNameAsString());

    maybeTriggerOldTransactionFlush();
}
 
开发者ID:mayanhui,项目名称:hbase-secondary-index,代码行数:42,代码来源:TransactionalRegion.java


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