org.apache.ignite.spi.systemview.view.datastructures

## Class SemaphoreView

- java.lang.Object
- - org.apache.ignite.spi.systemview.view.datastructures.SemaphoreView

    public class SemaphoreView
    extends Object

`IgniteSemaphore` representation for a `SystemView`.

See Also:
  `Ignite.semaphore(String, int, boolean, boolean)`

### Field Summary

Fields
`protected T` `ds` Data structure instance.

### Constructor Summary

Constructors
Constructor and Description
`SemaphoreView(GridCacheRemovable ds)`

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `availablePermits()`
`boolean` `broken()`
`boolean` `failoverSafe()`
`int` `groupId()`
`String` `groupName()`
`boolean` `hasQueuedThreads()`
`String` `name()`
`int` `queueLength()`
`boolean` `removed()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### ds

    protected final T extends AtomicDataStructureProxy ds

Data structure instance.

### Constructor Detail

#### SemaphoreView

    public SemaphoreView(GridCacheRemovable ds)

Parameters:
  `ds` - Data structure instance.

### Method Detail

#### availablePermits

    public long availablePermits()

Returns:
  Number of permits available.
See Also:
  `IgniteSemaphore.availablePermits()`

#### hasQueuedThreads

    public boolean hasQueuedThreads()

Returns:
  `True` if there may be other threads waiting to acquire the lock.
See Also:
  `IgniteSemaphore.hasQueuedThreads()`

#### queueLength

    public int queueLength()

Returns:
  The estimated number of nodes waiting for this lock.
See Also:
  `IgniteSemaphore.getQueueLength()`

#### failoverSafe

    public boolean failoverSafe()

Returns:
  `True` if this semaphore is failover safe.
See Also:
  `IgniteSemaphore.isFailoverSafe()`

#### broken

    public boolean broken()

Returns:
  `True` if a node failed on this semaphore and `failoverSafe()` flag was set to `false`, `false` otherwise.
See Also:
  `IgniteSemaphore.isBroken()`

#### name

    public String name()

Returns:
  Name.

#### groupName

    public String groupName()

Returns:
  Group name.

#### groupId

    public int groupId()

Returns:
  Group id.

#### removed

    public boolean removed()

Returns:
  `True` is data structure removed.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023