001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase.procedure2;
019
020import java.util.List;
021
022import org.apache.yetus.audience.InterfaceAudience;
023
024@InterfaceAudience.Private
025public class LockedResource {
026  private final LockedResourceType resourceType;
027  private final String resourceName;
028  private final LockType lockType;
029  private final Procedure<?> exclusiveLockOwnerProcedure;
030  private final int sharedLockCount;
031  private final List<Procedure<?>> waitingProcedures;
032
033  public LockedResource(LockedResourceType resourceType, String resourceName,
034      LockType lockType, Procedure<?> exclusiveLockOwnerProcedure,
035      int sharedLockCount, List<Procedure<?>> waitingProcedures) {
036    this.resourceType = resourceType;
037    this.resourceName = resourceName;
038    this.lockType = lockType;
039    this.exclusiveLockOwnerProcedure = exclusiveLockOwnerProcedure;
040    this.sharedLockCount = sharedLockCount;
041    this.waitingProcedures = waitingProcedures;
042  }
043
044  public LockedResourceType getResourceType() {
045    return resourceType;
046  }
047
048  public String getResourceName() {
049    return resourceName;
050  }
051
052  public LockType getLockType() {
053    return lockType;
054  }
055
056  public Procedure<?> getExclusiveLockOwnerProcedure() {
057    return exclusiveLockOwnerProcedure;
058  }
059
060  public int getSharedLockCount() {
061    return sharedLockCount;
062  }
063
064  public List<Procedure<?>> getWaitingProcedures() {
065    return waitingProcedures;
066  }
067}