Java 类org.apache.hadoop.hbase.exceptions.LockTimeoutException 实例源码

项目:ditb    文件:TableLockManager.java   
@Override
public void acquire() throws IOException {
  if (LOG.isTraceEnabled()) {
    LOG.trace("Attempt to acquire table " + (isShared ? "read" : "write") +
      " lock on: " + tableName + " for:" + purpose);
  }

  lock = createTableLock();
  try {
    if (lockTimeoutMs == -1) {
      // Wait indefinitely
      lock.acquire();
    } else {
      if (!lock.tryAcquire(lockTimeoutMs)) {
        throw new LockTimeoutException("Timed out acquiring " +
          (isShared ? "read" : "write") + "lock for table:" + tableName +
          "for:" + purpose + " after " + lockTimeoutMs + " ms.");
      }
    }
  } catch (InterruptedException e) {
    LOG.warn("Interrupted acquiring a lock for " + tableName, e);
    Thread.currentThread().interrupt();
    throw new InterruptedIOException("Interrupted acquiring a lock");
  }
  if (LOG.isTraceEnabled()) LOG.trace("Acquired table " + (isShared ? "read" : "write")
      + " lock on " + tableName + " for " + purpose);
}
项目:pbase    文件:TableLockManager.java   
@Override
public void acquire() throws IOException {
  if (LOG.isTraceEnabled()) {
    LOG.trace("Attempt to acquire table " + (isShared ? "read" : "write") +
      " lock on: " + tableName + " for:" + purpose);
  }

  lock = createTableLock();
  try {
    if (lockTimeoutMs == -1) {
      // Wait indefinitely
      lock.acquire();
    } else {
      if (!lock.tryAcquire(lockTimeoutMs)) {
        throw new LockTimeoutException("Timed out acquiring " +
          (isShared ? "read" : "write") + "lock for table:" + tableName +
          "for:" + purpose + " after " + lockTimeoutMs + " ms.");
      }
    }
  } catch (InterruptedException e) {
    LOG.warn("Interrupted acquiring a lock for " + tableName, e);
    Thread.currentThread().interrupt();
    throw new InterruptedIOException("Interrupted acquiring a lock");
  }
  if (LOG.isTraceEnabled()) LOG.trace("Acquired table " + (isShared ? "read" : "write")
      + " lock on " + tableName + " for " + purpose);
}
项目:HIndex    文件:TableLockManager.java   
@Override
public void acquire() throws IOException {
  if (LOG.isTraceEnabled()) {
    LOG.trace("Attempt to acquire table " + (isShared ? "read" : "write") +
      " lock on: " + tableName + " for:" + purpose);
  }

  lock = createTableLock();
  try {
    if (lockTimeoutMs == -1) {
      // Wait indefinitely
      lock.acquire();
    } else {
      if (!lock.tryAcquire(lockTimeoutMs)) {
        throw new LockTimeoutException("Timed out acquiring " +
          (isShared ? "read" : "write") + "lock for table:" + tableName +
          "for:" + purpose + " after " + lockTimeoutMs + " ms.");
      }
    }
  } catch (InterruptedException e) {
    LOG.warn("Interrupted acquiring a lock for " + tableName, e);
    Thread.currentThread().interrupt();
    throw new InterruptedIOException("Interrupted acquiring a lock");
  }
  if (LOG.isTraceEnabled()) LOG.trace("Acquired table " + (isShared ? "read" : "write")
      + " lock on " + tableName + " for " + purpose);
}
项目:PyroDB    文件:TableLockManager.java   
@Override
public void acquire() throws IOException {
  if (LOG.isTraceEnabled()) {
    LOG.trace("Attempt to acquire table " + (isShared ? "read" : "write") +
      " lock on: " + tableName + " for:" + purpose);
  }

  lock = createTableLock();
  try {
    if (lockTimeoutMs == -1) {
      // Wait indefinitely
      lock.acquire();
    } else {
      if (!lock.tryAcquire(lockTimeoutMs)) {
        throw new LockTimeoutException("Timed out acquiring " +
          (isShared ? "read" : "write") + "lock for table:" + tableName +
          "for:" + purpose + " after " + lockTimeoutMs + " ms.");
      }
    }
  } catch (InterruptedException e) {
    LOG.warn("Interrupted acquiring a lock for " + tableName, e);
    Thread.currentThread().interrupt();
    throw new InterruptedIOException("Interrupted acquiring a lock");
  }
  if (LOG.isTraceEnabled()) LOG.trace("Acquired table " + (isShared ? "read" : "write")
      + " lock on " + tableName + " for " + purpose);
}
项目:c5    文件:TableLockManager.java   
@Override
public void acquire() throws IOException {
  if (LOG.isTraceEnabled()) {
    LOG.trace("Attempt to acquire table " + (isShared ? "read" : "write") +
      " lock on: " + tableName + " for:" + purpose);
  }

  lock = createTableLock();
  try {
    if (lockTimeoutMs == -1) {
      // Wait indefinitely
      lock.acquire();
    } else {
      if (!lock.tryAcquire(lockTimeoutMs)) {
        throw new LockTimeoutException("Timed out acquiring " +
          (isShared ? "read" : "write") + "lock for table:" + tableName +
          "for:" + purpose + " after " + lockTimeoutMs + " ms.");
      }
    }
  } catch (InterruptedException e) {
    LOG.warn("Interrupted acquiring a lock for " + tableName, e);
    Thread.currentThread().interrupt();
    throw new InterruptedIOException("Interrupted acquiring a lock");
  }
  if (LOG.isTraceEnabled()) LOG.trace("Acquired table " + (isShared ? "read" : "write")
      + " lock on " + tableName + " for " + purpose);
}