diff --git a/.travis.yml b/.travis.yml
index d781ca28b2..d6fa54f276 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
language: c
-before_script: "bash -c 'cd UnitTests/HttpInterface && gem install bundler && bundle'"
-script: "make setup && ./configure --enable-relative --enable-all-in-one-libev --enable-all-in-one-v8 --enable-all-in-one-icu && make -j2 && make unittests-shell-server unittests-shell-server-ahuacatl unittests-http-server SKIP_RANGES=1 && echo 'done'"
+before_script: "bash -c Installation/travisCI/before_script.sh"
+script: "bash -c Installation/travisCI/script.sh"
branches:
only:
- master
diff --git a/CHANGELOG b/CHANGELOG
index 864bf04f68..b309f4fda1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,10 @@
v1.5.0 (XXXX-XX-XX)
-------------------
+* added AQL SLICE function to extract slices from lists
+
+* removed check-server binary
+
* made module loader more node compatible
* the startup option `--javascript.package-path` for arangosh is now deprecated and does
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ea202bb6d..5c2fa64dfa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,7 +37,6 @@ set(BIN_ARANGOIMP arangoimp)
set(BIN_ARANGOIRB arangoirb)
set(BIN_ARANGORESTORE arangorestore)
set(BIN_ARANGOSH arangosh)
-set(BIN_CHECK_SERVER check-server)
set(SCRIPT_ARANGO_DFDB arango-dfdb)
set(SCRIPT_FOXX_MANAGER foxx-manager)
diff --git a/Documentation/UserManual/Aql.md b/Documentation/UserManual/Aql.md
index a0eb4994ec..ef7afdb25b 100644
--- a/Documentation/UserManual/Aql.md
+++ b/Documentation/UserManual/Aql.md
@@ -1113,6 +1113,35 @@ AQL supports the following functions to operate on list values:
position only `true` or `false` are returned, depending on whether the sought element
is contained in the list.
+- @FN{SLICE(@FA{list}, @FA{start}, @FA{length})}: extracts a slice of the list specified
+ by @FA{list}. The extraction will start at list element with position @FA{start}.
+ Positions start at 0. Up to @FA{length} elements will be extracted. If @FA{length} is
+ not specified, all list elements starting at @FA{start} will be returned.
+ If @FA{start} is negative, it can be used to indicate positions from the end of the
+ list.
+
+ Examples:
+
+ SLICE([ 1, 2, 3, 4, 5 ], 0, 1)
+
+ will return `[ 1 ]`
+
+ SLICE([ 1, 2, 3, 4, 5 ], 1, 2)
+
+ will return `[ 2, 3 ]`
+
+ SLICE([ 1, 2, 3, 4, 5 ], 3)
+
+ will return `[ 4, 5 ]`
+
+ SLICE([ 1, 2, 3, 4, 5 ], 1, -1)
+
+ will return `[ 2, 3, 4 ]`
+
+ SLICE([ 1, 2, 3, 4, 5 ], 0, -2)
+
+ will return `[ 1, 2, 3 ]`
+
- @FN{UNIQUE(@FA{list})}: returns all unique elements in @FA{list}. To determine
uniqueness, the function will use the comparison order defined in @ref AqlTypeOrder.
Calling this function might return the unique elements in any order.
@@ -1125,25 +1154,28 @@ AQL supports the following functions to operate on list values:
@LIT{UNION_DISTINCT} function or apply the @LIT{UNIQUE} on the result of @LIT{union}.
Example:
- RETURN UNION(
- [ 1, 2, 3 ],
- [ 1, 2 ]
- )
-
- will produce:
- [ [ 1, 2, 3, 1, 2 ] ]
-
- with duplicate removal:
-
- RETURN UNIQUE(
- UNION(
+
+ RETURN UNION(
[ 1, 2, 3 ],
[ 1, 2 ]
)
- )
+
+ will produce:
+
+ [ [ 1, 2, 3, 1, 2 ] ]
+
+ with duplicate removal:
+
+ RETURN UNIQUE(
+ UNION(
+ [ 1, 2, 3 ],
+ [ 1, 2 ]
+ )
+ )
will produce:
- [ [ 1, 2, 3 ] ]
+
+ [ [ 1, 2, 3 ] ]
- @FN{UNION_DISTINCT(@FA{list1, list2, ...})}: returns the union of distinct values of
all lists specified. The function expects at least two list values as its arguments.
diff --git a/Installation/travisCI/before_script.sh b/Installation/travisCI/before_script.sh
new file mode 100755
index 0000000000..1491d58ca7
--- /dev/null
+++ b/Installation/travisCI/before_script.sh
@@ -0,0 +1,13 @@
+d='UnitTests/HttpInterface'
+
+echo
+echo "$0: switching into ${d}"
+cd "${d}" || exit 1
+
+echo
+echo "$0: installing bundler"
+gem install bundler || exit 1
+
+echo
+echo "$0: executing bundle"
+bundle || exit 1
diff --git a/Installation/travisCI/script.sh b/Installation/travisCI/script.sh
new file mode 100755
index 0000000000..43b4209548
--- /dev/null
+++ b/Installation/travisCI/script.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+echo
+echo '$0: setup make-system'
+
+make setup || exit 1
+
+echo
+echo "$0: configuring ArangoDB"
+
+./configure \
+ --enable-relative \
+ --enable-all-in-one-libev \
+ --enable-all-in-one-v8 \
+ --enable-all-in-one-icu \
+ || exit 1
+
+echo
+echo "$0: compiling ArangoDB"
+
+make -j2 || exit 1
+
+echo
+echo "$0: testing ArangoDB"
+
+make unittests-shell-server unittests-shell-server-ahuacatl unittests-http-server SKIP_RANGES=1 || exit 1
+
+echo
+echo "$0: done"
diff --git a/Makefile.am b/Makefile.am
index d64559b647..2d36071a16 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -198,6 +198,12 @@ endif
sbin_PROGRAMS = \
bin/arangod
+################################################################################
+### @brief helper programs
+################################################################################
+
+noinst_bin =
+
################################################################################
### @brief /sbin scripts
################################################################################
@@ -208,8 +214,7 @@ bin_SCRIPTS =
### @brief uninstalled programs
################################################################################
-noinst_PROGRAMS = \
- bin/check-server
+noinst_PROGRAMS =
################################################################################
### @brief /etc data
diff --git a/arangod/Ahuacatl/ahuacatl-functions.c b/arangod/Ahuacatl/ahuacatl-functions.c
index 0a15878e5e..04bb9cf5ff 100644
--- a/arangod/Ahuacatl/ahuacatl-functions.c
+++ b/arangod/Ahuacatl/ahuacatl-functions.c
@@ -675,6 +675,8 @@ TRI_associative_pointer_t* TRI_CreateFunctionsAql (void) {
REGISTER_FUNCTION("STDDEV_SAMPLE", "STDDEV_SAMPLE", true, true, "l", NULL);
REGISTER_FUNCTION("STDDEV_POPULATION", "STDDEV_POPULATION", true, true, "l", NULL);
REGISTER_FUNCTION("UNIQUE", "UNIQUE", true, false, "l", NULL);
+ REGISTER_FUNCTION("SLICE", "SLICE", true, false, "l,n|n", NULL);
+
// note: REVERSE() can be applied on strings, too
REGISTER_FUNCTION("REVERSE", "REVERSE", true, false, "ls", NULL);
REGISTER_FUNCTION("FIRST", "FIRST", true, false, "l", NULL);
diff --git a/arangosh/CMakeLists.txt b/arangosh/CMakeLists.txt
index 5839760e74..323af2b469 100644
--- a/arangosh/CMakeLists.txt
+++ b/arangosh/CMakeLists.txt
@@ -230,28 +230,6 @@ install(
REGEX "^.*/common/tests$" EXCLUDE
REGEX "^.*/client/tests$" EXCLUDE)
-################################################################################
-### @brief check-server
-################################################################################
-
-add_executable(
- ${BIN_CHECK_SERVER}
- V8Client/V8ClientConnection.cpp
- V8Client/check-server.cpp
-)
-
-target_link_libraries(
- ${BIN_CHECK_SERVER}
- ${LIB_ARANGO_V8}
- ${LIB_ARANGO_CLIENT}
- ${LIB_ARANGO}
- ${V8_LIBS}
- ${ICU_LIBS}
- ${ZLIB_LIBS}
- ${OPENSSL_LIBS}
- ${MSVC_LIBS}
-)
-
## -----------------------------------------------------------------------------
## --SECTION-- END-OF-FILE
## -----------------------------------------------------------------------------
diff --git a/arangosh/Makefile.files b/arangosh/Makefile.files
index c8341d31ae..ba874e8bb3 100644
--- a/arangosh/Makefile.files
+++ b/arangosh/Makefile.files
@@ -103,25 +103,6 @@ bin_arangosh_SOURCES = \
arangosh/V8Client/V8ClientConnection.cpp \
arangosh/V8Client/arangosh.cpp
-################################################################################
-### @brief program "check-server"
-################################################################################
-
-bin_check_server_CPPFLAGS = \
- -I@top_srcdir@/arangosh \
- $(AM_CPPFLAGS)
-
-bin_check_server_LDADD = \
- lib/libarango_v8.a \
- lib/libarango_client.a \
- lib/libarango.a \
- $(LIBS) \
- @V8_LIBS@
-
-bin_check_server_SOURCES = \
- arangosh/V8Client/V8ClientConnection.cpp \
- arangosh/V8Client/check-server.cpp
-
## -----------------------------------------------------------------------------
## --SECTION-- END-OF-FILE
## -----------------------------------------------------------------------------
diff --git a/arangosh/V8Client/check-server.cpp b/arangosh/V8Client/check-server.cpp
deleted file mode 100644
index 2de1243023..0000000000
--- a/arangosh/V8Client/check-server.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-/// @brief checks server is alive and answering requests
-///
-/// @file
-///
-/// DISCLAIMER
-///
-/// Copyright 2004-2013 triAGENS GmbH, Cologne, Germany
-///
-/// Licensed under the Apache License, Version 2.0 (the "License");
-/// you may not use this file except in compliance with the License.
-/// You may obtain a copy of the License at
-///
-/// http://www.apache.org/licenses/LICENSE-2.0
-///
-/// Unless required by applicable law or agreed to in writing, software
-/// distributed under the License is distributed on an "AS IS" BASIS,
-/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and
-/// limitations under the License.
-///
-/// Copyright holder is triAGENS GmbH, Cologne, Germany
-///
-/// @author Dr. Frank Celler
-/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
-////////////////////////////////////////////////////////////////////////////////
-
-#include "BasicsC/common.h"
-
-#include "ArangoShell/ArangoClient.h"
-#include "BasicsC/init.h"
-#include "BasicsC/logging.h"
-#include "Rest/InitialiseRest.h"
-#include "V8Client/V8ClientConnection.h"
-
-using namespace std;
-using namespace triagens::basics;
-using namespace triagens::rest;
-using namespace triagens::httpclient;
-using namespace triagens::v8client;
-using namespace triagens::arango;
-
-// -----------------------------------------------------------------------------
-// --SECTION-- private functions
-// -----------------------------------------------------------------------------
-
-////////////////////////////////////////////////////////////////////////////////
-/// @brief exit function
-////////////////////////////////////////////////////////////////////////////////
-
-#ifdef _WIN32
-
-static void checkserverExitFunction (int exitCode, void* data) {
- int res = 0;
-
- // ...........................................................................
- // TODO: need a terminate function for windows to be called and cleanup
- // any windows specific stuff.
- // ...........................................................................
-
- res = finaliseWindows(TRI_WIN_FINAL_WSASTARTUP_FUNCTION_CALL, 0);
-
- if (res != 0) {
- exit(1);
- }
-
- exit(exitCode);
-}
-
-#else
-
-static void checkserverExitFunction (int exitCode, void* data) {
-}
-
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-/// @brief startup function
-////////////////////////////////////////////////////////////////////////////////
-
-#ifdef _WIN32
-
-static void checkserverEntryFunction () {
- int maxOpenFiles = 1024;
- int res = 0;
-
- // ...........................................................................
- // Uncomment this to call this for extended debug information.
- // If you familiar with valgrind ... then this is not like that, however
- // you do get some similar functionality.
- // ...........................................................................
- //res = initialiseWindows(TRI_WIN_INITIAL_SET_DEBUG_FLAG, 0);
-
- res = initialiseWindows(TRI_WIN_INITIAL_SET_INVALID_HANLE_HANDLER, 0);
-
- if (res != 0) {
- _exit(1);
- }
-
- res = initialiseWindows(TRI_WIN_INITIAL_SET_MAX_STD_IO,(const char*)(&maxOpenFiles));
-
- if (res != 0) {
- _exit(1);
- }
-
- res = initialiseWindows(TRI_WIN_INITIAL_WSASTARTUP_FUNCTION_CALL, 0);
-
- if (res != 0) {
- _exit(1);
- }
-
- TRI_Application_Exit_SetExit(checkserverExitFunction);
-}
-
-#else
-
-static void checkserverEntryFunction () {
-}
-
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-/// @brief return a new client connection instance
-////////////////////////////////////////////////////////////////////////////////
-
-static V8ClientConnection* CreateConnection (Endpoint* endpoint) {
- return new V8ClientConnection(endpoint,
- "_system", // database
- "", // user
- "", //
- 300, // request timeout
- 3, // connection timeout
- 3, // retries
- false,
- 0);
-}
-
-// -----------------------------------------------------------------------------
-// --SECTION-- public functions
-// -----------------------------------------------------------------------------
-
-////////////////////////////////////////////////////////////////////////////////
-/// @brief main
-////////////////////////////////////////////////////////////////////////////////
-
-int main (int argc, char* argv[]) {
- int ret = EXIT_SUCCESS;
-
- checkserverEntryFunction();
-
- TRIAGENS_C_INITIALISE(argc, argv);
- TRIAGENS_REST_INITIALISE(argc, argv);
-
- TRI_InitialiseLogging(false);
-
- if (4 < argc || argc < 2) {
- cerr << "usage: " << argv[0] << "
+ <%if (attributes.development) {%>
+
+
<%= appInfos[1] %><%= attributes.isSystem ? " (system)" : "" %><%= appInfos[0] === "dev" ? " (dev)" : ""%>
+
Mount: <%=attributes.mount %>
Version: <%=appInfos[2] %>
Prefix: <%=attributes.options && attributes.options.collectionPrefix%>
-
-