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

项目:hbase    文件:RSRpcServices.java   
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;
}
项目:ditb    文件:RSRpcServices.java   
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;
}
项目:LCIndex-HBase-0.94.16    文件:HRegionServer.java   
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;
}
项目:LCIndex-HBase-0.94.16    文件:HRegionServer.java   
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;
}
项目:pbase    文件:RSRpcServices.java   
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;
}
项目:pbase    文件:RSRpcServices.java   
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;
}
项目:HIndex    文件:HRegionServer.java   
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;
}
项目:IRIndex    文件:HRegionServer.java   
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;
}
项目:IRIndex    文件:HRegionServer.java   
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;
}
项目:hbase    文件:RSRpcServices.java   
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);
  }
}
项目:RStore    文件:HRegionServer.java   
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;
}
项目:RStore    文件:HRegionServer.java   
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;
}
项目:PyroDB    文件:RSRpcServices.java   
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;
}
项目:c5    文件:HRegionServer.java   
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;
}
项目:HBase-Research    文件:HRegionServer.java   
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;
}
项目:HBase-Research    文件:HRegionServer.java   
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;
}
项目:hbase-0.94.8-qod    文件:HRegionServer.java   
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;
}
项目:hbase-0.94.8-qod    文件:HRegionServer.java   
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;
}
项目:hbase-0.94.8-qod    文件:HRegionServer.java   
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;
}
项目:hbase-0.94.8-qod    文件:HRegionServer.java   
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;
}
项目:DominoHBase    文件:HRegionServer.java   
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;
}
项目:DominoHBase    文件:HRegionServer.java   
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;
}
项目:hindex    文件:HRegionServer.java   
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;
}
项目:hindex    文件:HRegionServer.java   
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;
}
项目:hbase-secondary-index    文件:TransactionalRegion.java   
/**
 * @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();
}
项目:pbase    文件:RSRpcServices.java   
/******************************************************* to support operations parquet related  *****************************
 *
 * @author wangxiaoyi
 *
 */



long addPScanner(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;
}