docs: public byte[] getOrCreateId(final String name) throws HBaseException {
      try {
        return getIdAsync(name).joinUninterruptibly();
      } catch (NoSuchUniqueName e) {
        if (tsdb != null && tsdb.getUidFilter() != null && 
            tsdb.getUidFilter().fillterUIDAssignments()) {
          try {
            if (!tsdb.getUidFilter().allowUIDAssignment(type, name, null, null)
                  .join()) {
              rejected_assignments++;
              throw new FailedToAssignUniqueIdException(new String(kind), name, 0, 
                  "Blocked by UID filter.");
            }
          } catch (FailedToAssignUniqueIdException e1) {
            throw e1;
          } catch (InterruptedException e1) {
            LOG.error("Interrupted", e1);
            Thread.currentThread().interrupt();
          } catch (Exception e1) {
            throw new RuntimeException("Should never be here", e1);
          }
        }
        
        Deferred<byte[]> assignment = null;
        boolean pending = false;
        synchronized (pending_assignments) {
          assignment = pending_assignments.get(name);
          if (assignment == null) {
            // to prevent UID leaks that can be caused when multiple time
            // series for the same metric or tags arrive, we need to write a 
            // deferred to the pending map as quickly as possible. Then we can 
            // start the assignment process after we've stashed the deferred 
            // and released the lock
            assignment = new Deferred<byte[]>();
            pending_assignments.put(name, assignment);
          } else {
            pending = true;
          }
        }
        
        if (pending) {
          LOG.info("Already waiting for UID assignment: " + name);
          try {
            return assignment.joinUninterruptibly();
          } catch (Exception e1) {
            throw new RuntimeException("Should never be here", e1);
          }
        }
        
        // start the assignment dance after stashing the deferred
        byte[] uid = null;
        try {
          uid = new UniqueIdAllocator(name, assignment).tryAllocate().joinUninterruptibly();
        } catch (RuntimeException e1) {
          throw e1;
        } catch (Exception e1) {
          throw new RuntimeException("Should never be here", e);
        } finally {
          synchronized (pending_assignments) {
            if (pending_assignments.remove(name) != null) {
              LOG.info("Completed pending assignment for: " + name);
            }
          }
        }
        return uid;
      } catch (Exception e) {
        throw new RuntimeException("Should never be here", e);
      }
    }