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;
021import org.apache.yetus.audience.InterfaceAudience;
022
023@InterfaceAudience.Private
024public class LockedResource {
025  private final LockedResourceType resourceType;
026  private final String resourceName;
027  private final LockType lockType;
028  private final Procedure<?> exclusiveLockOwnerProcedure;
029  private final int sharedLockCount;
030  private final List<Procedure<?>> waitingProcedures;
031
032  public LockedResource(LockedResourceType resourceType, String resourceName, LockType lockType,
033    Procedure<?> exclusiveLockOwnerProcedure, int sharedLockCount,
034    List<Procedure<?>> waitingProcedures) {
035    this.resourceType = resourceType;
036    this.resourceName = resourceName;
037    this.lockType = lockType;
038    this.exclusiveLockOwnerProcedure = exclusiveLockOwnerProcedure;
039    this.sharedLockCount = sharedLockCount;
040    this.waitingProcedures = waitingProcedures;
041  }
042
043  public LockedResourceType getResourceType() {
044    return resourceType;
045  }
046
047  public String getResourceName() {
048    return resourceName;
049  }
050
051  public LockType getLockType() {
052    return lockType;
053  }
054
055  public Procedure<?> getExclusiveLockOwnerProcedure() {
056    return exclusiveLockOwnerProcedure;
057  }
058
059  public int getSharedLockCount() {
060    return sharedLockCount;
061  }
062
063  public List<Procedure<?>> getWaitingProcedures() {
064    return waitingProcedures;
065  }
066}