Skip to content

Overview of SDK

The SDK is an API to retrieve objects created in VOR Stream, functions to facilitate file system access, and functions to support the processing in VOR stream. Developers can use this API to build functionality in computational nodes in VOR Stream.

The SDK contains functions to:

  1. Retrieve VOR Stream objects

  2. Access and read data from file system

  3. Support processing

The functions are available for use in both Golang and Python.

The sdk code is generated in both Go and Python using Google's Protocol Buffers (Protobuf). Protobuf is a language-neutral, platform-neutral, extensible mechanism used to create structured data that can be compiled to generate code in several languages. The proto compiler is invoked at build time on .proto files. The .proto files in our VOR Stream project are compiled when building the sdk-api container and copied into the built container.

Generally, the .proto files are separated into Messages and Services. Messages (google.protobuf.message) are a way to organize your data, similar to JSON. These messages will describe all the underlying data including types. There are primitive types (int32, string), structures (map, repeated - An array ), and user defined types within a proto file and imported types. Services are an interface using a Remote Procedure Call (RPC) system. This will generate an abstract interface and a corresponding "stub" implementation. The stub forwards all calls to an RpcChannel, which is an abstract interface that is user-defined. In other words, a Service creates a method of accessing data created by the messages.

Below are a few examples of how to define messages and services:

import "study.proto";

message RunDetails {
  int32 ID = 1;
  string Name = 2;
  Study Study = 3;
  google.protobuf.Timestamp StartDate = 4;
  string Comment = 5;
  StudyRunOption Options = 6;
  string Playpen = 7;
  int32 PlaypenID = 8;
  string User = 9;
}

message GetRunDetailsInput {
  int32 RunID = 1;
}
service RunService {
  rpc GetRunDetails(GetRunDetailsInput) returns (RunDetails) {}
}