com.hazelcast.concurrent.countdownlatch.operations

## Class SetCountOperation

- java.lang.Object
- - com.hazelcast.spi.Operation
  - - com.hazelcast.spi.impl.AbstractNamedOperation
    - - com.hazelcast.concurrent.countdownlatch.operations.SetCountOperation

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable, BackupAwareOperation, com.hazelcast.spi.impl.MutatingOperation, NamedOperation, PartitionAwareOperation

      public class SetCountOperation
      extends com.hazelcast.spi.impl.AbstractNamedOperation
      implements com.hazelcast.spi.impl.MutatingOperation

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.spi.impl.AbstractNamedOperation

      `name`

    - ### Fields inherited from class com.hazelcast.spi.Operation

      `GENERIC_PARTITION_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SetCountOperation()`
    `SetCountOperation(String name, int count)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getAsyncBackupCount()` The asynchronous backup count.
    `Operation` | `getBackupOperation()` Creates the `BackupOperation` responsible for making the backup.
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `Object` | `getResponse()` Called if and only if `Operation.returnsResponse()` returned `true`, shortly after `Operation.run()` returns.
    `String` | `getServiceName()`
    `int` | `getSyncBackupCount()` The synchronous backup count.
    `protected void` | `readInternal(ObjectDataInput in)`
    `void` | `run()` Runs the operation.
    `boolean` | `shouldBackup()` Checks if a backup needs to be made.
    `protected void` | `writeInternal(ObjectDataOutput out)`

    - ### Methods inherited from class com.hazelcast.spi.impl.AbstractNamedOperation

      `getName, toString`

    - ### Methods inherited from class com.hazelcast.spi.Operation

      `afterRun, beforeRun, call, executedLocally, getCallerAddress, getCallerUuid, getCallId, getCallTimeout, getConnection, getInvocationTime, getLogger, getNodeEngine, getOperationResponseHandler, getPartitionId, getReplicaIndex, getService, getWaitTimeout, isUrgent, logError, onExecutionFailure, onInvocationException, onSetCallId, readData, requiresExplicitServiceName, returnsResponse, sendResponse, setCallerUuid, setNodeEngine, setOperationResponseHandler, setPartitionId, setReplicaIndex, setService, setServiceName, setValidateTarget, setWaitTimeout, toString, validatesTarget, writeData`

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

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

    - ### Methods inherited from interface com.hazelcast.spi.PartitionAwareOperation

      `getPartitionId`

    - ### Methods inherited from interface com.hazelcast.nio.serialization.DataSerializable

      `readData, writeData`

- - ### Constructor Detail

    - #### SetCountOperation

          public SetCountOperation()

    - #### SetCountOperation

          public SetCountOperation(String name,
                                   int count)

  - ### Method Detail

    - #### run

          public void run()
                   throws Exception

      Description copied from class: `Operation`
      Runs the operation. Either the `Operation.run()` or `Operation.call()` method should be implemented; not both. Runs after wait-support, supposed to do actual operation
      Overrides:
        `run` in class `Operation`
      Throws:
        `Exception`
      See Also:
        `Operation.call()`

    - #### getResponse

          public Object getResponse()

      Description copied from class: `Operation`
      Called if and only if `Operation.returnsResponse()` returned `true`, shortly after `Operation.run()` returns.
      Overrides:
        `getResponse` in class `Operation`

    - #### shouldBackup

          public boolean shouldBackup()

      Description copied from interface: `BackupAwareOperation`
      Checks if a backup needs to be made.

      If a call has not made any change, e.g. an AtomicLong increment with 0, no backup needs to be made.
      Specified by:
        `shouldBackup` in interface `BackupAwareOperation`
      Returns:
        true if a backup needs to be made, false otherwise.

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeInternal

          protected void writeInternal(ObjectDataOutput out)
                                throws IOException

      Overrides:
        `writeInternal` in class `com.hazelcast.spi.impl.AbstractNamedOperation`
      Throws:
        `IOException`

    - #### readInternal

          protected void readInternal(ObjectDataInput in)
                               throws IOException

      Overrides:
        `readInternal` in class `com.hazelcast.spi.impl.AbstractNamedOperation`
      Throws:
        `IOException`

    - #### getBackupOperation

          public Operation getBackupOperation()

      Description copied from interface: `BackupAwareOperation`
      Creates the `BackupOperation` responsible for making the backup.
      Specified by:
        `getBackupOperation` in interface `BackupAwareOperation`
      Returns:
        the created `BackupOperation` responsible for making the backup.

    - #### getSyncBackupCount

          public int getSyncBackupCount()

      Description copied from interface: `BackupAwareOperation`
      The synchronous backup count. If no backups need to be made, 0 is returned.
      Specified by:
        `getSyncBackupCount` in interface `BackupAwareOperation`
      Returns:
        the synchronous backup count.

    - #### getAsyncBackupCount

          public int getAsyncBackupCount()

      Description copied from interface: `BackupAwareOperation`
      The asynchronous backup count. If no asynchronous backups need to be made, 0 is returned.
      Specified by:
        `getAsyncBackupCount` in interface `BackupAwareOperation`
      Returns:
        the asynchronous backup count.

    - #### getServiceName

          public final String getServiceName()

      Overrides:
        `getServiceName` in class `Operation`

    - #### getFactoryId

          public final int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

Copyright © 2019. All rights reserved.