Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / eos-dom-akka / src / main / java / org / opendaylight / controller / eos / akka / DataCenterControl.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.eos.akka;
9
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.yang.common.Empty;
13
14 /**
15  * Service used to bring up/down the Entity Ownership Service service in individual datacenters.
16  * Active datacenter in native eos terms means that the candidates from this datacenter can become owners of entities.
17  * Additionally the singleton component makings ownership decisions, runs only in an active datacenter.
18  *
19  * <p>
20  * Caller must make sure that only one datacenter is active at a time, otherwise the singleton actors
21  * in each datacenter will interfere with each other. The methods provided byt this service can be called
22  * on any node from the datacenter to be activated. Datacenters only need to brought up when using non-default
23  * datacenter or multiple datacenters.
24  */
25 public interface DataCenterControl {
26     /**
27      * Activates the Entity Ownership Service in the datacenter that this method is called.
28      *
29      * @return Completion future
30      */
31     @NonNull ListenableFuture<Empty> activateDataCenter();
32
33     /**
34      * Deactivates the Entity Ownership Service in the datacenter that this method is called.
35      *
36      * @return Completion future
37      */
38     @NonNull ListenableFuture<Empty> deactivateDataCenter();
39 }