Examples of HiveLock


Examples of org.apache.hadoop.hive.ql.lockmgr.HiveLock

        });

      Iterator<HiveLock> locksIter = locks.iterator();

      while (locksIter.hasNext()) {
        HiveLock lock = locksIter.next();
        outStream.writeBytes(lock.getHiveLockObject().getDisplayName());
        outStream.write(separator);
        outStream.writeBytes(lock.getHiveLockMode().toString());
        if (isExt) {
          outStream.write(terminator);
          HiveLockObjectData lockData = lock.getHiveLockObject().getData();
          if (lockData != null) {
            outStream.writeBytes("LOCK_QUERYID:" + lockData.getQueryId() + " ");
            outStream.writeBytes("LOCK_TIME:" + lockData.getLockTime() + " ");
            outStream.writeBytes("LOCK_MODE:" + lockData.getLockMode() + " ");
          }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.lockmgr.HiveLock

      new HiveLockObjectData(lockTbl.getQueryId(),
                             String.valueOf(System.currentTimeMillis()),
                             "EXPLICIT");

    if (partSpec == null) {
      HiveLock lck = lockMgr.lock(new HiveLockObject(tbl, lockData), mode, true, 0, 0);
      if (lck == null) {
        return 1;
      }
      return 0;
    }

    Partition par = db.getPartition(tbl, partSpec, false);
    if (par == null) {
      throw new HiveException("Partition " + partSpec + " for table " + tabName + " does not exist");
    }
    HiveLock lck = lockMgr.lock(new HiveLockObject(par, lockData), mode, true, 0, 0);
    if (lck == null) {
      return 1;
    }
    return 0;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.lockmgr.HiveLock

    if ((locks == null) || (locks.isEmpty())) {
      throw new HiveException("Table " + tabName + " is not locked ");
    }
    Iterator<HiveLock> locksIter = locks.iterator();
    while (locksIter.hasNext()) {
      HiveLock lock = locksIter.next();
      lockMgr.unlock(lock);
    }

    return 0;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.lockmgr.HiveLock

        });

      Iterator<HiveLock> locksIter = locks.iterator();

      while (locksIter.hasNext()) {
        HiveLock lock = locksIter.next();
        outStream.writeBytes(lock.getHiveLockObject().getDisplayName());
        outStream.write(separator);
        outStream.writeBytes(lock.getHiveLockMode().toString());
        if (isExt) {
          HiveLockObjectData lockData = lock.getHiveLockObject().getData();
          if (lockData != null) {
            outStream.write(terminator);
            outStream.writeBytes("LOCK_QUERYID:" + lockData.getQueryId());
            outStream.write(terminator);
            outStream.writeBytes("LOCK_TIME:" + lockData.getLockTime());
View Full Code Here

Examples of org.apache.hadoop.hive.ql.lockmgr.HiveLock

                             String.valueOf(System.currentTimeMillis()),
                             "EXPLICIT",
                             lockTbl.getQueryStr());

    if (partSpec == null) {
      HiveLock lck = lockMgr.lock(new HiveLockObject(tbl, lockData), mode, true);
      if (lck == null) {
        return 1;
      }
      return 0;
    }

    Partition par = db.getPartition(tbl, partSpec, false);
    if (par == null) {
      throw new HiveException("Partition " + partSpec + " for table " + tabName + " does not exist");
    }
    HiveLock lck = lockMgr.lock(new HiveLockObject(par, lockData), mode, true);
    if (lck == null) {
      return 1;
    }
    return 0;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.lockmgr.HiveLock

    if ((locks == null) || (locks.isEmpty())) {
      throw new HiveException("Table " + tabName + " is not locked ");
    }
    Iterator<HiveLock> locksIter = locks.iterator();
    while (locksIter.hasNext()) {
      HiveLock lock = locksIter.next();
      lockMgr.unlock(lock);
    }

    return 0;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.lockmgr.HiveLock

      if ((prevLockObj != null) && (prevLockObj.getName().equals(lockObject.getName()))) {
        prevLockObj = lockObject;
        continue;
      }

      HiveLock lock = null;
      try {
        lock = lock(lockObject.getObj(), lockObject.getMode(), keepAlive, true);
      } catch (LockException e) {
        console.printError("Error in acquireLocks..." );
        LOG.error("Error in acquireLocks...", e);
View Full Code Here

Examples of org.apache.hadoop.hive.ql.lockmgr.HiveLock

   **/
  public void releaseLocks(List<HiveLock> hiveLocks) {
    if (hiveLocks != null) {
      int len = hiveLocks.size();
      for (int pos = len-1; pos >= 0; pos--) {
        HiveLock hiveLock = hiveLocks.get(pos);
        try {
          LOG.info(" about to release lock for " + hiveLock.getHiveLockObject().getName());
          unlock(hiveLock);
        } catch (LockException e) {
          // The lock may have been released. Ignore and continue
          LOG.warn("Error when releasing lock", e);
        }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.lockmgr.HiveLock

            LOG.error("Error in getting data for " + curChild, e);
            // ignore error
          }
        }
        obj.setData(data);
        HiveLock lck = (HiveLock)(new ZooKeeperHiveLock(curChild, obj, mode));
        locks.add(lck);
      }
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.lockmgr.HiveLock

      if ((prevLockObj != null) && (prevLockObj.getName().equals(lockObject.getName()))) {
        prevLockObj = lockObject;
        continue;
      }

      HiveLock lock = null;
      try {
        lock = lock(lockObject.getObj(), lockObject.getMode(), false, true);
      } catch (LockException e) {
        console.printError("Error in acquireLocks: "+ e.getLocalizedMessage());
        lock = null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.