/** * Called by the ProcedureExecutor on procedure-load to restore the latch state */ protected synchronized void setChildrenLatch(int numChildren) { this.childrenLatch = numChildren; if (LOG.isTraceEnabled()) { LOG.trace("CHILD LATCH INCREMENT SET " + this.childrenLatch, new Throwable(this.toString())); } }
Procedure<TEnvironment> procedure) { Preconditions.checkArgument(procedure.getState() == ProcedureState.RUNNABLE, "NOT RUNNABLE! " + procedure.toString()); LOG.info("Initialized subprocedures=" + (subprocs == null? null: Stream.of(subprocs).map(e -> "{" + e.toString() + "}"). collect(Collectors.toList()).toString()));
/** * Called by the ProcedureExecutor on procedure-load to restore the latch state */ protected synchronized void setChildrenLatch(int numChildren) { this.childrenLatch = numChildren; if (LOG.isTraceEnabled()) { LOG.trace("CHILD LATCH INCREMENT SET " + this.childrenLatch, new Throwable(this.toString())); } }
/** * Called by the ProcedureExecutor on procedure-load to restore the latch state */ @InterfaceAudience.Private protected synchronized void setChildrenLatch(final int numChildren) { this.childrenLatch = numChildren; if (LOG.isTraceEnabled()) { LOG.trace("CHILD LATCH INCREMENT SET " + this.childrenLatch, new Throwable(this.toString())); } }
private TableQueue tryAcquireTableQueueSharedLock(final Procedure procedure, final TableName table) { TableQueue queue = getTableQueueWithLock(table); if (!queue.trySharedLock(lockManager, procedure.toString())) { return null; } return queue; }
/** * Try to acquire the exclusive lock on the specified table. * other operations in the table-queue will be executed after the lock is released. * @param procedure the procedure trying to acquire the lock * @param table Table to lock * @return true if we were able to acquire the lock on the table, otherwise false. */ public boolean tryAcquireTableExclusiveLock(final Procedure procedure, final TableName table) { schedLock.lock(); TableQueue queue = getTableQueue(table); if (!queue.tryExclusiveLock(procedure.getProcId())) { schedLock.unlock(); return false; } removeFromRunQueue(tableRunQueue, queue); schedLock.unlock(); // Zk lock is expensive... boolean hasXLock = queue.tryZkExclusiveLock(lockManager, procedure.toString()); if (!hasXLock) { schedLock.lock(); queue.releaseExclusiveLock(); addToRunQueue(tableRunQueue, queue); schedLock.unlock(); } return hasXLock; }
final Procedure<TEnvironment> procedure) { Preconditions.checkArgument(procedure.getState() == ProcedureState.RUNNABLE, procedure.toString()); LOG.info("Initialized subprocedures=" + (subprocs == null? null: Stream.of(subprocs).map(e -> "{" + e.toString() + "}"). collect(Collectors.toList()).toString()));
Procedure<TEnvironment> procedure) { Preconditions.checkArgument(procedure.getState() == ProcedureState.RUNNABLE, "NOT RUNNABLE! " + procedure.toString()); LOG.info("Initialized subprocedures=" + (subprocs == null? null: Stream.of(subprocs).map(e -> "{" + e.toString() + "}"). collect(Collectors.toList()).toString()));