Class SpaceOperationsCoordinator

java.lang.Object
com.gigaspaces.internal.server.space.SpaceOperationsCoordinator

public class SpaceOperationsCoordinator extends Object
Coordinates execution of Concurrent and Critical space operations: - While a critical operation is executing, any other incoming operation is blocked until the critical operation is finished. - While a concurrent operation is executing, incoming concurrent operations are not blocked, but critical operations are blocked until all running concurrent operations are finished. Requests for concurrent operations which arrive after while there's a pending critical operations are blocked and scheduled afterwards, to avoid starvation of critical operations.
Since:
8.0
Author:
Niv Ingberg
  • Constructor Details

    • SpaceOperationsCoordinator

      public SpaceOperationsCoordinator(int numOfSegments)
  • Method Details

    • beginConcurrentOperation

      public void beginConcurrentOperation()
      Begins a concurrent operation. If a exclusive operation is in progress (i.e. beginExclusiveOperation() was called but endExclusiveOperation() was not called yet), invocation is blocked until the exclusive operation is finished. Blocking management is fair, i.e. if beginExclusiveOperation() was invoked and blocked, subsequent calls to beginConcurrentOperation() will be blocked as well and will be scheduled after the exclusive operation. It is the responsibility of the caller to call endConcurrentOperation() when the operation is finished.
    • endConcurrentOperation

      public void endConcurrentOperation()
      Ends a concurrent operation which was previously started via beginConcurrentOperation().
    • beginExclusiveOperation

      public void beginExclusiveOperation()
      Begins a exclusive operation. If one or more concurrent operations are in progress (i.e. beginConcurrentOperation() was called but endConcurrentOperation() was not called yet), invocation is blocked until all concurrent operations are finished. Blocking management is fair, i.e. if beginExclusiveOperation() was invoked and blocked, subsequent calls to beginConcurrentOperation() will be blocked as well and will be scheduled after the exclusive operation. It is the responsibility of the caller to call endConcurrentOperation() when the operation is finished.
    • endExclusiveOperation

      public void endExclusiveOperation()
      Ends a exclusive operation which was previously started via beginExclusiveOperation().