BlackRay 0.9.0 Manual

The BlackRay Development Team

License Information

This document is licensed under the Creative Commons Attribution-Share Alike 3.0 License.
The following is a human-readable summary of the legal code, which can be obtained from http://creativecommons.org/licenses/by-sa/3.0/legalcode
You are free:
to Share — to copy, distribute and transmit the work
to Remix — to adapt the work
Under the following conditions:
Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license.
With the understanding that:
Waiver — Any of the above conditions can be waived if you get permission from the copyright holder.

Other Rights — In no way are any of the following rights affected by the license:

  • Your fair dealing or fair use rights;

  • The author's moral rights;

  • Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.

Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to the web page.

Trademarks

In this document, all trademark references are made without the ™ or ® signs commonly used in the United states. SoftMethod, nexgenda, and BlackRay are registered trademarks of SoftMethod GmbH. Windows is a registered trademark of Microsoft Corporation. Solaris is a trademark of Sun Microsystems, Inc. SPARC is a registered trademark of SPARC International, Inc. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. Linux is a registered trademark of Linus Torvalds. Red Hat is a registered trademark of Red Hat, Inc. All other product or corporate references may be trademarks or registered trademarks of their respective companies.


Table of Contents

Preface
1. About BlackRay
2. Conventions Used in This Document
1. Getting Started
1.1. BlackRay Overview
1.2. Installation
1.3. Running the Samples
1.4. Configuring BlackRay
1.5. Starting BlackRay
1.6. Loading Data
1.7. Taking a Snapshot
2. Installation
2.1. Installation from a Binary Distribution
Installing the Binary Tarball
Installing the RPM Distribution
Installing the Debian Distribution
Installing the Solaris Distribution
2.2. Installation from the Source Distribution
Requirements
Getting the Source
Installing the BlackRay Third-Party Libraries
Installing BlackRay
3. Configuration
3.1. Management Server Configuration
3.2. Instance Server Configuration
A. Server Applications
blackray_start — Starts the BlackRay management server
blackray_stop — Stops the BlackRay management server
blackray_inst_start — Starts a BlackRay instance
blackray_inst_stop — Stops a BlackRay instance
blackray_inst_take_snapshot — Creates a snapshot BlackRay instance.
B. Client Applications
blackray_cli — The blackray command line interface.
blackray_loader — The blackray data loader.
C. Load Script Reference
load-script — The root element of a loader script.
table-def — Table definition.
column-def — Column definition.
function — Function definition.
index — A Function-based index.
insert-function — Insert function definition for a function-based index.
select-function — Select function definition for a function-based index.
load-data — Loads data into a table.
column — Specifies the data source of a table column.

Preface

1. About BlackRay

Today’s world of connected data continues to pose a great challenge to modern organizations. Ever growing heaps of data need to be sorted, categorized, analyzed and made available to decision makers and other stakeholders, in order to make sound and efficient choices.

BlackRay technology makes just that possible, with greatly reduced complexity and at a fraction of the cost of competing technologies. Powerful features, straightforward architecture and great extensibility make BlackRay technology a premier choice for your high volume data needs.

BlackRay is structured like a traditional database, and supports relational data modeling using tables and joined indices. Support for instances and schemas allows for separation of data into different domains, enabling data protection and versioning.

2. Conventions Used in This Document

This document uses the following typographical conventions:

Screen output, file names, file contents, program code and everything else that represents machine input or output uses a monospaced font. Placeholders are indicated in italics. This means that you have to put in an acutal value instead of the placeholder. Required user input within phrases is emphasized using a bold font.

1. Getting Started

1.1. BlackRay Overview

BlackRay has several specific expressions, some of them are explained in the following to get a better understanding.

Instance

A single installation of BlackRay consists of at least one instance. An instance is a collection of schemas containing tables and data. One installation can handle several instances. Instances can separately be started, stopped, loaded and saved. An instance can have several schemas.

Schema

A schema is a collection of tables with data stored. A schema is a logical separation of tables. Refer to the SQL standards to learn more about schemas. BlackRay handles schemas according to the SQL standard.

Snapshot

A snapshot can be taken from instances. For each instance there can exist several snapshots. Snapshots actually save the schemas, tables and data stored in one instance to the hard disk. Snapshots are stored in binary format and can be reloaded. Each snapshot in the history can be specifically loaded.

Management Server

The management server of a BlackRay installation is the central unit handling the connections and queries. One management server can serve for several instances.

1.2. Installation

