Starting Mirrors from SAPI

Beginning with DataTurbine V3.2B5, it is possible to start Mirrors using the “simple API” (SAPI) programming interface. These methods have been added to SAPI’s “Control” class. Most useful to the end user, 2 convenience functions have been added which allow the user to easily mirror a source starting “now” and going indefinitely. With the addition of these methods, the user now has 3 ways to start mirrors:

1. Just as has always been done, continue to setup mirrors through rbnbAdmin.

2. Use a simple Java program such as the following. This program will mirror a source named “rbnbSource” from the DataTurbine at localhost:3333 to an output source named “mirrorSource” in the DataTurbine at localhost:4444.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import com.rbnb.sapi.Control;
public class MirrorTest {
  
    public static void main(String[] argsI) throws Exception {
  
    Control cont = new Control();
    cont.OpenRBNBConnection("localhost:3333","tempConnection”);
    
    // Can specify cache/archive or to match the originating source using the following:
    // cont.CreateMirrorOut("rbnbSource","localhost:4444","mirrorSource",0,0,(byte)0,true);
    // To automatically match the originating source:
    cont.CreateMirrorOut("rbnbSource","localhost:4444","mirrorSource");
    cont.CloseRBNBConnection();
  }
}

3. Matlab can be used to setup the mirrors, as the following example shows. In this example, a source named “rbnbSource” from the DataTurbine at localhost:3333 will be mirrored to an output source named “matlabMirrorSource” in the DataTurbine at localhost:4444.

1
2
3
4
>> c = com.rbnb.sapi.Control;
>> c.OpenRBNBConnection('localhost:3333','tempConnection')
>> c.CreateMirrorOut('rbnbSource','localhost:4444','matlabMirrorSource')
>> c.CloseRBNBConnection;
Open Source DataTurbine Initiative © 2016 Frontier Theme