Skip to content

Commit

Permalink
[gh-241] Rename tarantool_box to tarantool
Browse files Browse the repository at this point in the history
Update mans, docs.

A lot of resources still need to be updated (build scripts, etc).
  • Loading branch information
kostja committed Apr 10, 2014
1 parent 96c030f commit 3001eb1
Show file tree
Hide file tree
Showing 42 changed files with 158 additions and 440 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ lcov
src/bootstrap.h
src/lua/*.lua.c
src/box/lua/*.lua.c
src/box/tarantool_box
src/box/tarantool.cfg
src/tarantool
tarantool-*.tar.gz
test/connector_c/protocol
test/connector_c/rpl
Expand Down
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ find_program(LD ld)
find_program(POD2MAN pod2man)


#
# This instructs the rest of the build system what product
# and what modules to produce.
#
set (TARANTOOL_PRODUCT "box")
set (TARANTOOL_MODULES "box")
# Disable tarancheck and tarantar for 1.6
# set (TARANTOOL_CLIENTS "tarancheck" "tarantar")
set (TARANTOOL_CLIENTS "")
Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ Key features of the system:
* lua functions, procedures, triggers, with
rich access to database API, JSON support,
inter-procedure and network communication libraries
* a command line client supporting simple SQL and
a native Lua console

Tarantool is ideal for data-enriched components of
scalable Web architecture: traditional database caches, queue
Expand All @@ -34,8 +32,7 @@ CMake is used for configuration management.
also provides debugging capabilities
* Release -- use only if the highest performance is required

The only external library dependency is readline: libreadline-dev
is required to build the command line client.
The only external library dependency is readline: libreadline-dev.

There are two OPTIONAL dependencies:
- uuid-dev. It is required for box.uuid_* functions.
Expand All @@ -57,10 +54,9 @@ To use a different release type, say, RelWithDebugInfo, use:

Additional build options can be set similarly:

tarantool $ cmake . -DCMAKE_BUILD_TYPE=RelWithDebugInfo -DENABLE_CLIENT=true # builds the command line client.
tarantool $ cmake . -DCMAKE_BUILD_TYPE=RelWithDebugInfo -DENABLE_DOC=true # builds the docs

'make' creates tarantool_box executable in directory
src/box and tarantool executable in client/tarantool.
'make' creates tarantool executable in directory src/.

There is no 'make install' goal, but no installation
is required either.
Expand All @@ -77,15 +73,14 @@ Once all prerequisites are installed, try:

This will create a 'var' subdirectory in directory 'test',
populate it with necessary files, and
start the server. To connect, you could use
a simple command-line client:
start the server. To connect, start the server in interactive
mode:

tarantool $ ./test/tarantool
tarantool $ ./src/tarantool

Alternatively, if a customized server configuration is required,
you could follow these steps:


tarantool $ emacs cfg/tarantool.cfg # edit the configuration
# Initialize the storage directory, path to this directory
# is specified in the configuration file:
Expand Down
2 changes: 1 addition & 1 deletion cmake/package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set (CPACK_SOURCE_IGNORE_FILES
"CMakeFiles" "\\\\.gz" "\\\\.Z" "\\\\.zip" "\\\\.rpm"
"\\\\.o" "\\\\.so" "\\\\.a"
"client/tarantool/tarantool"
"src/box/tarantool_box"
"src/box/tarantool"
"install_manifest.txt"
"cmake_install.cmake" "test/var/"
)
Expand Down
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tarantool (1.5.2.16.g18b8e4e-1) unstable; urgency=low
* New Debian snapshot.
- Drop legacy packages (libtarantool*).
- Drop tarantool-dbg.
- Don't strip tarantool_box (it uses debug symbols runtime).
- Don't strip tarantool (it uses debug symbols runtime).

-- Dmitry E. Oboukhov <unera@debian.org> Fri, 20 Dec 2013 15:44:11 +0400

Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ DEB_CMAKE_NORMAL_ARGS := -DCMAKE_INSTALL_PREFIX="$(DEB_CMAKE_INSTALL_PREFIX)" \
DEB_SHLIBDEPS_INCLUDE := /usr/lib/tarantool/1.6
DEB_INSTALL_DOCS_ALL := -XTODO -XAUTHORS
DEB_DH_STRIP_ARGS_tarantool := -X/usr/bin/tarantool_box
DEB_DH_STRIP_ARGS_tarantool := -X/usr/bin/tarantool

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk
Expand Down
2 changes: 1 addition & 1 deletion debian/scripts/tarantool_instance
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CONFIG_DIR=/var/lib/tarantool/started
SNAPSHOT_DIR=/var/lib/tarantool/snapshot
PID_DIR=/var/run/tarantool
LOG_DIR=/var/log/tarantool
BOX=/usr/bin/tarantool_box
BOX=/usr/bin/tarantool
SSD=start-stop-daemon
CFG_DIR=/etc/tarantool/instances.enabled

Expand Down
2 changes: 1 addition & 1 deletion debian/tarantool-common.cron.hourly
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

test -x /usr/bin/tarantool_box || exit 0
test -x /usr/bin/tarantool || exit 0
test -x /usr/sbin/tarantool_snapshot_rotate || exit 0

exec /usr/sbin/tarantool_snapshot_rotate
2 changes: 1 addition & 1 deletion debian/tarantool-common.tarantool.init
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
CONF_DIR=/etc/tarantool/instances.enabled
SCRIPTNAME=/etc/init.d/tarantool
DAEMON=/usr/bin/tarantool_box
DAEMON=/usr/bin/tarantool
INSTANCES=`find $CONF_DIR -xtype f -name '*.cfg'`
INSTSCRIPT=/usr/sbin/tarantool_instance

Expand Down
2 changes: 1 addition & 1 deletion debian/tarantool.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
usr/bin/tarantool_box
usr/bin/tarantool
#usr/bin/tarantar
2 changes: 1 addition & 1 deletion debian/tarantool.lintian-overrides
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tarantool: unstripped-binary-or-object usr/bin/tarantool_box
tarantool: unstripped-binary-or-object usr/bin/tarantool
2 changes: 1 addition & 1 deletion debian/tarantool.manpages
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
build-area/doc/man/tarantool_box.1
build-area/doc/man/tarantool.1
#build-area/tarantar.1

10 changes: 2 additions & 8 deletions doc/man/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
add_custom_target(man ALL
COMMAND ${POD2MAN} -c 'high performance key/value storage server'
${CMAKE_SOURCE_DIR}/doc/man/tarantool_box.pod > ${PROJECT_BINARY_DIR}/doc/man/tarantool_box.1
COMMAND ${POD2MAN} -c 'readline SQL-client for tarantool'
COMMAND ${POD2MAN} -c 'Lua application server and NoSQL database'
${CMAKE_SOURCE_DIR}/doc/man/tarantool.pod > ${PROJECT_BINARY_DIR}/doc/man/tarantool.1
)

install(FILES ${PROJECT_BINARY_DIR}/doc/man/tarantool_box.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/)
if (ENABLE_CLIENT)
install(FILES ${PROJECT_BINARY_DIR}/doc/man/tarantool.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/)
endif()
install(FILES ${PROJECT_BINARY_DIR}/doc/man/tarantool.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/)
211 changes: 41 additions & 170 deletions doc/man/tarantool.pod
Original file line number Diff line number Diff line change
@@ -1,199 +1,70 @@
=head1 NAME

tarantool - readline-based client for L<tarantool>.
tarantool- a Lua application server and a NoSQL database

=head1 SYNOPSIS

tarantool [OPTIONS] [QUERY]

=head1 Command-line options

=over

=item -h, --host <host name>

Server address.

=item -p, --port <port number>

Server port.

=item -a, --admin-port <port number>

Server admin port.

=item -C, --cat <file name>

Print xlog or snapshot file content.

=item -P, --play <file name>

Replay xlog file to the specified server.

=item -S, --space <space number>

Filter by space number.

=item -F, --from <log serial number>

Start xlog file from the specified lsn.

=item -T, --to <log serial number>

Stop on specified xlog lsn.

=item -M, --format <name>

Cat output format (tarantool, raw).

=item -H, --header

Add file header for the raw output.

=item -R, --rpl <log serial number>

Act as replica for the specified server.

=item -B, --bin

Print STR in lua printer instead of NUM32 and NUM64,
except arithmetic update arguments.

=item -D, --delim <delim>

If you use --cat, then it will add delim to end of
every line of your Lua file. when used at CLI start
of client, then it's replacement of setopt
delim='<delim>' command.

=item -?, --help

Display this help and exit.

=item -V, --version

Display version information and exit.

=back
tarantool [OPTIONS]

=head1 DESCRIPTION

Statements in alphabetical order

Although an initial statement may be entered on the tarantool command line, generally they are entered following the prompt in interactive mode while tarantool is running. (A prompt will be the name of the host and a greater-than sign, for example localhost>). The end-of-statement marker is a newline (line feed).
Tarantool is a Lua application server and a NoSQL database.

=over

=item CALL

Syntax: CALL procedure-identifier (). Effect: The client tells the server to execute the procedure identified by procedure-identifier. Example: CALL proc50(). Notes: The client sends to the server's read/write data port.

=item DELETE

Syntax: DELETE FROM tuple-set-name WHERE field-name = literal. Effect: Client tells server to delete the tuple identified by the WHERE clause. Example: DELETE FROM t0 WHERE k0='a'. Notes: field-name must identify the primary key. The client sends to the server's read/write data port after converting from SQL to binary protocol.

=item EXIT

Syntax: E[XIT]. Effect: The tarantool program stops. Example: EXIT. Notes: The QUIT statement does the same thing. The client sends nothing to the server.

=item HELP

Syntax: H[ELP]. Effect: Client displays a message including a list of possible statements. Example: HELP. Notes: The client sends nothing to the server.

=item INSERT

Syntax: INSERT [INTO] tuple-set-identifier VALUES (literal [,literal...]). Effect: The client tells the server to add the tuple consisting of the literal values. Example: INSERT INTO t0 VALUES ('a',0). Notes: The client sends to the server's read/write data port after converting from SQL to binary protocol.

=item LOADFILE

Syntax: LOADFILE string-literal. Effect: The client loads instructions from the file identified by string-literal. Example: LOADFILE '/home/tarantool_user/file5.txt'.

=item LUA

Syntax: LUA token [token...]. Effect: The client tells the server to execute the tokens as Lua statements. Example: LUA "hello".." world". Notes: The client sends to the server's administrative port.

=item PING

Syntax: PING. Effect: The client sends a ping to the server. Example: PING. Notes: The client sends to the server's read/write data port.

=item QUIT
Its key properties include:

Syntax: Q[UIT]. Effect: The client stops. This statement is handled entirely by the client. Example: QUIT. Notes: The EXIT statement does the same thing. The client sends nothing to the server.

=item RELOAD

Syntax: RELOAD CONFIGURATION. Effect: The client tells the server to re-read the configuration file. Example: RELOAD CONFIGURATION. Notes: The client sends to the server's administrative port.

=item REPLACE

Syntax; REPLACE [INTO] tuple-set-identifier VALUES (literal [,literal...]). Effect: The client tells the server to add the tuple consisting of the literal values. Example: REPLACE INTO t0 VALUES ('a',0). Notes: REPLACE and INSERT are the same, except that INSERT will return an error if a tuple already exists with the same primary key. The client sends to the server's read/write data port after converting from SQL to binary protocol.

=item SAVE

Syntax: SAVE COREDUMP | SNAPSHOT. Effect: The client tells the server to save the designated object. Example: SAVE SNAPSHOT. Notes: The client sends to the server's administrative port.

=item SELECT

Syntax: SELECT * FROM tuple-set-identifier WHERE field-identifier = literal [AND|OR field-identifier = literal...] [LIMIT numeric-literal [,numeric-literal]]. Effect: Client tells server to find the tuple or tuples identified in the WHERE clause. Example: SELECT * FROM t0 WHERE k0 = 5 AND k1 = 7 LIMIT 1. Notes: The client sends to the server's read/write data port.

=item SET

Syntax: SET INJECTION name-token state-token. Effect: In normal mode: error. Notes: This statement is only available in debug mode.

=item SETOPT

Syntax: SETOPT DELIMITER = string-literal. The string must be a value in single quotes. Effect: string becomes end-of-statement delimiter, so newline alone is not treated as end of statement. Example: SETOPT DELIMITER = '!'. Notes: The client sends nothing to the server.

Syntax: SETOPT PAGER = string-literal. The string must be a value in single quotes. Effect: string becomes the pager that will be invoked for subsequent commands; usually the values are '/usr/bin/less' or '/bin/more' for the common Linux pagers. Example: SETOPT PAGER = '/usr/bin/less'. Notes: The client sends nothing to the server.
=over

=item SHOW
=item *

Licence: simplified BSD

Syntax: SHOW CONFIGURATION | FIBER | INFO | INJECTIONS | PALLOC | PLUGINS | SLAB | STAT. Effect: The client asks the server for information about environment or statistics. Example: SHOW INFO. Notes: The client sends to the server's administrative port. SHOW INJECTIONS is only available in debug mode.
=item *

All data is maintained in RAM

=item UPDATE
=item *

Data persistence is implemented using Write Ahead Log and snapshotting

Syntax: UPDATE tuple-set-identifier SET field-identifier = literal [,field-identifier = literal...] WHERE field-identifier = literal. Effect: Client tells server to change the tuple identified in the WHERE clause. Example: UPDATE t1 SET k1= 'K', k2 = 7 WHERE k0 = 0. Notes: The client sends to the server's read/write data port after converting from SQL to binary protocol.
=item *

Supports asynchronous replication and hot standby

For a condensed Backus-Naur Form [BNF] description of some of the statements, see doc/box-protocol.txt and doc/sql.txt.
=item *

Uses coroutines and asynchronous I/O to implement
high-performance lock-free access to data

=item *

Available on Linux, FreeBSD, Mac OS X

=item *

Stored procedures in Lua are supported.

=back

=head1 EXAMPLES
=head2 Data model

The basic atom of storage in Tarantool is called tuple. A tuple
can have arbitrary number of fields. The first field or fields
in the tuple
are always the identifying unique key. Tuples form spaces. It is
possible to search tuples in spaces using the primary or secondary
keys. It is possible to change, as well as add or remove fields.

Depending how one combines the tarantool client's options, there are in effect three modes of operation: "interactive", "print and play", or "replication" mode.
=head1 Command-line options

In interactive mode, one types statements and gets results. One can specify a statement file when starting (tarantool < file_name) or one can specify a statement file with the LOADFILE statement: (LOADFILE file_name), but typically the statements are typed in by the user following prompts. Here is an example of an interactive-mode tarantool client session:
=over

$ tarantool
localhost> INSERT INTO t0 VALUES ('X-1',100)
Insert OK, 1 rows affected
localhost> INSERT INTO t0 VALUES ('X-2',200,'On Order')
Insert OK, 1 rows affected
localhost> INSERT INTO t0 VALUES ('X-3',300,'')
Insert OK, 1 rows affected
localhost> UPDATE t0 SET k1 = 300 WHERE k0 = 'X-1'
Update OK, 1 rows affected
localhost> DELETE FROM t0 WHERE k0 = 'X-2'
Delete OK, 1 rows affected
localhost> SELECT * FROM t0 WHERE k0 = 'X-1'
Select OK, 1 rows affected
['X-1', 300]
localhost> EXIT
$
=item -h, --help

In print and play mode, one uses --cat and --play and --from and --to and --space options to print write-ahead-log contents, or to send write-ahead-log contents to the server. Here is an example of a print-and-play-mode tarantool client session:
Displays helpscreen and exits.

$ tarantool --cat /home/user1/tarantool_test/work_dir/00000000000000000005.xlog --from 22 --to 26
Insert, lsn: 22, time: 1385327353.345869, len: 33, space: 0, cookie: 127.0.0.1:44787 ['X-1', 100]
Insert, lsn: 23, time: 1385327353.346745, len: 42, space: 0, cookie: 127.0.0.1:44787 ['X-2', 200, 8243105135088135759]
Insert, lsn: 24, time: 1385327353.347352, len: 34, space: 0, cookie: 127.0.0.1:44787 ['X-3', 300, '']
Update, lsn: 25, time: 1385327353.348209, len: 42, space: 0, cookie: 127.0.0.1:44787 ['X-1']
Delete, lsn: 26, time: 1385327353.348879, len: 28, space: 0, cookie: 127.0.0.1:44787 ['X-2']
$
=item -V, --version

In replication mode, one connects as a replica, and then writes a binary log to a file.
Prints program version and exits.

=back

Loading

0 comments on commit 3001eb1

Please sign in to comment.