In order to use BlackRay, you need to have a working installation. If BlackRay is not yet installed on your system, please refer to Chapter 2, Installation for further instructions.

1.3. Running the Samples

After successfully installing BlackRay, the best way to get started is to run the sample programs. They are located in the directory samples of your BlackRay distribution.

Each sample is located within a separate sub-directory and should contain a file named README with instructions on how to run the sample.

1.4. Configuring BlackRay

In order to run a BlackRay instance, you have to configure your installation first. The BlackRay configuration is located in a centralized configuration file called /opt/blackray/config/blackray.conf. Let's start by creating a simple configuration file for a single blackray instance:

ManagementServer.Endpoints=default -p 8888 1
ManagementServer.Instances=Samples 2

ManagementServer.Instance.Samples.Name=Samples
ManagementServer.Instance.Samples.Directory=/opt/blackray/data 3
ManagementServer.Instance.Samples.Endpoints.Search=default -p 8889 4
ManagementServer.Instance.Samples.Endpoints.Infra=default -p 8890 5
ManagementServer.Instance.Samples.Autostart=true 6
ManagementServer.Instance.Samples.ReadOnly=false 7
ManagementServer.Instance.Samples.Log=true 8
ManagementServer.Instance.Samples.Log.Directory=/opt/blackray/log 9
ManagementServer.Instance.Samples.LazyWrite=true 10

1

This tells the management server to listen on tcp port 8888. For further information on the syntax of this parameter please take a look at the ManagementServer.Endpoints (string, mandatory) configuration parameter documentation.

2

The management server is responsible for managing the instance Samples. Although the management server is able to manage multiple instance, we start off with a single instance for the sake of simplicity.

3

Sets the directory where the instance Samples reads and writes its snapshots. Make sure that the directory exists and that the instance server has read and write permissions in this directory.

4 5

Sets the endpoints for querying (port 8889) and loading (port 8890) the instance. The syntax is the same as for the management server.

6

Tells the management server to automatically start the instance.

7

Allows manipulation of the instance.

8 9

Enables logging. The log files are written to the directory /opt/blackray/log.

10

Configures the instance to not write snapshots to disk after modification. Snapshots have to be taken manually.

1.5. Starting BlackRay

After the configuration file has been created, it is time to start the BlackRay Data Engine. To do so, you can use the command blackray_start:

shell> /opt/blackray/bin/blackray_start
    __    __           __
   / /_  / /___ ______/ /___________ ___  __
  / __ \/ / __ `/ ___/ //_/ ___/ __ `/ / / /
 / /_/ / / /_/ / /__/ ,> / /  / /_/ / /_/ /
/_.___/_/\__,_/\___/_/|_/_/   \__,_/\__, /
                                   /____/
  Blackray Management Server Administrator V0.9.0

     [Starting] Management Server
      [Started] Management Server
shell>

For stopping the BlackRay Data Engine, there exists a similar command named blackray_stop.

After startup, check if everything is working as it should by connecting to the instance on the command line interface (blackray_cli):

shell> /opt/blackray/bin/blackray_cli
    __    __           __
   / /_  / /___ ______/ /___________ ___  __
  / __ \/ / __ `/ ___/ //_/ ___/ __ `/ / / /
 / /_/ / / /_/ / /__/ ,< / /  / /_/ / /_/ /
/_.___/_/\__,_/\___/_/|_/_/   \__,_/\__, /
                                   /____/
  Blackray Command Line Interface V0.9.0

blackray_cli> connect to 'default -p 8889'; 1
blackray_cli> show schemas; 2

|-----------|------|
| name      | size |
|-----------|------|
| <Default> | 0    |
|-----------|------|

1 row selected.

blackray_cli> disconnect; 3
blackray_cli> quit; 4
shell> 
1

Connect to the search endpoint of your sample instance running at port 8889. Note that you can also specify the endpoint by starting the command line interface with blackray_cli -e "default -p 8889".

2

Issue a command to show the schemas of the instance. Currently, only the default schema is defined because we have just started the instance without loading any data.

3 4

Disconnect and exit the BlackRay CLI.

1.6. Loading Data

Now that the BlackRay server is up and running we should go ahead and load some data into it. This is done by using the blackray_loader command.

First we have to create a loader definition file. Let's name it load.xml:

<load-script>

 <table-def name="my_table" schema="my_schema"> 1
  <column-def name="my_column" type="string" tokenizing=" "
                 searchable="yes" compress="no" wildcards="yes" /> 2
 </table-def>

 <load-data table="my_table" schema="my_schema" file="data.csv"> 3
  <column name="my_column" csv-column="0"> 4
   <function type="trim" /> 5
  </column>
 </load-data>

</load-script>
1

Defines a table named my_table in the schema named my_schema.

2

The schema holds a single column named my_column. The column is of type string and a search index is created for this column, as the attribute searchable is set to yes. The content of this column is tokenized with an empty space as delimiter (parameter tokenized), so you can do a full text search in this column. Also, searching with leading wildcards is enabled, as the attribute wildcards is set to yes. Note that trailing wildcards are always enabled by default if the column is searchable.

3

Instructs the loader to load data into our table my_table from the file data.csv.

4

The data for the column my_column is loaded from the column at position 0 in the csv file.

5

Additionally, the column is trimmed before it is loaded into the database. If the sequence of columns in my_table is the same as in the csv file, and if you do not want to specify some additional load functions, you can omit the definition of the columns for the loader.

Now you need to fill your csv file data.csv with some content:

"Lorem ipsum dolor sit amet",0
" consectetuer sadipscing elitr  ",1
"sed diam nonumy eirmod tempor",2

To load the data into your running instance, use the command blackray_loader (let's assume your csv data file is contained in the directory /tmp):

shell> /opt/blackray/bin/blackray_loader -c load.xml -d /tmp \
       -e "default -p 8890"
    __    __           __
   / /_  / /___ ______/ /___________ ___  __
  / __ \/ / __ `/ ___/ //_/ ___/ __ `/ / / /
 / /_/ / / /_/ / /__/ ,< / /  / /_/ / /_/ /
/_.___/_/\__,_/\___/_/|_/_/   \__,_/\__, /
                                   /____/
  Blackray Loader V0.9.0

Connecting to endpoint: default -p 8890
Creating schema my_schema
Creating table my_schema.my_table
Loading data into table my_schema.my_table from file data.csv
shell>

Now that you have created your first BlackRay table and loaded some data into it, you can start playing around on the command line interface:

shell> /opt/blackray/bin/blackray_cli -e "default -p 8889" -q
blackray_cli> select * from my_schema.my_table;

|-------------------------------|
| my_column                     |
|-------------------------------|
| Lorem ipsum dolor sit amet    |
| consectetuer sadipscing elitr |
| sed diam nonumy eirmod tempor |
|-------------------------------|

3 rows selected.

blackray_cli> select * from my_schema.my_table where my_column = 'dolor';

|----------------------------|
| my_column                  |
|----------------------------|
| Lorem ipsum dolor sit amet |
|----------------------------|

1 row selected.

blackray_cli> select * from my_schema.my_table where my_column like '%m';

|-------------------------------|
| my_column                     |
|-------------------------------|
| Lorem ipsum dolor sit amet    |
| sed diam nonumy eirmod tempor |
|-------------------------------|

2 rows selected.

blackray_cli> 

1.7. Taking a Snapshot

Once your data has been loaded into blackray, you can make the data permanent by creating a snapshot. This way, your data will automatically be reloaded when your instance is restarted. To do so, use the command blackray_inst_take_snapshot to take a snapshot of your Samples instance:

shell> /opt/blackray/bin/blackray_inst_take_snapshot Samples
    __    __           __
   / /_  / /___ ______/ /___________ ___  __
  / __ \/ / __ `/ ___/ //_/ ___/ __ `/ / / /
 / /_/ / / /_/ / /__/ ,< / /  / /_/ / /_/ /
/_.___/_/\__,_/\___/_/|_/_/   \__,_/\__, /
                                   /____/
  Blackray Management Server Administrator V0.9.0

Taking snapshot on Instance Server: Samples.
Taking snapshot on Instance Server: Samples finished after 0s.
shell> 

2. Installation

This chapter describes the installation of the BlackRay Data Engine. The easiest way to install BlackRay is to install from a binary distribution. If you like to, or if there are no binaries available for your platform, you can also install BlackRay from the source distribution.

2.1. Installation from a Binary Distribution

Binary distributions are the easiest way to install BlackRay on your system. Visit the BlackRay website at http://www.blackray.org and download the distribution for your operating system. If there is no binary distribution available for your environment, you can try to install BlackRay from the source distribution.

[Note]Note

Installation of software packages usually requires administrator privileges. The following instructions assume that you are performing the required steps as root. When unsure, please contact your system administrator.

Installing the Binary Tarball

To install BlackRay from a binary tarball, download the archive matching your system environment from the BlackRay website. The naming scheme for the binary tarball is blackray_VERSION_SYSTEM.tar.gz, where VERSION is the BlackRay version number and SYSTEM describes the operating system and architecture the package was built for. The binary archive contains the third-party libraries as well as the BlackRay binaries, so there is no need to download any additional packages. When the download is finished, install the packages by entering the following commands (Make sure you have administrator privileges):

shell> cd /opt
shell> tar zxf blackray_VERSION_SYSTEM.tar.gz

Installing the RPM Distribution

To install BlackRay from rpm packages, download the packages matching your environment from the BlackRay website. The naming scheme for the packages is blackray_VERSION_SYSTEM.rpm and blackray-thirdparty_VERSION_SYSTEM.rpm, where VERSION is the BlackRay version number and SYSTEM describes the operating system and architecture the package was built for. When the download is finished, install the packages by entering the following commands:

shell> rpm -i blackray-thirdparty_VERSION_SYSTEM.rpm
shell> rpm -i blackray_VERSION_SYSTEM.rpm

Installing the Debian Distribution

To install the BlackRay Debian packages, download the packages matching your environment from the BlackRay website. The naming scheme for the packages is blackray_VERSION_SYSTEM.deb and blackray-thirdparty_VERSION_SYSTEM.deb, where VERSION represents the BlackRay version number and SYSTEM describes the operating system and architecture the package was built for. When the download is finished, you can install the packages by entering the following commands:

shell> dpkg -i blackray-thirdparty_VERSION_SYSTEM.deb
shell> dpkg -i blackray_VERSION_SYSTEM.deb

Installing the Solaris Distribution

To install the BlackRay Solaris packages, download the packages matching your environment from the BlackRay website. The naming scheme for the packages is blackray_VERSION_SYSTEM.pkg and blackray-thirdparty_VERSION_SYSTEM.pkg, where VERSION represents the BlackRay version number and SYSTEM describes the operating system and architecture the package was built for. When the download is finished, you can install the packages by entering the following commands:

shell> pkgadd -d blackray-thirdparty_VERSION_SYSTEM.pkg
shell> pkgadd -d blackray_VERSION_SYSTEM.pkg

2.2. Installation from the Source Distribution

This chapter describes how to build and install the BlackRay Data Engine from the source code distribution.

Requirements

The following prerequisites are needed for building BlackRay from source:

  • cmake 2.6.3 or higher. Earlier versions will have problems finding the boost libraries with some compiler combinations.

  • GNU make. The recommended GNU make version is 3.81 or later. Other make programs will not work. Note that on some systems GNU make is installed as gmake or has to be installed separately. This document will refer to GNU make with the command name make.

  • A C++ compiler. BlackRay has been tested and is known to compile with the following compilers:

    • gcc 4.1.3 and 4.3.2 on Linux

    • gcc 4.0.1 as supplied by XCode on Mac OS X

    • Sun Studio 12 on Solaris

  • Also, make sure that the development header files of your operating system are installed. For example on Solaris you have to install the package SUNWhea manually, because it is not installed by default.

  • Sun JDK 1.6 or later

  • In addition, BlackRay requires several third-party libraries, which are bundled into a separate package. See the section called “Getting the Source” for more details.

  • To build some of the third-party libraries, Apache Ant 1.5 or higher is required.

  • Optionally, if you want to build the BlackRay SNMP library, you need to have the Net-SNMP library and headers installed.

Getting the Source

BlackRay source distributions are provided as gzip compressed tar archives. The naming scheme for the distribution is blackray-VERSION.tar.gz, where VERSION is the BlackRay version number (e.g. 0.8.0).

BlackRay requires several third-party libraries. The third-party sources are bundled into a separate package. The naming scheme for the third-party distribution is blackray-thirdparty-VERSION.tar.gz, where VERSION is the BlackRay version number.

For obtaining the latest source distributions, visit the BlackRay website at http://www.blackray.org. After you have downloaded the sources, unpack them by executing the following commands:

shell> gunzip blackray-thirdparty-VERSION.tar.gz
shell> tar xf blackray-thirdparty-VERSION.tar
shell> gunzip blackray-VERSION.tar.gz
shell> tar xf blackray-VERSION.tar

By executing these steps, two directories blackray-thirdparty-VERSION and blackray-VERSION will be extracted, containing the sources of the third-party libraries and the BlackRay sources.

Installing the BlackRay Third-Party Libraries

The basic installation procedure for the BlackRay third-party libraries can be summarized by the following steps, which we will describe in more detail afterwards:

shell> cmake .
shell> make
shell> make install

  1. Configure

    Before you build the third-party source, you have to configure the source tree for your build environment. This is achieved by invoking cmake in the root directory of the third-party sources. To configure with the default settings for your build environment simply run cmake . on the command line. This will generate the necessary Makefiles needed for building the third-party libraries on your system.

    The compiler used for building the libraries can be controlled by setting the environment variables CC and CXX. cmake then uses the specified compilers for the configuration of your build environment.

    [Note]Note

    To compile BlackRay on Solaris, you should use the Sun Studio compilers. If it is found on your system, cmake will choose gcc by default. In order to use the Sun compilers on Solaris, you have to invoke cmake by running CC=cc CXX=CC cmake . on the command line.

  2. Build

    After you have configured the source tree, you can start the build process by running GNU make from the root directory of the third-party sources. To start the build, type make on the command line.

    Building the third-party sources can take up to several hours depending on your hardware.

  3. Install

    After the third-party libraries have been successfully compiled, install them by entering make install. The compiled libraries will be installed in the directory /opt/blackray/thirdparty. This normally needs to be done as root. If you are installing the files as a normal user, make sure you have the appropriate permissions to create the install directories.

Installing BlackRay

Before you start building and installing BlackRay from Source, make sure that the third-party libraries are installed on your system. If you want to install them from source, please refer to the section called “Installing the BlackRay Third-Party Libraries”.

The installation procedure for BlackRay can be summarized in the following steps, which will be described in more detail later:

shell> cmake .
shell> make
shell> make test 1
shell> make install
1

This is an optional step. You can skip it if you do not want to run the regression tests.

  1. Configure

    Before you can build the BlackRay sources, you have to configure the source tree for your build environment. This is achieved by executing cmake in the root directory of the source tree. Execute cmake . to configure the source tree with the default settings for your build environment. This will generate the Makefiles needed for building BlackRay on your system.

    The compiler used for building the source can be controlled by setting the environment variables CC and CXX. cmake will use the specified compilers to configure your build environment.

    [Note]Note

    To compile BlackRay on Solaris, you should use the Sun Studio compilers. If it is found on your system, cmake will choose gcc by default. In order to use the Sun compilers on Solaris, you have to invoke cmake by running CC=cc CXX=CC cmake . on the command line.

  2. Build

    After you have configured the source tree, you can start building the sources by running GNU make from the toplevel directory of the source tree. To start the build, type make on the command line.

    The build will take several minutes depending on your hardware. So it's time to grab yourself a cup of coffee, or just sit back and relax.

  3. Test

    After the binaries have been compiled, you can run the regression tests if you like to. To do so, type make test on the command line.

  4. Install

    When BlackRay has been successfully built, you can install it by entering make install. BlackRay will be installed in the directory /opt/blackray. This normally needs to be done with superuser permissions. If you are installing the files as a normal user, make sure you have the appropriate permissions to create the installation directories.

3. Configuration

The BlackRay Data Engine is configured in one centralized file blackray.conf, which is located in the directory /opt/blackray/config of your BlackRay installation. To start with, you can either copy one of the example configurations included in this directory, or create a new file from scratch.

Each BlackRay environment consists of two types of server processes:

  • The management server process is responsible for management of the data instances. It automatically starts and stops the configured instances and controls the update of replicated instance nodes.

  • The instance server process is basically a single database instance. It holds the instance data in memory and is responsible for processing queries to the instance.

Note that while there can be several instance servers running on the same machine, there can only be one management server running.

3.1. Management Server Configuration

The following parameters control the operation of the management server.

ManagementServer.Endpoints (string, mandatory)

Configures the protocols, interfaces and ports on which the management server is listening. The endpoint is configured by a string of the format protocol -h host -p port, where

  • protocol sets the protocol to be used for connections. Supported protocols are tcp, udp and ssl. Setting the value to default will use the default protocol (tcp).

  • -h host specifies the host name or IP address on which the management server is listening for connections. If not specified (or specified as -h * or -h 0.0.0.0), the server will be listening on all network interfaces.

  • -p port specifies the port number on which the management server will be listening.

Example: The value default -h localhost -p 8888 configures the management server to be listening for tcp connections on port 8888 of the loopback interface.

ManagementServer.Instances (string, mandatory)

A comma-separated list of all managed instances. Note that you also have to configure the parameters of each instance listed in this parameter. Please refer to Section 3.2, “Instance Server Configuration” for details.

3.2. Instance Server Configuration

The following parameters control the operation of an instance server. They have to be configured for each instance listed in the ManagementServer.Instances parameter. Replace the variable NAME with the name of each instance from the list.

ManagementServer.Instance.NAME.Name (string, madatory)

The public name of the instance.

ManagementServer.Instance.NAME.Directory (string, mandatory)

Configures the data directory of the instance. The data directory contains the snapshots and redologs of the BlackRay instance. Although relative paths are accepted here, it is recommended that you use an absolute path. If you use a relative path here, it will be relative to the directory where the instance server has been started.

ManagementServer.Instance.NAME.Endpoints.Search (string, mandatory)

Configures the protocols, interfaces and ports on which the instance server is listening. These settings will be used by client connections for querying the instance. For information on the syntax of this parameter please refer to the ManagementServer.Endpoints configuration parameter.

ManagementServer.Instance.NAME.Endpoints.Infra (string, mandatory)

Configures the protocols, interfaces and ports on which the instance server is listening. The settings will be used by management connections. For information on the syntax of this parameter please refer to the ManagementServer.Endpoints configuration parameter.

ManagementServer.Instance.NAME.Autostart (boolean, mandatory)

Controls whether the instance will be automatically started by the management server:

  • If set to true, the management server will automatically start the instance.

  • If set to false, the instance has to be started manually.

ManagementServer.Instance.NAME.LazyWrite (boolean, mandatory)

Configures the snapshot behavior of the instance:

  • If set to true, snapshots will automatically be taken after data has been loaded into the instance.

  • If set to false, snapshots have to be taken manually.

ManagementServer.Instance.NAME.ReadOnly (boolean, mandatory)

Configures whether the loaded data can be altered.

  • If set to true, the instance cannot be modified after the initial snapshot has been loaded during startup.

  • If set to false, the instance can be altered by data operations.

ManagementServer.Instance.NAME.Log

Controls wether the instance server will log its messages to a file.

ManagementServer.Instance.NAME.Log.Directory (string, mandatory)

Configures the log directory for the instance. Although relative paths are accepted here, it is recommended that you use an absolute path. If you use a relative path here, it will be relative to the directory where the instance server has been started.

ManagementServer.Instance.NAME.MaxSnapshotBackupCount (integer, optional)

Sets the maximum number of snapshots that will be saved in the data directory of the instance. If the number of snapshots exceeds the allowed maximum, the oldest snapshots will be deleted.

ManagementServer.Instance.NAME.LoadSnapshotVersion (integer, optional)

If this parameter is set, the instance server will load the specified snapshot version in read-only mode during startup. If this parameter is not set, the instance server will load the newest snapshot available.

ManagementServer.Instance.NAME.Replicates.Endpoints (string, optional)

Needed for multi-node configurations where one instance is replicated to several copies. This parameter needs to be configured on the master node and should contain a comma-separated list of the replicated nodes' management endpoints.

ManagementServer.Instance.NAME.Replicates.MaxRetry (integer, optional)

Needed for multi-node configurations where one instance is replicated to several copies. This parameter sets the maximum number of times the master node should retry to update a replicated node in case of an error. If the number of retries exceeds the defined maximum, the previous snapshot will be loaded as a fallback solution.

ManagementServer.Instance.NAME.Replicates.MaxError (integer, optional)

Needed for multi-node configurations where one instance is replicated to several copies. This parameter sets the maximum number of failed instances after which an update will be aborted.

ManagementServer.Instance.NAME.Replicates.MinActive (integer, optional)

Needed for multi-node configurations where one instance is replicated to several copies. Sets the minimum number of nodes that have to remain in service during updates. If there are less nodes available for serving requests during the update, the currently running update will be aborted.

ManagementServer.Instance.NAME.ThreadPool.Server.Size (integer, mandatory)

Sets the number of threads that will be started initially for processing of queries.

ManagementServer.Instance.NAME.ThreadPool.Server.SizeMax (integer, mandatory)

Sets the maximum number of threads allowed for processing of queries.

ManagementServer.Instance.NAME.MesageSizeMax (integer, mandatory)

Sets the maximum size (in kB) allowed for messages between the instance server and connected clients.

Appendix A. Server Applications

Name

blackray_start — Starts the BlackRay management server

Synopsis

blackray_start

Description

Starts up the BlackRay management server. All instances with ManagementServer.Instance.NAME.Autostart enabled will be started automatically by the management server.


Name

blackray_stop — Stops the BlackRay management server

Synopsis

blackray_stop

Description

Shuts down the BlackRay management server. All instances will be automatically shut down.


Name

blackray_inst_start — Starts a BlackRay instance

Synopsis

blackray_inst_start {inst}

Description

Starts up the BlackRay instance inst.


Name

blackray_inst_stop — Stops a BlackRay instance

Synopsis

blackray_inst_stop {inst}

Description

Shuts down the BlackRay instance inst.


Name

blackray_inst_take_snapshot — Creates a snapshot BlackRay instance.

Synopsis

blackray_inst_take_snapshot {inst}

Description

Creates a snapshot of a running blackray instance. The snapshot will be placed in the directory specified by the ManagementServer.Instance.inst.Directory configuration parameter.

Appendix B. Client Applications

Name

blackray_cli — The blackray command line interface.

Synopsis

blackray_cli -h

blackray_cli -v

blackray_cli [-q] [-e endpoint] [-c sql]

Description

blackray_cli is the BlackRay command line interface. You can use it execute SQL commands interactively on a running BlackRay instance.

Options

-c sql

Run the SQL command specified by sql and exit.

-e endpoint

Connect to the specified instance specified by endpoint.

-h

Print a help message and exit.

-q

Quiet mode.

-v

Print the version number and exit.

Examples

The following command connects to the instance running at the host foo on port 8889:

blackray_cli -e "default -h foo -p 8889"

Use the following command to connect to the instance running at the host foo on port 8889 and run the sql query select * from schema.table:

blackray_cli -e "default -h foo -p 8889" -c "select * from schema.table"


Name

blackray_loader — The blackray data loader.

Synopsis

blackray_loader -h

blackray_loader -v

blackray_loader {-c control-file} [-d directory] {-e endpoint} [-q]

Description

blackray_loader is used to load data into the BlackRay data engine.

Options

-c control-file

Read the table and loader definitions from the specified control-file.

-d directory

Use the specified directory as the data directory. All data files specified in the control file are relative to this data directory.

-e endpoint

Connect to the instance specified by endpoint. Be sure to use the infrastructure endpoint of the instance.

-h

Print a help message and exit.

-q

Quiet mode.

-v

Print the version number and exit.

Examples

The following command executes the load statements in the control-file ./foo.xml and assumes the required data files are located in the directory /tmp:

blackray_cli -c ./foo.xml -d /tmp

Appendix C. Load Script Reference

Name

load-script — The root element of a loader script.

Synopsis

load-script ::=

  • Sequence of:

    • table-def

  • Sequence of:

    • load-data

Attributes

None.

Description

The load-script element is the root element for all loader scripts. It contains one or more table-def elements to define the structure of the tables to be loaded, followed by one or more load-data elements to actually load the data into those tables.

Parents

None.

Children

The following elements occur in load-script: table-def , load-data

Examples

<load-script>
 <table-def name="mytable" schema="myschema">
  <!-- ... -->
 </table-def>
 
 <load-data table="mytable" schema="myschema" file="data.csv">
  <!-- ... -->
 </load-data>
</load-script>

Name

table-def — Table definition.

Synopsis

table-def ::=

  • Sequence of:

    • column-def

Attributes

  • name

  • schema

Required attributes are shown in bold.

Description

Defines the structure of a table which will be created in the BlackRay instance.

Attributes

name

The name of the table that is to be defined.

schema

The schema where the table should be created in.

Parents

These elements contain table-def: load-script

Children

The following elements occur in table-def: column-def

Examples

<table-def name="mytable" schema="myschema">
 <column-def name="column_1" type="string" tokenizing=" "
                  searchable="yes" wildcards="no" />
  
 <!-- ... --> 
</table-def>

Name

column-def — Column definition.

Synopsis

column-def ::=

  • function?

  • Zero or More of :

    • index

Attributes

  • name

  • type

  • searchable

  • tokenizing

  • compress

  • wildcards

Required attributes are shown in bold.

Description

Defines a column for a table. If a function is defined for this column, the specified function will be used as a base function. This means the specified function will be applied to data before inserting it into the column as well as to search terms before searching in this column.

Additionally, multiple indexes can be defined for this column, which do not modify the original data stored in the column but instead create a separate function-based index for searching the column.

Attributes

name

The name of the column defined by this element.

type

The type of the column defined by this element. One of: integer, long, string

searchable

If set to yes, a search index for the column is created. If set to no, the column cannot be searched.

tokenizing

If set to yes the content of this column will be tokenized in order to enable a full-text search on this column.

compress

If set to yes the search index for this column will be compressed.

wildcards

If set to yes, searches with leading wildcards will be enabled for this column. Searches with trailing wildcards are supported by default.

Parents

These elements contain column-def: table-def

Children

The following elements occur in column-def: index, function

Examples

<column-def name="column_1" type="string" tokenizing=" "
                  searchable="yes" wildcards="no">
 <function type="normalize" />
 <!-- ... --> 
   
 <index name="myindex" type="string" tokenizing=" " wildcards="true">
  <!-- ... -->
 </index>
</column-def>

Name

function — Function definition.

Synopsis

function ::=

  • function?

Attributes

  • type

Required attributes are shown in bold.

Description

Defines a function. Functions can be wrapped around other functions by nesting another function element inside the current function element.

Attributes

type

The type of the function defined by this element. Currently the following function types are defined:

  • lower

  • upper

  • trim

  • normalize

  • phonetic

Parents

These elements contain function: column-def , column

Children

The following elements occur in function: function

Examples

<function type="normalize">
 <function type="trim" /> 
</function>

Name

index — A Function-based index.

Synopsis

index ::=

  • insert-function?

  • select-function?

Attributes

  • name

  • type

  • tokenizing

  • wildcards

Required attributes are shown in bold.

Description

Defines a function-based index. The index can be used for searching in the column in which the index is defined.

The function-based index is composed of a select-function and an insert-function. The insert-function is applied when data is inserted into the column. The select-function is applied when searching on the function-based index of a column. Usually, the insert-function and select-function are equal.

Attributes

name

The name of the function-based index.

type

The type of the function-based index. One of: integer, long, string

tokenizing

If set to yes the content of the function-based index will be tokenized .

wildcards

If set to yes, searches with leading wildcards will be enabled for the function-based index. Searches with trailing wildcards are supported by default.

Parents

These elements contain index: column-def

Children

The following elements occur in index: insert-function , select-function

Examples

<index name="myindex" type="string" tokenizing=" " wildcards="true">
 <insert-function type="phonetic" />
 <select-function type="phonetic" />
</index>

Name

insert-function — Insert function definition for a function-based index.

Synopsis

insert-function ::=

  • function?

Attributes

  • type

Required attributes are shown in bold.

Description

Defines an insert function for a function based index. The insert function is applied when data is inserted into the owning column. Functions can be wrapped around other functions by nesting another function element inside the current function element.

Attributes

type

The type of the function defined by this element. Currently the following function types are defined:

  • lower

  • upper

  • trim

  • normalize

  • phonetic

Parents

These elements contain insert-function: index

Children

The following elements occur in insert-function: function

Examples

<insert-function type="phonetic">
 <function type="normalize />
</insert-function>

Name

select-function — Select function definition for a function-based index.

Synopsis

select-function ::=

  • function?

Attributes

  • type

Required attributes are shown in bold.

Description

Defines a select function for a function based index. The select function is applied when a search on the owning index is performed. Functions can be wrapped around other functions by nesting another function element inside the current function element.

Attributes

type

The type of the function defined by this element. Currently the following function types are defined:

  • lower

  • upper

  • trim

  • normalize

  • phonetic

Parents

These elements contain select-function: index

Children

The following elements occur in select-function: function

Examples

<select-function type="phonetic">
 <function type="normalize />
</select-function>

Name

load-data — Loads data into a table.

Synopsis

load-data ::=

  • Sequence of:

    • column

Attributes

  • file

  • schema

  • table

  • encoding

  • separator

Required attributes are shown in bold.

Description

Loads a data file into a previously defined table.

Attributes

file

The name of the data file.

schema

The schema of the table to load data into.

table

The name of the table to load data into.

encoding

The encoding of the data file.

separator

The separator for the columns in the data file.

Parents

These elements contain load-data: load-script

Children

The following elements occur in load-data: column

Examples

<load-data table="mytable" schema="myschema"
           file="data.csv" encoding="UTF-8">
 <column name="column_1" csv-column="0" />
 <!-- ... -->
</load-data>

Name

column — Specifies the data source of a table column.

Synopsis

column ::=

  • function?

Attributes

  • name

  • csv-column

Required attributes are shown in bold.

Description

Specifies the origin of a table column when loaded from a data file. During loading of the data, a function can be specified, which will be applied before inserting data into the table column.

Attributes

name

The name of the target column.

csv-column

The column position in the data file from which the column data should be loaded.

Parents

These elements contain column: load-data

Children

The following elements occur in column: function

Examples

<column name="column_1" csv-column="0">
 <function type="trim" />
</column