mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 01:42:37 +08:00
merged in 5.1
This commit is contained in:
commit
9060e6d82b
@ -1,4 +1,22 @@
|
||||
// Apple Proprietary and Confidential Information
|
||||
/*
|
||||
* FDBLibTLSPlugin.cpp
|
||||
*
|
||||
* This source file is part of the FoundationDB open source project
|
||||
*
|
||||
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "boost/config.hpp"
|
||||
|
||||
|
@ -1,4 +1,22 @@
|
||||
// Apple Proprietary and Confidential Information
|
||||
/*
|
||||
* FDBLibTLSPlugin.h
|
||||
*
|
||||
* This source file is part of the FoundationDB open source project
|
||||
*
|
||||
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef FDB_LIBTLS_PLUGIN_H
|
||||
#define FDB_LIBTLS_PLUGIN_H
|
||||
|
@ -1,4 +1,22 @@
|
||||
// Apple Proprietary and Confidential Information
|
||||
/*
|
||||
* FDBLibTLSPolicy.cpp
|
||||
*
|
||||
* This source file is part of the FoundationDB open source project
|
||||
*
|
||||
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "FDBLibTLSPolicy.h"
|
||||
#include "FDBLibTLSSession.h"
|
||||
|
@ -1,4 +1,22 @@
|
||||
// Apple Proprietary and Confidential Information
|
||||
/*
|
||||
* FDBLibTLSPolicy.h
|
||||
*
|
||||
* This source file is part of the FoundationDB open source project
|
||||
*
|
||||
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef FDB_LIBTLS_POLICY_H
|
||||
#define FDB_LIBTLS_POLICY_H
|
||||
|
@ -1,4 +1,22 @@
|
||||
// Apple Proprietary and Confidential Information
|
||||
/*
|
||||
* FDBLibTLSSession.cpp
|
||||
*
|
||||
* This source file is part of the FoundationDB open source project
|
||||
*
|
||||
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "FDBLibTLSSession.h"
|
||||
|
||||
|
@ -1,4 +1,22 @@
|
||||
// Apple Proprietary and Confidential Information
|
||||
/*
|
||||
* FDBLibTLSSession.h
|
||||
*
|
||||
* This source file is part of the FoundationDB open source project
|
||||
*
|
||||
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef FDB_LIBTLS_SESSION_H
|
||||
#define FDB_LIBTLS_SESSION_H
|
||||
|
@ -1,4 +1,22 @@
|
||||
// Apple Proprietary and Confidential Information
|
||||
/*
|
||||
* ITLSPlugin.h
|
||||
*
|
||||
* This source file is part of the FoundationDB open source project
|
||||
*
|
||||
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef FDB_ITLSPLUGIN_H
|
||||
#define FDB_ITLSPLUGIN_H
|
||||
|
@ -1,4 +1,22 @@
|
||||
// Apple Proprietary and Confidential Information
|
||||
/*
|
||||
* ReferenceCounted.h
|
||||
*
|
||||
* This source file is part of the FoundationDB open source project
|
||||
*
|
||||
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef FDB_REFERENCE_COUNTED_H
|
||||
#define FDB_REFERENCE_COUNTED_H
|
||||
|
@ -1,3 +1,23 @@
|
||||
/*
|
||||
* plugin-test.cpp
|
||||
*
|
||||
* This source file is part of the FoundationDB open source project
|
||||
*
|
||||
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <exception>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
@ -1,4 +1,23 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# make-tests-certs.sh
|
||||
#
|
||||
# This source file is part of the FoundationDB open source project
|
||||
#
|
||||
# Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
@ -1,3 +1,23 @@
|
||||
/*
|
||||
* verify-test.cpp
|
||||
*
|
||||
* This source file is part of the FoundationDB open source project
|
||||
*
|
||||
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -5,9 +5,9 @@ Your API test program must implement a simple stack machine that exercises the
|
||||
FoundationDB API. The program is invoked with two or three arguments. The first
|
||||
argument is a prefix that is the first element of a tuple, the second is the
|
||||
API version, and the third argument is the path to a cluster file. If the
|
||||
third argument is not specified, your program may assume that fdb.open() will
|
||||
succeed with no arguments (an fdb.cluster file will exist in the current
|
||||
directory). Otherwise, your program should connect to the cluster specified
|
||||
third argument is not specified, your program may assume that `fdb.open()` will
|
||||
succeed with no arguments (an fdb.cluster file will exist in the current
|
||||
directory). Otherwise, your program should connect to the cluster specified
|
||||
by the given cluster file.
|
||||
|
||||
Your stack machine should begin reading the range returned by the tuple range
|
||||
@ -38,7 +38,7 @@ instructions:
|
||||
and a peek operation. The stack is initialized to be empty.
|
||||
|
||||
- A current FDB transaction name (stored as a byte string). The transaction
|
||||
name should be initialized to the prefix that instructions are being read
|
||||
name should be initialized to the prefix that instructions are being read
|
||||
from.
|
||||
|
||||
- A last seen FDB version, which is a 64-bit integer.
|
||||
@ -47,44 +47,44 @@ instructions:
|
||||
Data Operations
|
||||
---------------
|
||||
|
||||
PUSH <item>
|
||||
#### PUSH <item>
|
||||
|
||||
Pushes the provided item onto the stack.
|
||||
|
||||
DUP
|
||||
#### DUP
|
||||
|
||||
Duplicates the top item on the stack. The instruction number for the
|
||||
duplicate item should be the same as the original.
|
||||
|
||||
EMPTY_STACK
|
||||
#### EMPTY_STACK
|
||||
|
||||
Discards all items in the stack.
|
||||
|
||||
SWAP
|
||||
#### SWAP
|
||||
|
||||
Pops the top item off of the stack as INDEX. Swaps the items in the stack at
|
||||
depth 0 and depth INDEX. Does not modify the instruction numbers of the
|
||||
swapped items.
|
||||
|
||||
POP
|
||||
#### POP
|
||||
|
||||
Pops and discards the top item on the stack.
|
||||
|
||||
SUB
|
||||
#### SUB
|
||||
|
||||
Pops the top two items off of the stack as A and B and then pushes the
|
||||
difference (A-B) onto the stack. A and B may be assumed to be integers.
|
||||
|
||||
CONCAT
|
||||
#### CONCAT
|
||||
|
||||
Pops the top two items off the stack as A and B and then pushes the
|
||||
Pops the top two items off the stack as A and B and then pushes the
|
||||
concatenation of A and B onto the stack. A and B can be assumed to
|
||||
be of the same type and will be either byte strings or unicode strings.
|
||||
|
||||
LOG_STACK
|
||||
#### LOG_STACK
|
||||
|
||||
Pops the top item off the stack as PREFIX. Using a new transaction with normal
|
||||
retry logic, inserts a key-value pair into the database for each item in the
|
||||
retry logic, inserts a key-value pair into the database for each item in the
|
||||
stack of the form:
|
||||
|
||||
PREFIX + tuple.pack((stackIndex, instructionNumber)) = tuple.pack((item,))
|
||||
@ -96,8 +96,8 @@ LOG_STACK
|
||||
then the value should be truncated to the first 40000 bytes of the packed
|
||||
tuple.
|
||||
|
||||
When finished, the stack should be empty. Note that because the stack may be
|
||||
large, it may be necessary to commit the transaction every so often (e.g.
|
||||
When finished, the stack should be empty. Note that because the stack may be
|
||||
large, it may be necessary to commit the transaction every so often (e.g.
|
||||
after every 100 sets) to avoid past_version errors.
|
||||
|
||||
FoundationDB Operations
|
||||
@ -117,7 +117,7 @@ should simulate it using an anonymous transaction. Remember that set and clear
|
||||
operations must immediately commit (with appropriate retry behavior!).
|
||||
|
||||
Any error that bubbles out of these operations must be caught. In the event of
|
||||
an error, you must push the packed tuple of the string "ERROR" and the error
|
||||
an error, you must push the packed tuple of the string `"ERROR"` and the error
|
||||
code (as a string, not an integer).
|
||||
|
||||
Some operations may allow you to push future values onto the stack. When popping
|
||||
@ -132,25 +132,25 @@ futures must apply the following rules to the result:
|
||||
|
||||
- If the result is void (i.e. the future was just a signal of
|
||||
completion), then its value should be the byte string
|
||||
"RESULT_NOT_PRESENT"
|
||||
`"RESULT_NOT_PRESENT"`
|
||||
|
||||
- If the result is from a GET operation in which no result was
|
||||
returned, then its value is to be converted to the byte string
|
||||
"RESULT_NOT_PRESENT"
|
||||
`"RESULT_NOT_PRESENT"`
|
||||
|
||||
NEW_TRANSACTION
|
||||
#### NEW_TRANSACTION
|
||||
|
||||
Creates a new transaction and stores it in the global transaction map
|
||||
under the currently used transaction name.
|
||||
|
||||
USE_TRANSACTION
|
||||
#### USE_TRANSACTION
|
||||
|
||||
Pop the top item off of the stack as TRANSACTION_NAME. Begin using the
|
||||
transaction stored at TRANSACTION_NAME in the transaction map for future
|
||||
operations. If no entry exists in the map for the given name, a new
|
||||
transaction should be inserted.
|
||||
|
||||
ON_ERROR
|
||||
#### ON_ERROR
|
||||
|
||||
Pops the top item off of the stack as ERROR_CODE. Passes ERROR_CODE in a
|
||||
language-appropriate way to the on_error method of current transaction
|
||||
@ -158,22 +158,22 @@ ON_ERROR
|
||||
the error out as indicated above. May optionally push a future onto the
|
||||
stack.
|
||||
|
||||
GET (_SNAPSHOT, _DATABASE)
|
||||
#### GET (_SNAPSHOT, _DATABASE)
|
||||
|
||||
Pops the top item off of the stack as KEY and then looks up KEY in the
|
||||
database using the get() method. May optionally push a future onto the
|
||||
stack.
|
||||
|
||||
GET_KEY (_SNAPSHOT, _DATABASE)
|
||||
#### GET_KEY (_SNAPSHOT, _DATABASE)
|
||||
|
||||
Pops the top four items off of the stack as KEY, OR_EQUAL, OFFSET, PREFIX
|
||||
and then constructs a key selector. This key selector is then resolved
|
||||
using the get_key() method to yield RESULT. If RESULT starts with PREFIX,
|
||||
then RESULT is pushed onto the stack. Otherwise, if RESULT < PREFIX, PREFIX
|
||||
and then constructs a key selector. This key selector is then resolved
|
||||
using the get_key() method to yield RESULT. If RESULT starts with PREFIX,
|
||||
then RESULT is pushed onto the stack. Otherwise, if RESULT < PREFIX, PREFIX
|
||||
is pushed onto the stack. If RESULT > PREFIX, then strinc(PREFIX) is pushed
|
||||
onto the stack. May optionally push a future onto the stack.
|
||||
|
||||
GET_RANGE (_SNAPSHOT, _DATABASE)
|
||||
#### GET_RANGE (_SNAPSHOT, _DATABASE)
|
||||
|
||||
Pops the top five items off of the stack as BEGIN_KEY, END_KEY, LIMIT,
|
||||
REVERSE and STREAMING_MODE. Performs a range read in a language-appropriate
|
||||
@ -181,103 +181,103 @@ GET_RANGE (_SNAPSHOT, _DATABASE)
|
||||
packed into a tuple as [k1,v1,k2,v2,...,kn,vn], and this single packed value
|
||||
is pushed onto the stack.
|
||||
|
||||
GET_RANGE_STARTS_WITH (_SNAPSHOT, _DATABASE)
|
||||
#### GET_RANGE_STARTS_WITH (_SNAPSHOT, _DATABASE)
|
||||
|
||||
Pops the top four items off of the stack as PREFIX, LIMIT, REVERSE and
|
||||
STREAMING_MODE. Performs a prefix range read in a language-appropriate way
|
||||
using these parameters. Output is pushed onto the stack as with GET_RANGE.
|
||||
|
||||
GET_RANGE_SELECTOR (_SNAPSHOT, _DATABASE)
|
||||
#### GET_RANGE_SELECTOR (_SNAPSHOT, _DATABASE)
|
||||
|
||||
Pops the top ten items off of the stack as BEGIN_KEY, BEGIN_OR_EQUAL,
|
||||
BEGIN_OFFSET, END_KEY, END_OR_EQUAL, END_OFFSET, LIMIT, REVERSE,
|
||||
STREAMING_MODE, and PREFIX. Constructs key selectors BEGIN and END from
|
||||
STREAMING_MODE, and PREFIX. Constructs key selectors BEGIN and END from
|
||||
the first six parameters, and then performs a range read in a language-
|
||||
appropriate way using BEGIN, END, LIMIT, REVERSE and STREAMING_MODE. Output
|
||||
is pushed onto the stack as with GET_RANGE, excluding any keys that do not
|
||||
appropriate way using BEGIN, END, LIMIT, REVERSE and STREAMING_MODE. Output
|
||||
is pushed onto the stack as with GET_RANGE, excluding any keys that do not
|
||||
begin with PREFIX.
|
||||
|
||||
GET_READ_VERSION (_SNAPSHOT)
|
||||
#### GET_READ_VERSION (_SNAPSHOT)
|
||||
|
||||
Gets the current read version and stores it in the internal stack machine
|
||||
state as the last seen version. Pushed the string "GOT_READ_VERSION" onto
|
||||
the stack.
|
||||
|
||||
GET_VERSIONSTAMP
|
||||
#### GET_VERSIONSTAMP
|
||||
|
||||
Calls get_versionstamp and pushes the resulting future onto the stack.
|
||||
|
||||
SET (_DATABASE)
|
||||
#### SET (_DATABASE)
|
||||
|
||||
Pops the top two items off of the stack as KEY and VALUE. Sets KEY to have
|
||||
the value VALUE. A SET_DATABASE call may optionally push a future onto the
|
||||
stack.
|
||||
|
||||
SET_READ_VERSION
|
||||
#### SET_READ_VERSION
|
||||
|
||||
Sets the current transaction read version to the internal state machine last
|
||||
seen version.
|
||||
|
||||
CLEAR (_DATABASE)
|
||||
#### CLEAR (_DATABASE)
|
||||
|
||||
Pops the top item off of the stack as KEY and then clears KEY from the
|
||||
database. A CLEAR_DATABASE call may optionally push a future onto the stack.
|
||||
|
||||
CLEAR_RANGE (_DATABASE)
|
||||
#### CLEAR_RANGE (_DATABASE)
|
||||
|
||||
Pops the top two items off of the stack as BEGIN_KEY and END_KEY. Clears the
|
||||
range of keys from BEGIN_KEY to END_KEY in the database. A
|
||||
CLEAR_RANGE_DATABASE call may optionally push a future onto the stack.
|
||||
|
||||
CLEAR_RANGE_STARTS_WITH (_DATABASE)
|
||||
#### CLEAR_RANGE_STARTS_WITH (_DATABASE)
|
||||
|
||||
Pops the top item off of the stack as PREFIX and then clears all keys from
|
||||
the database that begin with PREFIX. A CLEAR_RANGE_STARTS_WITH_DATABASE call
|
||||
may optionally push a future onto the stack.
|
||||
|
||||
ATOMIC_OP (_DATABASE)
|
||||
#### ATOMIC_OP (_DATABASE)
|
||||
|
||||
Pops the top three items off of the stack as OPTYPE, KEY, and VALUE.
|
||||
Performs the atomic operation described by OPTYPE upon KEY with VALUE. An
|
||||
ATOMIC_OP_DATABASE call may optionally push a future onto the stack.
|
||||
|
||||
READ_CONFLICT_RANGE and WRITE_CONFLICT_RANGE
|
||||
#### READ_CONFLICT_RANGE and WRITE_CONFLICT_RANGE
|
||||
|
||||
Pops the top two items off of the stack as BEGIN_KEY and END_KEY. Adds a
|
||||
read conflict range or write conflict range from BEGIN_KEY to END_KEY.
|
||||
Pushes the byte string "SET_CONFLICT_RANGE" onto the stack.
|
||||
|
||||
READ_CONFLICT_KEY and WRITE_CONFLICT_KEY
|
||||
#### READ_CONFLICT_KEY and WRITE_CONFLICT_KEY
|
||||
|
||||
Pops the top item off of the stack as KEY. Adds KEY as a read conflict key
|
||||
or write conflict key. Pushes the byte string "SET_CONFLICT_KEY" onto the
|
||||
stack.
|
||||
|
||||
DISABLE_WRITE_CONFLICT
|
||||
#### DISABLE_WRITE_CONFLICT
|
||||
|
||||
Sets the NEXT_WRITE_NO_WRITE_CONFLICT_RANGE transaction option on the
|
||||
current transaction. Does not modify the stack.
|
||||
|
||||
COMMIT
|
||||
#### COMMIT
|
||||
|
||||
Commits the current transaction (with no retry behavior). May optionally
|
||||
push a future onto the stack.
|
||||
|
||||
RESET
|
||||
#### RESET
|
||||
|
||||
Resets the current transaction.
|
||||
|
||||
CANCEL
|
||||
#### CANCEL
|
||||
|
||||
Cancels the current transaction.
|
||||
|
||||
GET_COMMITTED_VERSION
|
||||
#### GET_COMMITTED_VERSION
|
||||
|
||||
Gets the committed version from the current transaction and stores it in the
|
||||
internal stack machine state as the last seen version. Pushes the byte
|
||||
string "GOT_COMMITTED_VERSION" onto the stack.
|
||||
|
||||
WAIT_FUTURE
|
||||
#### WAIT_FUTURE
|
||||
|
||||
Pops the top item off the stack and pushes it back on. If the top item on
|
||||
the stack is a future, this will have the side effect of waiting on the
|
||||
@ -287,13 +287,13 @@ WAIT_FUTURE
|
||||
Tuple Operations
|
||||
----------------
|
||||
|
||||
TUPLE_PACK
|
||||
#### TUPLE_PACK
|
||||
|
||||
Pops the top item off of the stack as N. Pops the next N items off of the
|
||||
stack and packs them as the tuple [item0,item1,...,itemN], and then pushes
|
||||
this single packed value onto the stack.
|
||||
|
||||
TUPLE_PACK_WITH_VERSIONSTAMP
|
||||
#### TUPLE_PACK_WITH_VERSIONSTAMP
|
||||
|
||||
Pops the top item off of the stack as a byte string prefix. Pops the next item
|
||||
off of the stack as N. Pops the next N items off of the stack and packs them
|
||||
@ -307,20 +307,20 @@ TUPLE_PACK_WITH_VERSIONSTAMP
|
||||
do not contain a 'Versionstamp' tuple-type do not have to implement this
|
||||
operation.)
|
||||
|
||||
TUPLE_UNPACK
|
||||
#### TUPLE_UNPACK
|
||||
|
||||
Pops the top item off of the stack as PACKED, and then unpacks PACKED into a
|
||||
tuple. For each element of the tuple, packs it as a new tuple and pushes it
|
||||
onto the stack.
|
||||
|
||||
TUPLE_RANGE
|
||||
#### TUPLE_RANGE
|
||||
|
||||
Pops the top item off of the stack as N. Pops the next N items off of the
|
||||
stack, and passes these items as a tuple (or array, or language-appropriate
|
||||
structure) to the tuple range method. Pushes the begin and end elements of
|
||||
the returned range onto the stack.
|
||||
|
||||
TUPLE_SORT
|
||||
#### TUPLE_SORT
|
||||
|
||||
Pops the top item off of the stack as N. Pops the next N items off of the
|
||||
stack as packed tuples (i.e., byte strings), unpacks them, sorts the tuples,
|
||||
@ -330,25 +330,25 @@ TUPLE_SORT
|
||||
use that to sort. Otherwise, it should sort them lexicographically by
|
||||
their byte representation. The choice of function should not affect final sort order.
|
||||
|
||||
ENCODE_FLOAT
|
||||
#### ENCODE_FLOAT
|
||||
|
||||
Pops the top item off of the stack. This will be a byte-string of length 4
|
||||
containing the IEEE 754 encoding of a float in big-endian order.
|
||||
This is then converted into a float and pushed onto the stack.
|
||||
|
||||
ENCODE_DOUBLE
|
||||
#### ENCODE_DOUBLE
|
||||
|
||||
Pops the top item off of the stack. This will be a byte-string of length 8
|
||||
containing the IEEE 754 encoding of a double in big-endian order.
|
||||
This is then converted into a double and pushed onto the stack.
|
||||
|
||||
DECODE_FLOAT
|
||||
#### DECODE_FLOAT
|
||||
|
||||
Pops the top item off of the stack. This will be a single-precision float.
|
||||
This is converted into a (4 byte) byte-string of its IEEE 754 representation
|
||||
in big-endian order, and pushed onto the stack.
|
||||
|
||||
DECODE_DOUBLE
|
||||
#### DECODE_DOUBLE
|
||||
|
||||
Pops the top item off of the stack. This will be a double-precision float.
|
||||
This is converted into a (8 byte) byte-string its IEEE 754 representation
|
||||
@ -358,7 +358,7 @@ DECODE_DOUBLE
|
||||
Thread Operations
|
||||
-----------------
|
||||
|
||||
START_THREAD
|
||||
#### START_THREAD
|
||||
|
||||
Pops the top item off of the stack as PREFIX. Creates a new stack machine
|
||||
instance operating on the same database as the current stack machine, but
|
||||
@ -366,7 +366,7 @@ START_THREAD
|
||||
state. The new stack machine should begin executing instructions concurrent
|
||||
with the current stack machine through a language-appropriate mechanism.
|
||||
|
||||
WAIT_EMPTY
|
||||
#### WAIT_EMPTY
|
||||
|
||||
Pops the top item off of the stack as PREFIX. Blocks execution until the
|
||||
range with prefix PREFIX is not present in the database. This should be
|
||||
@ -378,7 +378,7 @@ WAIT_EMPTY
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
UNIT_TESTS
|
||||
#### UNIT_TESTS
|
||||
|
||||
This is called during the scripted test to allow bindings to test features
|
||||
which aren't supported by the stack tester. Things currently tested in the
|
@ -8,19 +8,19 @@ directory testing state.
|
||||
Additional State and Initialization
|
||||
-----------------------------------
|
||||
|
||||
Your tester should store three additional pieces of state.
|
||||
Your tester should store three additional pieces of state.
|
||||
|
||||
directory list - The items in this list should be accessible by index. The list
|
||||
should support an append operation. It will be required to store Subspaces,
|
||||
* directory list - The items in this list should be accessible by index. The list
|
||||
should support an append operation. It will be required to store Subspaces,
|
||||
DirectorySubspaces, and DirectoryLayers.
|
||||
|
||||
directory list index - an index into the directory list of the currently active
|
||||
* directory list index - an index into the directory list of the currently active
|
||||
directory.
|
||||
|
||||
error index - the index to use when the directory at directory list index is not
|
||||
* error index - the index to use when the directory at directory list index is not
|
||||
present
|
||||
|
||||
At the beginning of the test, the list should contain just the default directory
|
||||
At the beginning of the test, the list should contain just the default directory
|
||||
layer. The directory index and error index should both be set to 0.
|
||||
|
||||
Popping Tuples
|
||||
@ -29,14 +29,14 @@ Popping Tuples
|
||||
Some instructions will require you to pop N tuples. To do this, repeat the
|
||||
following procedure N times:
|
||||
|
||||
Pop 1 item off the stack as M. Pop M items off the stack as
|
||||
Pop 1 item off the stack as M. Pop M items off the stack as
|
||||
tuple = [item1, ..., itemM].
|
||||
|
||||
Errors
|
||||
------
|
||||
|
||||
In the even that you encounter an error when performing a directory layer
|
||||
operation, you should push the byte string: "DIRECTORY_ERROR" onto the stack. If
|
||||
operation, you should push the byte string: `"DIRECTORY_ERROR"` onto the stack. If
|
||||
the operation being performed was supposed to append an item to the directory
|
||||
list, then a null entry should be appended instead.
|
||||
|
||||
@ -46,65 +46,65 @@ New Instructions
|
||||
Below are the new instructions that must be implemented to test the directory
|
||||
layer. Some instructions specify that the current directory should be used
|
||||
for the operation. In that case, use the object in the directory list specified
|
||||
by the current directory list index. Operations that are not defined for a
|
||||
by the current directory list index. Operations that are not defined for a
|
||||
particular object will not be called (e.g. a DirectoryLayer will never be asked
|
||||
to pack a key).
|
||||
|
||||
Directory/Subspace/Layer Creation
|
||||
---------------------------------
|
||||
|
||||
DIRECTORY_CREATE_SUBSPACE
|
||||
#### DIRECTORY_CREATE_SUBSPACE
|
||||
|
||||
Pop 1 tuple off the stack as [path]. Pop 1 additional item as [raw_prefix].
|
||||
Create a subspace with path as the prefix tuple and the specified
|
||||
Create a subspace with path as the prefix tuple and the specified
|
||||
raw_prefix. Append it to the directory list.
|
||||
|
||||
DIRECTORY_CREATE_LAYER
|
||||
#### DIRECTORY_CREATE_LAYER
|
||||
|
||||
Pop 3 items off the stack as [index1, index2, allow_manual_prefixes]. Let
|
||||
node_subspace be the object in the directory list at index1 and
|
||||
content_subspace be the object in the directory list at index2. Create a new
|
||||
directory layer with the specified node_subspace and content_subspace. If
|
||||
Pop 3 items off the stack as [index1, index2, allow_manual_prefixes]. Let
|
||||
node_subspace be the object in the directory list at index1 and
|
||||
content_subspace be the object in the directory list at index2. Create a new
|
||||
directory layer with the specified node_subspace and content_subspace. If
|
||||
allow_manual_prefixes is 1, then enable manual prefixes on the directory
|
||||
layer. Append the resulting directory layer to the directory list.
|
||||
|
||||
If either of the two specified subspaces are null, then do not create a
|
||||
If either of the two specified subspaces are null, then do not create a
|
||||
directory layer and instead push null onto the directory list.
|
||||
|
||||
DIRECTORY_CREATE_OR_OPEN[_DATABASE]
|
||||
#### DIRECTORY_CREATE_OR_OPEN[_DATABASE]
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 tuple off the stack as [path]. Pop 1 additional item as [layer].
|
||||
create_or_open a directory with the specified path and layer. If layer is
|
||||
Pop 1 tuple off the stack as [path]. Pop 1 additional item as [layer].
|
||||
create_or_open a directory with the specified path and layer. If layer is
|
||||
null, use the default value for that parameter.
|
||||
|
||||
DIRECTORY_CREATE[_DATABASE]
|
||||
#### DIRECTORY_CREATE[_DATABASE]
|
||||
|
||||
Pop 1 tuple off the stack as [path]. Pop 2 additional items as
|
||||
[layer, prefix]. create a directory with the specified path, layer,
|
||||
and prefix. If either of layer or prefix is null, use the default value for
|
||||
Pop 1 tuple off the stack as [path]. Pop 2 additional items as
|
||||
[layer, prefix]. create a directory with the specified path, layer,
|
||||
and prefix. If either of layer or prefix is null, use the default value for
|
||||
that parameter (layer='', prefix=null).
|
||||
|
||||
DIRECTORY_OPEN[_DATABASE|_SNAPSHOT]
|
||||
#### DIRECTORY_OPEN[_DATABASE|_SNAPSHOT]
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 tuple off the stack as [path]. Pop 1 additional item as [layer]. Open
|
||||
a directory with the specified path and layer. If layer is null, use the
|
||||
Pop 1 tuple off the stack as [path]. Pop 1 additional item as [layer]. Open
|
||||
a directory with the specified path and layer. If layer is null, use the
|
||||
default value (layer='').
|
||||
|
||||
Directory Management
|
||||
--------------------
|
||||
|
||||
DIRECTORY_CHANGE
|
||||
#### DIRECTORY_CHANGE
|
||||
|
||||
Pop the top item off the stack as [index]. Set the current directory list
|
||||
index to index. In the event that the directory at this new index is null
|
||||
(as the result of a previous error), set the directory list index to the
|
||||
(as the result of a previous error), set the directory list index to the
|
||||
error index.
|
||||
|
||||
DIRECTORY_SET_ERROR_INDEX
|
||||
#### DIRECTORY_SET_ERROR_INDEX
|
||||
|
||||
Pop the top item off the stack as [error_index]. Set the current error index
|
||||
to error_index.
|
||||
@ -112,130 +112,130 @@ DIRECTORY_SET_ERROR_INDEX
|
||||
Directory Operations
|
||||
--------------------
|
||||
|
||||
DIRECTORY_MOVE[_DATABASE]
|
||||
#### DIRECTORY_MOVE[_DATABASE]
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 2 tuples off the stack as [old_path, new_path]. Call move with the
|
||||
Pop 2 tuples off the stack as [old_path, new_path]. Call move with the
|
||||
specified old_path and new_path. Append the result onto the directory list.
|
||||
|
||||
DIRECTORY_MOVE_TO[_DATABASE]
|
||||
#### DIRECTORY_MOVE_TO[_DATABASE]
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 tuple off the stack as [new_absolute_path]. Call moveTo with the
|
||||
Pop 1 tuple off the stack as [new_absolute_path]. Call moveTo with the
|
||||
specified new_absolute_path. Append the result onto the directory list.
|
||||
|
||||
DIRECTORY_REMOVE[_DATABASE]
|
||||
#### DIRECTORY_REMOVE[_DATABASE]
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 item off the stack as [count] (either 0 or 1). If count is 1, pop 1
|
||||
tuple off the stack as [path]. Call remove, passing it path if one was
|
||||
tuple off the stack as [path]. Call remove, passing it path if one was
|
||||
popped.
|
||||
|
||||
DIRECTORY_REMOVE_IF_EXISTS[_DATABASE]
|
||||
#### DIRECTORY_REMOVE_IF_EXISTS[_DATABASE]
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 item off the stack as [count] (either 0 or 1). If count is 1, pop 1
|
||||
tuple off the stack as [path]. Call remove_if_exits, passing it path if one
|
||||
tuple off the stack as [path]. Call remove_if_exits, passing it path if one
|
||||
was popped.
|
||||
|
||||
DIRECTORY_LIST[_DATABASE|_SNAPSHOT]
|
||||
#### DIRECTORY_LIST[_DATABASE|_SNAPSHOT]
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 item off the stack as [count] (either 0 or 1). If count is 1, pop 1
|
||||
tuple off the stack as [path]. Call list, passing it path if one was popped.
|
||||
Pack the resulting list of directories using the tuple layer and push the
|
||||
tuple off the stack as [path]. Call list, passing it path if one was popped.
|
||||
Pack the resulting list of directories using the tuple layer and push the
|
||||
packed string onto the stack.
|
||||
|
||||
DIRECTORY_EXISTS[_DATABASE|_SNAPSHOT]
|
||||
#### DIRECTORY_EXISTS[_DATABASE|_SNAPSHOT]
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 item off the stack as [count] (either 0 or 1). If count is 1, pop 1
|
||||
tuple off the stack as [path]. Call exists, passing it path if one
|
||||
tuple off the stack as [path]. Call exists, passing it path if one
|
||||
was popped. Push 1 onto the stack if the path exists and 0 if it does not.
|
||||
|
||||
Subspace Operations
|
||||
-------------------
|
||||
|
||||
DIRECTORY_PACK_KEY
|
||||
#### DIRECTORY_PACK_KEY
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 tuple off the stack as [key_tuple]. Pack key_tuple and push the result
|
||||
onto the stack.
|
||||
|
||||
DIRECTORY_UNPACK_KEY
|
||||
#### DIRECTORY_UNPACK_KEY
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 item off the stack as [key]. Unpack key and push the resulting tuple
|
||||
onto the stack one item at a time.
|
||||
|
||||
DIRECTORY_RANGE
|
||||
#### DIRECTORY_RANGE
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 tuple off the stack as [tuple]. Create a range using tuple and push
|
||||
Pop 1 tuple off the stack as [tuple]. Create a range using tuple and push
|
||||
range.begin and range.end onto the stack.
|
||||
|
||||
DIRECTORY_CONTAINS
|
||||
#### DIRECTORY_CONTAINS
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 item off the stack as [key]. Check if the current directory contains
|
||||
the specified key. Push 1 if it does and 0 if it doesn't.
|
||||
|
||||
DIRECTORY_OPEN_SUBSPACE
|
||||
#### DIRECTORY_OPEN_SUBSPACE
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 tuple off the stack as [tuple]. Open the subspace of the current
|
||||
Pop 1 tuple off the stack as [tuple]. Open the subspace of the current
|
||||
directory specified by tuple and push it onto the directory list.
|
||||
|
||||
Directory Logging
|
||||
--------------------
|
||||
|
||||
DIRECTORY_LOG_SUBSPACE
|
||||
#### DIRECTORY_LOG_SUBSPACE
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 item off the stack as [prefix]. Let key equal
|
||||
Pop 1 item off the stack as [prefix]. Let key equal
|
||||
prefix + tuple.pack([dir_index]). Set key to be the result of calling
|
||||
directory.key() in the current transaction.
|
||||
directory.key() in the current transaction.
|
||||
|
||||
DIRECTORY_LOG_DIRECTORY
|
||||
#### DIRECTORY_LOG_DIRECTORY
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 item off the stack as [raw_prefix]. Create a subspace log_subspace
|
||||
Pop 1 item off the stack as [raw_prefix]. Create a subspace log_subspace
|
||||
with path (dir_index) and the specified raw_prefix. Set:
|
||||
|
||||
tr[log_subspace[u'path']] = the tuple packed path of the directory.
|
||||
|
||||
tr[log_subspace[u'layer']] = the tuple packed layer of the directory.
|
||||
|
||||
tr[log_subspace[u'exists']] = the packed tuple containing a 1 if the
|
||||
tr[log_subspace[u'exists']] = the packed tuple containing a 1 if the
|
||||
directory exists and 0 if it doesn't.
|
||||
|
||||
tr[log_subspace[u'children']] the tuple packed list of children of the
|
||||
tr[log_subspace[u'children']] the tuple packed list of children of the
|
||||
directory.
|
||||
|
||||
Where log_subspace[u<str>] is the subspace packed tuple containing only the
|
||||
Where log_subspace[u<str>] is the subspace packed tuple containing only the
|
||||
single specified unicode string <str>.
|
||||
|
||||
Other
|
||||
-----
|
||||
|
||||
DIRECTORY_STRIP_PREFIX
|
||||
#### DIRECTORY_STRIP_PREFIX
|
||||
|
||||
Use the current directory for this operation.
|
||||
|
||||
Pop 1 item off the stack as [byte_array]. Call .key() on the current
|
||||
subspace and store the result as [prefix]. Throw an error if the popped
|
||||
array does not start with prefix. Otherwise, remove the prefix from the
|
||||
Pop 1 item off the stack as [byte_array]. Call .key() on the current
|
||||
subspace and store the result as [prefix]. Throw an error if the popped
|
||||
array does not start with prefix. Otherwise, remove the prefix from the
|
||||
popped array and push the result onto the stack.
|
@ -241,7 +241,7 @@ extern "C" {
|
||||
fdb_transaction_get_committed_version( FDBTransaction* tr,
|
||||
int64_t* out_version );
|
||||
|
||||
DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_transaction_get_versionstamp( FDBTransaction* tr );
|
||||
DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_transaction_get_versionstamp( FDBTransaction* tr );
|
||||
|
||||
DLLEXPORT WARN_UNUSED_RESULT FDBFuture*
|
||||
fdb_transaction_on_error( FDBTransaction* tr, fdb_error_t error );
|
||||
@ -276,7 +276,7 @@ extern "C" {
|
||||
|
||||
DLLEXPORT fdb_bool_t fdb_future_is_error( FDBFuture* f );
|
||||
#else
|
||||
#define fdb_future_is_error(x) FDB_REMOVED_FUNCTION
|
||||
#define fdb_future_is_error(x) FDB_REMOVED_FUNCTION
|
||||
#endif
|
||||
|
||||
#if FDB_API_VERSION < 14
|
||||
@ -307,7 +307,7 @@ extern "C" {
|
||||
int end_key_name_length, fdb_bool_t end_or_equal, int end_offset,
|
||||
int limit );
|
||||
#else
|
||||
#define fdb_transaction_get_range_selector(tr,bkn,bknl,boe,bo,ekn,eknl,eoe,eo,lim) FDB_REMOVED_FUNCTION
|
||||
#define fdb_transaction_get_range_selector(tr,bkn,bknl,boe,bo,ekn,eknl,eoe,eo,lim) FDB_REMOVED_FUNCTION
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,12 +1,12 @@
|
||||
fdb-go
|
||||
======
|
||||
|
||||
[Go language](http://golang.org) bindings for [FoundationDB](https://www.foundationdb.org/documentation/), a distributed key-value store with ACID transactions.
|
||||
[Go language](http://golang.org) bindings for [FoundationDB](https://apple.github.io/foundationdb/index.html#documentation), a distributed key-value store with ACID transactions.
|
||||
|
||||
This package requires:
|
||||
|
||||
- Go 1.1+ with CGO enabled
|
||||
- FoundationDB C API 2.0.x, 3.0.x, or 4.x.y (part of the [FoundationDB clients package](https://www.foundationdb.org/downloads/fdb-c/))
|
||||
- FoundationDB C API 2.0.x, 3.0.x, or 4.x.y (part of the [FoundationDB clients package](https://apple.github.io/foundationdb/downloads.html#c))
|
||||
|
||||
Use of this package requires the selection of a FoundationDB API version at runtime. This package currently supports FoundationDB API versions 200-510.
|
||||
|
||||
@ -28,4 +28,4 @@ Documentation
|
||||
-------------
|
||||
|
||||
* [API documentation](https://godoc.org/github.com/apple/foundationdb/bindings/go/src/fdb)
|
||||
* [Tutorial](https://www.foundationdb.org/documentation/class-scheduling-go.html)
|
||||
* [Tutorial](https://apple.github.io/foundationdb/class-scheduling.html)
|
||||
|
@ -167,7 +167,7 @@ else
|
||||
|
||||
if [[ "${status}" -eq 0 ]] ; then
|
||||
destdir=$( cd "${destdir}" && pwd ) # Get absolute path of destination dir.
|
||||
fdbdir="${destdir}/foundation"
|
||||
fdbdir="${destdir}/foundationdb"
|
||||
|
||||
if [[ ! -d "${destdir}" ]] ; then
|
||||
cmd=("mkdir" "-p" "${destdir}")
|
||||
|
@ -111,7 +111,7 @@ func retryable(wrapped func() (interface{}, error), onError func(Error) FutureNi
|
||||
// retried or, if fatal, return the error to the caller.
|
||||
//
|
||||
// When working with Future objects in a transactional function, you may either
|
||||
// explicity check and return error values using Get, or call MustGet. Transact
|
||||
// explicitly check and return error values using Get, or call MustGet. Transact
|
||||
// will recover a panicked Error and either retry the transaction or return the
|
||||
// error.
|
||||
//
|
||||
@ -151,7 +151,7 @@ func (d Database) Transact(f func(Transaction) (interface{}, error)) (interface{
|
||||
// retried or, if fatal, return the error to the caller.
|
||||
//
|
||||
// When working with Future objects in a read-only transactional function, you
|
||||
// may either explicity check and return error values using Get, or call
|
||||
// may either explicitly check and return error values using Get, or call
|
||||
// MustGet. ReadTransact will recover a panicked Error and either retry the
|
||||
// transaction or return the error.
|
||||
//
|
||||
|
@ -26,7 +26,7 @@
|
||||
//
|
||||
// For general guidance on directory usage, see the Directories section of the
|
||||
// Developer Guide
|
||||
// (https://www.foundationdb.org/documentation/developer-guide.html#developer-guide-directories).
|
||||
// (https://apple.github.io/foundationdb/developer-guide.html#directories).
|
||||
//
|
||||
// Directories are identified by hierarchical paths analogous to the paths in a
|
||||
// Unix-like file system. A path is represented as a slice of strings. Each
|
||||
|
@ -27,6 +27,7 @@ import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/apple/foundationdb/bindings/go/src/fdb"
|
||||
"github.com/apple/foundationdb/bindings/go/src/fdb/subspace"
|
||||
"github.com/apple/foundationdb/bindings/go/src/fdb/tuple"
|
||||
@ -78,9 +79,8 @@ func (dl directoryLayer) createOrOpen(rtr fdb.ReadTransaction, tr *fdb.Transacti
|
||||
if prefix != nil && !dl.allowManualPrefixes {
|
||||
if len(dl.path) == 0 {
|
||||
return nil, errors.New("cannot specify a prefix unless manual prefixes are enabled")
|
||||
} else {
|
||||
return nil, errors.New("cannot specify a prefix in a partition")
|
||||
}
|
||||
return nil, errors.New("cannot specify a prefix in a partition")
|
||||
}
|
||||
|
||||
if len(path) == 0 {
|
||||
@ -562,9 +562,8 @@ func (dl directoryLayer) contentsOfNode(node subspace.Subspace, path []string, l
|
||||
ndl := NewDirectoryLayer(subspace.FromBytes(nssb), ss, false).(directoryLayer)
|
||||
ndl.path = newPath
|
||||
return directoryPartition{ndl, dl}, nil
|
||||
} else {
|
||||
return directorySubspace{ss, dl, newPath, layer}, nil
|
||||
}
|
||||
return directorySubspace{ss, dl, newPath, layer}, nil
|
||||
}
|
||||
|
||||
func (dl directoryLayer) nodeWithPrefix(prefix []byte) subspace.Subspace {
|
||||
|
@ -72,9 +72,8 @@ func (dp directoryPartition) GetLayer() []byte {
|
||||
func (dp directoryPartition) getLayerForPath(path []string) directoryLayer {
|
||||
if len(path) == 0 {
|
||||
return dp.parentDirectoryLayer
|
||||
} else {
|
||||
return dp.directoryLayer
|
||||
}
|
||||
return dp.directoryLayer
|
||||
}
|
||||
|
||||
func (dp directoryPartition) MoveTo(t fdb.Transactor, newAbsolutePath []string) (DirectorySubspace, error) {
|
||||
|
@ -30,7 +30,7 @@ Windows and OS X at https://www.foundationdb.org/downloads/fdb-c/.
|
||||
This documentation specifically applies to the FoundationDB Go binding. For more
|
||||
extensive guidance to programming with FoundationDB, as well as API
|
||||
documentation for the other FoundationDB interfaces, please see
|
||||
https://www.foundationdb.org/documentation/index.html.
|
||||
https://apple.github.io/foundationdb/index.html.
|
||||
|
||||
Basic Usage
|
||||
|
||||
@ -198,7 +198,7 @@ operations perform different transformations. Like other database operations, an
|
||||
atomic operation is used within a transaction.
|
||||
|
||||
For more information on atomic operations in FoundationDB, please see
|
||||
https://www.foundationdb.org/documentation/developer-guide.html#atomic-operations. The
|
||||
https://apple.github.io/foundationdb/developer-guide.html#atomic-operations. The
|
||||
operands to atomic operations in this API must be provided as appropriately
|
||||
encoded byte slices. To convert a Go type to a byte slice, see the binary
|
||||
package.
|
||||
|
@ -37,7 +37,7 @@ import (
|
||||
// as a panic from any FoundationDB API function whose name ends with OrPanic.
|
||||
//
|
||||
// You may compare the Code field of an Error against the list of FoundationDB
|
||||
// error codes at https://www.foundationdb.org/documentation/api-error-codes.html,
|
||||
// error codes at https://apple.github.io/foundationdb/api-error-codes.html,
|
||||
// but generally an Error should be passed to (Transaction).OnError. When using
|
||||
// (Database).Transact, non-fatal errors will be retried automatically.
|
||||
type Error struct {
|
||||
|
@ -139,9 +139,8 @@ func APIVersion(version int) error {
|
||||
maxSupportedVersion := C.fdb_get_max_api_version()
|
||||
if headerVersion > int(maxSupportedVersion) {
|
||||
return fmt.Errorf("This version of the FoundationDB Go binding is not supported by the installed FoundationDB C library. The binding requires a library that supports API version %d, but the installed library supports a maximum version of %d.", version, maxSupportedVersion)
|
||||
} else {
|
||||
return fmt.Errorf("API version %d is not supported by the installed FoundationDB C library.", version)
|
||||
}
|
||||
return fmt.Errorf("API version %d is not supported by the installed FoundationDB C library.", version)
|
||||
}
|
||||
return Error{int(e)}
|
||||
}
|
||||
@ -326,9 +325,8 @@ func CreateCluster(clusterFile string) (Cluster, error) {
|
||||
func byteSliceToPtr(b []byte) *C.uint8_t {
|
||||
if len(b) > 0 {
|
||||
return (*C.uint8_t)(unsafe.Pointer(&b[0]))
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// A KeyConvertible can be converted to a FoundationDB Key. All functions in the
|
||||
|
@ -34,7 +34,7 @@ type Selectable interface {
|
||||
//
|
||||
// The most common key selectors are constructed with the functions documented
|
||||
// below. For details of how KeySelectors are specified and resolved, see
|
||||
// https://www.foundationdb.org/documentation/developer-guide.html#key-selectors.
|
||||
// https://apple.github.io/foundationdb/developer-guide.html#key-selectors.
|
||||
type KeySelector struct {
|
||||
Key KeyConvertible
|
||||
OrEqual bool
|
||||
|
@ -247,7 +247,7 @@ func (ri *RangeIterator) fetchNextBatch() {
|
||||
ri.sr.Begin = FirstGreaterThan(ri.kvs[ri.index-1].Key)
|
||||
}
|
||||
|
||||
ri.iteration += 1
|
||||
ri.iteration++
|
||||
|
||||
f := ri.t.doGetRange(ri.sr, ri.options, ri.snapshot, ri.iteration)
|
||||
ri.f = &f
|
||||
@ -265,7 +265,7 @@ func (ri *RangeIterator) Get() (kv KeyValue, e error) {
|
||||
|
||||
kv = ri.kvs[ri.index]
|
||||
|
||||
ri.index += 1
|
||||
ri.index++
|
||||
|
||||
if ri.index == len(ri.kvs) {
|
||||
ri.fetchNextBatch()
|
||||
@ -291,7 +291,7 @@ func Strinc(prefix []byte) ([]byte, error) {
|
||||
if prefix[i] != 0xFF {
|
||||
ret := make([]byte, i+1)
|
||||
copy(ret, prefix[:i+1])
|
||||
ret[i] += 1
|
||||
ret[i]++
|
||||
return ret, nil
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ package fdb
|
||||
// transaction conflicts but making it harder to reason about concurrency.
|
||||
//
|
||||
// For more information on snapshot reads, see
|
||||
// https://www.foundationdb.org/documentation/developer-guide.html#snapshot-reads.
|
||||
// https://apple.github.io/foundationdb/developer-guide.html#snapshot-reads.
|
||||
type Snapshot struct {
|
||||
*transaction
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
// As a best practice, API clients should use at least one subspace for
|
||||
// application data. For general guidance on subspace usage, see the Subspaces
|
||||
// section of the Developer Guide
|
||||
// (https://www.foundationdb.org/documentation/developer-guide.html#developer-guide-sub-keyspaces).
|
||||
// (https://apple.github.io/foundationdb/developer-guide.html#subspaces).
|
||||
package subspace
|
||||
|
||||
import (
|
||||
|
@ -171,7 +171,7 @@ func (t Transaction) SetReadVersion(version int64) {
|
||||
// but making it harder to reason about concurrency.
|
||||
//
|
||||
// For more information on snapshot reads, see
|
||||
// https://www.foundationdb.org/documentation/developer-guide.html#using-snapshot-reads.
|
||||
// https://apple.github.io/foundationdb/developer-guide.html#snapshot-reads.
|
||||
func (t Transaction) Snapshot() Snapshot {
|
||||
return Snapshot{t.transaction}
|
||||
}
|
||||
@ -196,7 +196,7 @@ func (t Transaction) OnError(e Error) FutureNil {
|
||||
// As with other client/server databases, in some failure scenarios a client may
|
||||
// be unable to determine whether a transaction succeeded. For more information,
|
||||
// see
|
||||
// https://www.foundationdb.org/documentation/developer-guide.html#developer-guide-unknown-results.
|
||||
// https://apple.github.io/foundationdb/developer-guide.html#transactions-with-unknown-results.
|
||||
func (t Transaction) Commit() FutureNil {
|
||||
return &futureNil{newFuture(C.fdb_transaction_commit(t.ptr))}
|
||||
}
|
||||
@ -352,9 +352,8 @@ func (t Transaction) Reset() {
|
||||
func boolToInt(b bool) int {
|
||||
if b {
|
||||
return 1
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (t *transaction) getKey(sel KeySelector, snapshot int) FutureKey {
|
||||
@ -396,7 +395,7 @@ func addConflictRange(t *transaction, er ExactRange, crtype conflictRangeType) e
|
||||
// conflict.
|
||||
//
|
||||
// For more information on conflict ranges, see
|
||||
// https://www.foundationdb.org/documentation/developer-guide.html#conflict-ranges.
|
||||
// https://apple.github.io/foundationdb/developer-guide.html#conflict-ranges.
|
||||
func (t Transaction) AddReadConflictRange(er ExactRange) error {
|
||||
return addConflictRange(t.transaction, er, conflictRangeTypeRead)
|
||||
}
|
||||
@ -413,7 +412,7 @@ func copyAndAppend(orig []byte, b byte) []byte {
|
||||
// this key could cause the transaction to fail with a conflict.
|
||||
//
|
||||
// For more information on conflict ranges, see
|
||||
// https://www.foundationdb.org/documentation/developer-guide.html#conflict-ranges.
|
||||
// https://apple.github.io/foundationdb/developer-guide.html#conflict-ranges.
|
||||
func (t Transaction) AddReadConflictKey(key KeyConvertible) error {
|
||||
return addConflictRange(t.transaction, KeyRange{key, Key(copyAndAppend(key.FDBKey(), 0x00))}, conflictRangeTypeRead)
|
||||
}
|
||||
@ -424,7 +423,7 @@ func (t Transaction) AddReadConflictKey(key KeyConvertible) error {
|
||||
// conflict.
|
||||
//
|
||||
// For more information on conflict ranges, see
|
||||
// https://www.foundationdb.org/documentation/developer-guide.html#conflict-ranges.
|
||||
// https://apple.github.io/foundationdb/developer-guide.html#conflict-ranges.
|
||||
func (t Transaction) AddWriteConflictRange(er ExactRange) error {
|
||||
return addConflictRange(t.transaction, er, conflictRangeTypeWrite)
|
||||
}
|
||||
@ -434,7 +433,7 @@ func (t Transaction) AddWriteConflictRange(er ExactRange) error {
|
||||
// read this key could fail with a conflict.
|
||||
//
|
||||
// For more information on conflict ranges, see
|
||||
// https://www.foundationdb.org/documentation/developer-guide.html#conflict-ranges.
|
||||
// https://apple.github.io/foundationdb/developer-guide.html#conflict-ranges.
|
||||
func (t Transaction) AddWriteConflictKey(key KeyConvertible) error {
|
||||
return addConflictRange(t.transaction, KeyRange{key, Key(copyAndAppend(key.FDBKey(), 0x00))}, conflictRangeTypeWrite)
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
// of higher-level data models.
|
||||
//
|
||||
// For general guidance on tuple usage, see the Tuple section of Data Modeling
|
||||
// (https://www.foundationdb.org/documentation/data-modeling.html#data-modeling-tuples).
|
||||
// (https://apple.github.io/foundationdb/data-modeling.html#tuples).
|
||||
//
|
||||
// FoundationDB tuples can currently encode byte and unicode strings, integers
|
||||
// and NULL values. In Go these are represented as []byte, string, int64 and
|
||||
@ -38,6 +38,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/apple/foundationdb/bindings/go/src/fdb"
|
||||
)
|
||||
|
||||
@ -114,7 +115,7 @@ func encodeBytes(buf *bytes.Buffer, code byte, b []byte) {
|
||||
func bisectLeft(u uint64) int {
|
||||
var n int
|
||||
for sizeLimits[n] < u {
|
||||
n += 1
|
||||
n++
|
||||
}
|
||||
return n
|
||||
}
|
||||
@ -356,7 +357,7 @@ func decodeTuple(b []byte, nested bool) (Tuple, int, error) {
|
||||
if err != nil {
|
||||
return nil, i, err
|
||||
}
|
||||
off += 1
|
||||
off++
|
||||
default:
|
||||
return nil, i, fmt.Errorf("unable to decode tuple element with unknown typecode %02x", b[i])
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
Complete documentation of the FoundationDB Python API can be found at https://www.foundationdb.org/documentation/api-python.html.
|
||||
Complete documentation of the FoundationDB Python API can be found at https://apple.github.io/foundationdb/api-python.html.
|
||||
|
||||
These bindings require the FoundationDB client. The client can be obtained from https://www.foundationdb.org/downloads/fdb-c/.
|
||||
|
@ -21,7 +21,7 @@
|
||||
# FoundationDB Python API
|
||||
|
||||
"""Documentation for this API can be found at
|
||||
https://www.foundationdb.org/documentation/api-python.html"""
|
||||
https://apple.github.io/foundationdb/api-python.html"""
|
||||
|
||||
|
||||
def open(*args, **kwargs):
|
||||
|
@ -21,7 +21,7 @@
|
||||
# FoundationDB Python API
|
||||
|
||||
"""Documentation for this API can be found at
|
||||
https://www.foundationdb.org/documentation/api-python.html"""
|
||||
https://apple.github.io/foundationdb/api-python.html"""
|
||||
|
||||
from fdb import impl as _impl
|
||||
|
||||
|
@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
||||
Ruby bindings for the FoundationDB database.
|
||||
|
||||
Complete documentation of the FoundationDB Ruby API can be found at:
|
||||
https://www.foundationdb.org/documentation/api-ruby.html.
|
||||
https://apple.github.io/foundationdb/api-ruby.html.
|
||||
EOF
|
||||
s.authors = ["FoundationDB"]
|
||||
s.email = 'fdb-dist@apple.com'
|
||||
|
@ -21,7 +21,7 @@
|
||||
# FoundationDB Ruby API
|
||||
|
||||
# Documentation for this API can be found at
|
||||
# https://www.foundationdb.org/documentation/api-ruby.html
|
||||
# https://apple.github.io/foundationdb/api-ruby.html
|
||||
|
||||
module FDB
|
||||
@@chosen_version = -1
|
||||
|
@ -23,7 +23,7 @@
|
||||
# FoundationDB Ruby API
|
||||
|
||||
# Documentation for this API can be found at
|
||||
# https://www.foundationdb.org/documentation/api-ruby.html
|
||||
# https://apple.github.io/foundationdb/api-ruby.html
|
||||
|
||||
require 'thread'
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
# FoundationDB Ruby API
|
||||
|
||||
# Documentation for this API can be found at
|
||||
# https://www.foundationdb.org/documentation/api-ruby.html
|
||||
# https://apple.github.io/foundationdb/api-ruby.html
|
||||
|
||||
require 'ffi'
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
# FoundationDB Ruby API
|
||||
|
||||
# Documentation for this API can be found at
|
||||
# https://www.foundationdb.org/documentation/api-ruby.html
|
||||
# https://apple.github.io/foundationdb/api-ruby.html
|
||||
|
||||
module FDB
|
||||
module Locality
|
||||
|
@ -23,7 +23,7 @@
|
||||
# FoundationDB Ruby API
|
||||
|
||||
# Documentation for this API can be found at
|
||||
# https://www.foundationdb.org/documentation/api-ruby.html
|
||||
# https://apple.github.io/foundationdb/api-ruby.html
|
||||
|
||||
require_relative 'fdbtuple'
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
# FoundationDB Ruby API
|
||||
|
||||
# Documentation for this API can be found at
|
||||
# https://www.foundationdb.org/documentation/api-ruby.html
|
||||
# https://apple.github.io/foundationdb/api-ruby.html
|
||||
|
||||
module FDB
|
||||
module Tuple
|
||||
|
@ -48,8 +48,7 @@ master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'FoundationDB'
|
||||
copyright = u'2015 Apple, Inc. All Rights Reserved.'
|
||||
author = u"Stephen Pimentel"
|
||||
copyright = u'2013-2018 Apple, Inc and the FoundationDB project authors'
|
||||
|
||||
# Load the version information from 'versions.target'
|
||||
import xml.etree.ElementTree as ET
|
||||
|
@ -121,7 +121,7 @@ The cluster file contains a connection string consisting of a cluster identifier
|
||||
|
||||
Together the ``description`` and the ``ID`` should uniquely identify a FoundationDB cluster.
|
||||
|
||||
A cluster file may contain comments, marked by the ``#`` character. All characters on a line after the first occurance of a ``#`` will be ignored.
|
||||
A cluster file may contain comments, marked by the ``#`` character. All characters on a line after the first occurrence of a ``#`` will be ignored.
|
||||
|
||||
Generally, a cluster file should not be modified manually. Incorrect modifications after a cluster is created could result in data loss. To change the set of coordination servers used by a cluster, see :ref:`configuration-choosing-coordination-servers`. To change the cluster ``description``, see :ref:`configuration-setting-cluster-description`.
|
||||
|
||||
@ -186,7 +186,7 @@ To temporarily or permanently remove one or more machines from a FoundationDB cl
|
||||
It is now safe to remove these machines or processes from the cluster.
|
||||
|
||||
|
||||
``exclude`` can be used to exclude either machines (by specifiying an IP address) or individual processes (by specificying an ``IP``:``PORT`` pair).
|
||||
``exclude`` can be used to exclude either machines (by specifying an IP address) or individual processes (by specifying an ``IP``:``PORT`` pair).
|
||||
|
||||
.. note:: Addresses have the form ``IP``:``PORT``. This form is used even if TLS is enabled.
|
||||
|
||||
@ -482,7 +482,7 @@ To make configuring, starting, stopping, and restarting ``fdbserver`` processes
|
||||
|
||||
During normal operation, ``fdbmonitor`` is transparent, and you interact with it only by modifying the configuration in :ref:`foundationdb.conf <foundationdb-conf>` and perhaps occasionally by :ref:`starting and stopping <administration-running-foundationdb>` it manually. If some problem prevents an ``fdbserver`` or ``backup-agent`` process from starting or causes it to stop unexpectedly, ``fdbmonitor`` will log errors to the system log.
|
||||
|
||||
If kill_on_configuration_change parameter is unset or set to `true` in foundationdb.conf then fdbmonitor will restart on changes automatically. If this parameter is set to `false` it will not restart on changes.
|
||||
If ``kill_on_configuration_change`` parameter is unset or set to ``true`` in foundationdb.conf then fdbmonitor will restart on changes automatically. If this parameter is set to ``false`` it will not restart on changes.
|
||||
|
||||
.. _administration-managing-trace-files:
|
||||
|
||||
|
@ -394,8 +394,8 @@ Transactional decoration
|
||||
|
||||
@fdb.transactional
|
||||
def simple_function(tr, x, y):
|
||||
tr['foo'] = x
|
||||
tr['bar'] = y
|
||||
tr[b'foo'] = x
|
||||
tr[b'bar'] = y
|
||||
|
||||
The ``@fdb.transactional`` decorator makes ``simple_function`` a transactional function. All functions using this decorator must have an argument **named** ``tr``. This specially named argument is passed a transaction that the function can use to do reads and writes.
|
||||
|
||||
@ -893,7 +893,7 @@ Asynchronous methods return one of the following subclasses of :class:`Future`:
|
||||
|
||||
@fdb.transactional
|
||||
def foo(tr):
|
||||
val = tr['foo']
|
||||
val = tr[b'foo']
|
||||
if val.present():
|
||||
print 'Got value: %s' % val
|
||||
else:
|
||||
|
@ -3,7 +3,7 @@ Architecture
|
||||
############
|
||||
|
||||
FoundationDB makes your architecture flexible and easy to operate. Your applications can send their data directly to the FoundationDB or to a :doc:`layer<layer-concept>`, a user-written module that can provide a new data model, compatibility with existing systems, or even serve as an entire framework. In both cases, all data is stored in a single place via an ordered, transactional key-value API.
|
||||
|
||||
|
||||
The following diagram details the logical architecture.
|
||||
|
||||
.. image:: /images/Architecture.pdf
|
||||
.. image:: /images/Architecture.png
|
||||
|
@ -48,7 +48,7 @@ There are 5 command line tools for working with Backup and DR operations:
|
||||
The backup agent is a daemon that actually executes the work of the backup and restore jobs. Any number of backup agents pointed at the same database will cooperate to perform backups and restores. The Backup URL specified for a backup or restore must be accessible by all ``backup_agent`` processes.
|
||||
|
||||
``fdbdr``
|
||||
This command line tool is used to control (but not execute) DR jobs - backups from one database to anothher. It can ``start``, ``abort`` a DR job, or ``switch`` the DR direction. It can also get the ``status`` of a running DR job.
|
||||
This command line tool is used to control (but not execute) DR jobs - backups from one database to another. It can ``start``, ``abort`` a DR job, or ``switch`` the DR direction. It can also get the ``status`` of a running DR job.
|
||||
|
||||
``dr_agent``
|
||||
The database backup agent is a daemon that actually executes the work of the DR jobs, writing snapshot and log data to the destination database. Any number of agents pointed at the same databases will cooperate to perform the backup.
|
||||
@ -193,7 +193,7 @@ The ``start`` subcommand is used to start a backup. If there is already a backu
|
||||
Perform the backup continuously rather than terminating once a restorable backup is achieved. Database mutations within the backup's target key ranges will be continuously written to the backup as well as repeated inconsistent snapshots at the configured snapshot rate.
|
||||
|
||||
``-s <DURATION>`` or ``--snapshot_interval <DURATION>``
|
||||
Specifies the duration, in seconds, of the inconsistent snapshots written to the backup in continous mode. The default is 864000 which is 10 days.
|
||||
Specifies the duration, in seconds, of the inconsistent snapshots written to the backup in continuous mode. The default is 864000 which is 10 days.
|
||||
|
||||
``-w``
|
||||
Wait for the backup to complete with behavior identical to that of the :ref:`wait command <backup-wait>`.
|
||||
@ -222,7 +222,7 @@ The ``abort`` subcommand is used to abort a backup that is currently in progress
|
||||
``discontinue``
|
||||
---------------
|
||||
|
||||
The ``discontinue`` subcommand is only available for backups that were started with the continuous (``-z``) option. Its effect is to discontinue the continous backup. Note that the subcommand does *not* abort the backup; it simply allows the backup to complete as a noncontinuous backup would.
|
||||
The ``discontinue`` subcommand is only available for backups that were started with the continuous (``-z``) option. Its effect is to discontinue the continuous backup. Note that the subcommand does *not* abort the backup; it simply allows the backup to complete as a noncontinuous backup would.
|
||||
|
||||
::
|
||||
|
||||
@ -287,7 +287,7 @@ The expiration CUTOFF must be specified by one of the two following arguments:
|
||||
``--expire_before_version <VERSION>``
|
||||
Specifies the cutoff by a database commit version.
|
||||
|
||||
Optionally, the user can specify a minimum RESTORABILITY guarauntee with one of the following options.
|
||||
Optionally, the user can specify a minimum RESTORABILITY guarantee with one of the following options.
|
||||
|
||||
``--restorable_after_timestamp <DATETIME>``
|
||||
Specifies that the backup must be restorable to DATETIME and later. Requires a cluster file and will use version/timestamp metadata in the database to convert DATETIME to a database commit version. DATETIME must be in the form "YYYY-MM-DD.HH:MI:SS" in UTC.
|
||||
@ -371,7 +371,7 @@ The ``start`` command will start a new restore on the specified (or default) tag
|
||||
Required. Specifies the Backup URL for the source backup data to restore to the database. The source data must be accessible by the ``backup_agent`` processes for the cluster.
|
||||
|
||||
``-w``
|
||||
Wait for the the restore to reach a final state (such as complete) before exiting. Prints a progress update every few seconds. Behavior is identical to that of the wait command.
|
||||
Wait for the restore to reach a final state (such as complete) before exiting. Prints a progress update every few seconds. Behavior is identical to that of the wait command.
|
||||
|
||||
``-k <KEYS>``
|
||||
Specify list of key ranges from the backup to restore to the database
|
||||
@ -443,7 +443,7 @@ The ``fdbdr`` command line tool is used to manage DR tasks.
|
||||
|
||||
user@host$ fdbdr [-h] <SUBCOMMAND> [<SUBCOMMAND_OPTIONS>] -d <CLUSTER_FILE> -s <CLUSTER_FILE> [-v]
|
||||
|
||||
The following arguments are used by mutiple subcommands:
|
||||
The following arguments are used by multiple subcommands:
|
||||
|
||||
``-h``
|
||||
Get help on the ``fdbdr`` command.
|
||||
@ -452,7 +452,7 @@ The following arguments are used by mutiple subcommands:
|
||||
Get the version of FoundationDB in use.
|
||||
|
||||
``-d <CLUSTER_FILE>``
|
||||
Specify the path to the ``fdb.cluster`` file for the destination cluster of the DR operaiton.
|
||||
Specify the path to the ``fdb.cluster`` file for the destination cluster of the DR operation.
|
||||
|
||||
``-s <CLUSTER_FILE>``
|
||||
Specify the path to the ``fdb.cluster`` file for the source cluster of the DR operation.
|
||||
@ -515,7 +515,7 @@ Unlike ``backup_agent``, ``dr_agent`` is not started automatically in a default
|
||||
Get the version of FoundationDB in use.
|
||||
|
||||
``-d <CLUSTER_FILE>``
|
||||
Specify the path to the ``fdb.cluster`` file for the destination cluster of the DR operaiton.
|
||||
Specify the path to the ``fdb.cluster`` file for the destination cluster of the DR operation.
|
||||
|
||||
``-s <CLUSTER_FILE>``
|
||||
Specify the path to the ``fdb.cluster`` file for the source cluster of the DR operation.
|
||||
|
@ -148,7 +148,7 @@ There is also a convenience option, ``coordinators auto``, that will automatical
|
||||
|
||||
.. note:: |coordinators-auto|
|
||||
|
||||
You can also change the cluster ``description``, as decribed in :ref:`configuration-setting-cluster-description`.
|
||||
You can also change the cluster ``description``, as described in :ref:`configuration-setting-cluster-description`.
|
||||
|
||||
Next steps
|
||||
==========
|
||||
|
@ -38,11 +38,11 @@ Next, we open a FoundationDB database. The API will connect to the FoundationDB
|
||||
|
||||
We are ready to use the database. In Python, using the ``[]`` operator on the db object is a convenient syntax for performing a read or write on the database. First, let's simply write a key-value pair:
|
||||
|
||||
>>> db['hello'] = 'world'
|
||||
>>> db[b'hello'] = b'world'
|
||||
|
||||
When this command returns without exception, the modification is durably stored in FoundationDB! Under the covers, this function creates a transaction with a single modification. We'll see later how to do multiple operations in a single transaction. For now, let's read back the data::
|
||||
|
||||
>>> print 'hello', db['hello']
|
||||
>>> print 'hello', db[b'hello']
|
||||
hello world
|
||||
|
||||
If this is all working, it looks like we are ready to start building a real application. For reference, here's the full code for "hello world"::
|
||||
@ -50,8 +50,8 @@ If this is all working, it looks like we are ready to start building a real appl
|
||||
import fdb
|
||||
fdb.api_version(510)
|
||||
db = fdb.open()
|
||||
db['hello'] = 'world'
|
||||
print 'hello', db['hello']
|
||||
db[b'hello'] = b'world'
|
||||
print 'hello', db[b'hello']
|
||||
|
||||
Class scheduling application
|
||||
============================
|
||||
@ -170,7 +170,7 @@ Before students can do anything else, they need to be able to retrieve a list of
|
||||
def available_classes(tr):
|
||||
return [course.unpack(k)[0] for k, v in tr[course.range(())]]
|
||||
|
||||
In general, the :meth:`Subspace.range` method returns a Python ``slice`` representing all the key-value pairs starting with the specified tuple. In this case, we want all classes, so we call :meth:`course.range` with the empty tuple ``()``. FoundationDB's ``tr[slice]`` function returns an iterable list of key-values in the range specified by the slice. We unpack the key ``k`` and value ``v`` in a comprehension. To extract the class name itself, we unpack the key into a tuple using the :py:mod:`fdb.tuple` module and take its third part. (The first and second parts are the prefixes for the ``scheduling`` and ``course`` subspaces, respectively.)
|
||||
In general, the :meth:`Subspace.range` method returns a Python ``slice`` representing all the key-value pairs starting with the specified tuple. In this case, we want all classes, so we call :meth:`course.range` with the empty tuple ``()``. FoundationDB's ``tr[slice]`` function returns an iterable list of key-values in the range specified by the slice. We unpack the key ``k`` and value ``v`` in a comprehension. To extract the class name itself, we unpack the key into a tuple using the :meth:`Subspace.unpack` method and take the first field. (The first and second parts of the tuple, the ``scheduling`` and ``course`` subspace prefixes, are removed by the ``unpack`` hence the reason we take the first field of the tuple.)
|
||||
|
||||
Signing up for a class
|
||||
----------------------
|
||||
@ -232,6 +232,19 @@ This is easy -- we simply add a condition to check that the value is non-zero. L
|
||||
|
||||
We now have to check that we aren't already signed up, since we don't want a double sign up to decrease the number of seats twice. Then we look up how many seats are left to make sure there is a seat remaining so we don't push the counter into the negative. If there is a seat remaining, we decrement the counter.
|
||||
|
||||
Similarly, the ``drop`` function is modified as follows:
|
||||
|
||||
.. code-block:: python
|
||||
:emphasize-lines: 4,5
|
||||
|
||||
@fdb.transactional
|
||||
def drop(tr, s, c):
|
||||
rec = attends.pack((s, c))
|
||||
if not tr[rec].present(): return # not taking this class
|
||||
tr[course.pack((c,))] = fdb.tuple.pack((fdb.tuple.unpack(tr[course.pack((c,))])[0] + 1,))
|
||||
del tr[rec]
|
||||
|
||||
Once again we check to see if the student is signed up and if not, we can just return as we don't want to incorrectly increase the number of seats. We then adjust the number of seats by one by taking the current value, incrementing it by one, and then storing back.
|
||||
|
||||
Concurrency and consistency
|
||||
---------------------------
|
||||
@ -247,23 +260,6 @@ Idempotence
|
||||
|
||||
Occasionally, a transaction might be retried even after it succeeds (for example, if the client loses contact with the cluster at just the wrong moment). This can cause problems if transactions are not written to be idempotent, i.e. to have the same effect if committed twice as if committed once. There are generic design patterns for :ref:`making any transaction idempotent <developer-guide-unknown-results>`, but many transactions are naturally idempotent. For example, all of the transactions in this tutorial are idempotent.
|
||||
|
||||
Dropping with limited seats
|
||||
---------------------------
|
||||
|
||||
Let's finish up the limited seats feature by modifying the drop function:
|
||||
|
||||
.. code-block:: python
|
||||
:emphasize-lines: 4,5
|
||||
|
||||
@fdb.transactional
|
||||
def drop(tr, s, c):
|
||||
rec = attends.pack((s, c))
|
||||
if not tr[rec].present(): return # not taking this class
|
||||
tr[course.pack((c,))] = fdb.tuple.pack((fdb.tuple.unpack(tr[course.pack((c,))])[0] + 1,))
|
||||
del tr[rec]
|
||||
|
||||
This case is easier than signup because there are no constraints we can hit. We just need to make sure the student is in the class and to "give back" one seat when the student drops.
|
||||
|
||||
More features?!
|
||||
---------------
|
||||
|
||||
|
@ -8,7 +8,7 @@ FoundationDB supports language bindings for application development using the or
|
||||
|
||||
* :doc:`getting-started-linux` explains how to install a local FoundationDB server suitable for development on Linux.
|
||||
|
||||
* :doc:`downloads` describes the FoundationDB packages available on Artifactory.
|
||||
* :doc:`downloads` describes the FoundationDB packages available on our website.
|
||||
|
||||
* :doc:`developer-guide` explains principles of application development applicable across all language bindings.
|
||||
|
||||
|
@ -74,7 +74,7 @@ Redundancy modes define storage requirements, required cluster size, and resilie
|
||||
* ``three_data_hall``
|
||||
* ``three_datacenter``
|
||||
|
||||
For descriptions of redundacy modes, see :ref:`configuration-choosing-redundancy-mode`.
|
||||
For descriptions of redundancy modes, see :ref:`configuration-choosing-redundancy-mode`.
|
||||
|
||||
storage engine
|
||||
^^^^^^^^^^^^^^^
|
||||
@ -108,7 +108,7 @@ The ``coordinators`` command is used to change cluster coordinators or descripti
|
||||
|
||||
Addresses may be specified as a list of IP:port pairs (such as ``coordinators 10.0.0.1:4000 10.0.0.2:4000 10.0.0.3:4000``). If addresses are specified, the coordinators will be set to them. An ``fdbserver`` process must be running on each of the specified addresses.
|
||||
|
||||
If ``auto`` is specified, coordinator addresses will be choosen automatically to support the configured redundancy level. (If the current set of coordinators are healthy and already support the configured redundancy level, nothing will be changed.)
|
||||
If ``auto`` is specified, coordinator addresses will be chosen automatically to support the configured redundancy level. (If the current set of coordinators are healthy and already support the configured redundancy level, nothing will be changed.)
|
||||
|
||||
For more information on setting coordinators, see :ref:`configuration-changing-coordination-servers`.
|
||||
|
||||
@ -194,7 +194,7 @@ The following options are available for use with the ``option`` command:
|
||||
|
||||
``READ_AHEAD_DISABLE`` - Disables read-ahead caching for range reads. Under normal operation, a transaction will read extra rows from the database into cache if range reads are used to page through a series of data one row at a time (i.e. if a range read with a one row limit is followed by another one row range read starting immediately after the result of the first).
|
||||
|
||||
``READ_YOUR_WRITES_DISABLE`` - Reads performed by a transaction will not see any prior mutations that occured in that transaction, instead seeing the value which was in the database at the transaction's read version. This option may provide a small performance benefit for the client, but also disables a number of client-side optimizations which are beneficial for transactions which tend to read and write the same keys within a single transaction.
|
||||
``READ_YOUR_WRITES_DISABLE`` - Reads performed by a transaction will not see any prior mutations that occurred in that transaction, instead seeing the value which was in the database at the transaction's read version. This option may provide a small performance benefit for the client, but also disables a number of client-side optimizations which are beneficial for transactions which tend to read and write the same keys within a single transaction.
|
||||
|
||||
``RETRY_LIMIT`` - Set a maximum number of retries after which additional calls to ``onError`` will throw the most recently seen error code. Valid parameter values are ``[-1, INT_MAX]``. If set to -1, will disable the retry limit. Like all transaction options, the retry limit must be reset after a call to ``onError``. This behavior allows the user to make the retry limit dynamic.
|
||||
|
||||
|
@ -257,7 +257,7 @@ Contains default parameters for all fdbserver processes on this machine. These s
|
||||
* ``maxlogssize``: Delete the oldest log file when the total size of all log files exceeds the specified size. If set to 0B, old log files will not be deleted. The default value is 100MiB.
|
||||
* ``class``: Process class specifying the roles that will be taken in the cluster. Recommended options are ``storage``, ``transaction``, ``stateless``. See :ref:`guidelines-process-class-config` for process class config recommendations.
|
||||
* ``memory``: Maximum memory used by the process. The default value is 8GiB. When specified without a unit, MiB is assumed. This parameter does not change the memory allocation of the program. Rather, it sets a hard limit beyond which the process will kill itself and be restarted. The default value of 8GiB is double the intended memory usage in the default configuration (providing an emergency buffer to deal with memory leaks or similar problems). It is *not* recommended to decrease the value of this parameter below its default value. It may be *increased* if you wish to allocate a very large amount of storage engine memory or cache. In particular, when the ``storage_memory`` parameter is increased, the ``memory`` parameter should be increased by an equal amount.
|
||||
* ``storage_memory``: Maximum memory used for data storage. This paramenter is used *only* with memory storage engine, not the ssd storage engine. The default value is 1GiB. When specified without a unit, MB is assumed. Clusters will be restricted to using this amount of memory per process for purposes of data storage. Memory overhead associated with storing the data is counted against this total. If you increase the ``storage_memory``, you should also increase the ``memory`` parameter by the same amount.
|
||||
* ``storage_memory``: Maximum memory used for data storage. This parameter is used *only* with memory storage engine, not the ssd storage engine. The default value is 1GiB. When specified without a unit, MB is assumed. Clusters will be restricted to using this amount of memory per process for purposes of data storage. Memory overhead associated with storing the data is counted against this total. If you increase the ``storage_memory``, you should also increase the ``memory`` parameter by the same amount.
|
||||
* ``locality_machineid``: Machine identifier key. All processes on a machine should share a unique id. By default, processes on a machine determine a unique id to share. This does not generally need to be set.
|
||||
* ``locality_zoneid``: Zone identifier key. Processes that share a zone id are considered non-unique for the purposes of data replication. If unset, defaults to machine id.
|
||||
* ``locality_dcid``: Data center identifier key. All processes physically located in a data center should share the id. No default value. If you are depending on data center based replication this must be set on all processes.
|
||||
|
BIN
documentation/sphinx/source/images/Architecture.png
Normal file
BIN
documentation/sphinx/source/images/Architecture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 553 KiB |
@ -87,7 +87,7 @@ The following is a simple implementation of the basic pattern:
|
||||
}
|
||||
|
||||
// Remove from the top of the queue.
|
||||
tcx.run((Transaction tr) ->
|
||||
tcx.run((Transaction tr) -> {
|
||||
tr.clear(item.getKey());
|
||||
return null;
|
||||
});
|
||||
@ -110,7 +110,7 @@ The following is a simple implementation of the basic pattern:
|
||||
|
||||
// Get the top element of the queue.
|
||||
private static KeyValue firstItem(TransactionContext tcx){
|
||||
return tcx.run((Transaction tr) ->
|
||||
return tcx.run((Transaction tr) -> {
|
||||
for(KeyValue kv : tr.getRange(queue.range(), 1)){
|
||||
return kv;
|
||||
}
|
||||
@ -121,7 +121,7 @@ The following is a simple implementation of the basic pattern:
|
||||
|
||||
// Get the last index in the queue.
|
||||
private static long lastIndex(TransactionContext tcx){
|
||||
return tcx.run((Transaction tr) ->
|
||||
return tcx.run((Transaction tr) -> {
|
||||
for(KeyValue kv : tr.snapshot().getRange(queue.range(), 1, true)){
|
||||
return (long)queue.unpack(kv.getKey()).get(0);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ Fixes
|
||||
Fixes
|
||||
-----
|
||||
|
||||
* Expiring a backup could cause the fdbbackup process to hang indefinately. <rdar://problem/39382121>
|
||||
* Expiring a backup could cause the fdbbackup process to hang indefinitely. <rdar://problem/39382121>
|
||||
|
||||
5.1.5
|
||||
=====
|
||||
@ -103,7 +103,7 @@ Features
|
||||
* The behavior of atomic "and" and "min" operations has changed when the key doesn't exist in the database. If the key is not present, then an "and" or "min" is now equivalent to a set. <rdar://problem/29255441>
|
||||
* Exception messages are more descriptive. <rdar://problem/33665340>
|
||||
* Clients can view a sample of committed mutations. <rdar://problem/33324935>
|
||||
* When switching to a DR cluster, the commit verisons on that cluster will be higher than the versions on the primary cluster. <rdar://problem/33572665>
|
||||
* When switching to a DR cluster, the commit versions on that cluster will be higher than the versions on the primary cluster. <rdar://problem/33572665>
|
||||
* Added a read-only lock aware transaction option. <rdar://problem/34579176>
|
||||
* Automatically suppress trace log events which occur too frequently. <rdar://problem/33764208>
|
||||
* Added a new ``multi_dc`` replication mode designed for cross data center deployments. <rdar://problem/36489132>
|
||||
@ -122,7 +122,7 @@ Performance
|
||||
* Excluded servers no longer take on stateless roles. <rdar://problem/27110802>
|
||||
* Stateless roles will be proactively moved off of excluded processes. <rdar://problem/27110802> <rdar://problem/35155044>
|
||||
* Dramatically improved restore speeds of large disk queue files. <rdar://problem/35567320>
|
||||
* Clients get key location information directly from the proxies, sigificantly reducing the latency of worst case read patterns. <rdar://problem/35953920>
|
||||
* Clients get key location information directly from the proxies, significantly reducing the latency of worst case read patterns. <rdar://problem/35953920>
|
||||
* Reduced the amount of work incompatible clients generate for coordinators and the cluster controller. In particular, this reduces the load on the cluster caused by using the multi-version client. <rdar://problem/30897631>
|
||||
* Pop partially recovered mutations from the transaction log to save disk space after multiple successive recoveries. <rdar://problem/33755270>
|
||||
* Stopped using network checksums when also using TLS. <rdar://problem/32157852>
|
||||
@ -136,7 +136,7 @@ Fixes
|
||||
* Exclude considered the free space of non-storage processes when determining if an exclude was safe.
|
||||
* ``fdbmonitor`` failed to start processes after fork failure. <rdar://problem/34743257>
|
||||
* ``fdbmonitor`` will only stop processes when the configuration file is deleted if ``kill_on_configuration_change`` is set. <rdar://problem/35497412>
|
||||
* The data distribution algorithm would hang indefinately when asked to build storage teams with more than three servers.
|
||||
* The data distribution algorithm would hang indefinitely when asked to build storage teams with more than three servers.
|
||||
* Mutations from a restore could continue to be applied for a very short amount of time after a restore was successfully aborted.
|
||||
|
||||
Extremely Rare Bug Fixes
|
||||
|
@ -18,7 +18,7 @@ We have a number of customers, ranging from network analytics providers to VoIP/
|
||||
Time-series Data and FoundationDB
|
||||
=================================
|
||||
|
||||
If you only have a few fields to store per database record, it’s pretty simple to picture what a time-oriented record would look like. If you were tracking analytics for a website, you might have a few fields, such as a website identifer, a page identfier, and a browser type. That’s pretty simple to picture fitting into a defined, relational-database table that looks like this:
|
||||
If you only have a few fields to store per database record, it’s pretty simple to picture what a time-oriented record would look like. If you were tracking analytics for a website, you might have a few fields, such as a website identifier, a page identifier, and a browser type. That’s pretty simple to picture fitting into a defined, relational-database table that looks like this:
|
||||
|
||||
============= ========== ======= ==========
|
||||
Timestamp website_ID page_ID browser_ID
|
||||
|
@ -63,7 +63,7 @@ Command-line Option Client Option Environment Variable Purpo
|
||||
|
||||
The value for each setting can be specified in more than one way. The actual valued used is determined in the following order:
|
||||
|
||||
1. An explicity specified value as a command-line option or client option, if one is given;
|
||||
1. An explicitly specified value as a command-line option or client option, if one is given;
|
||||
2. The value of the environment variable, if one has been set;
|
||||
3. The default value
|
||||
|
||||
@ -194,7 +194,7 @@ Setting Result
|
||||
Adding verification requirements
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Requirements can be placed on the fields of the Issuer and Subject DNs in the peer's own certificate. These reqirements take the form of a comma-separated list of conditions. Each condition takes the form of ``field=value``. Only certain fields from a DN can be matched against.
|
||||
Requirements can be placed on the fields of the Issuer and Subject DNs in the peer's own certificate. These requirements take the form of a comma-separated list of conditions. Each condition takes the form of ``field=value``. Only certain fields from a DN can be matched against.
|
||||
|
||||
====== ===================
|
||||
Field Well known name
|
||||
|
@ -140,7 +140,6 @@ description is not currently required but encouraged.
|
||||
description="Disables read-ahead caching for range reads. Under normal operation, a transaction will read extra rows from the database into cache if range reads are used to page through a series of data one row at a time (i.e. if a range read with a one row limit is followed by another one row range read starting immediately after the result of the first)." />
|
||||
<Option name="durability_datacenter" code="110" />
|
||||
<Option name="durability_risky" code="120" />
|
||||
<Option name="durability_dev_null_is_web_scale" code="130" />
|
||||
<Option name="priority_system_immediate" code="200"
|
||||
description="Specifies that this transaction should be treated as highest priority and that lower priority transactions should block behind this one. Use is discouraged outside of low-level tools" />
|
||||
<Option name="priority_batch" code="201"
|
||||
|
@ -79,7 +79,7 @@ namespace vexillographer
|
||||
# THE SOFTWARE.
|
||||
|
||||
# Documentation for this API can be found at
|
||||
# https://www.foundationdb.org/documentation/api-ruby.html
|
||||
# https://apple.github.io/foundationdb/api-ruby.html
|
||||
|
||||
module FDB");
|
||||
foreach (Scope s in Enum.GetValues(typeof(Scope)))
|
||||
|
@ -214,7 +214,7 @@ public:
|
||||
virtual void delref() { ReferenceCounted<TCTeamInfo>::delref(); }
|
||||
|
||||
private:
|
||||
// Calculate an "average" of the metrics replies that we received. Penalize teams from which we did not receieve all replies.
|
||||
// Calculate an "average" of the metrics replies that we received. Penalize teams from which we did not receive all replies.
|
||||
int64_t getLoadAverage() {
|
||||
int64_t bytesSum = 0;
|
||||
int added = 0;
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "IKeyValueStore.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <fstream>
|
||||
#include "pubsub.h"
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
@ -167,7 +167,7 @@
|
||||
** level of recursion for each term. A stack overflow can result
|
||||
** if the number of terms is too large. In practice, most SQL
|
||||
** never has more than 3 or 4 terms. Use a value of 0 to disable
|
||||
** any limit on the number of terms in a compount SELECT.
|
||||
** any limit on the number of terms in a compound SELECT.
|
||||
*/
|
||||
#ifndef SQLITE_MAX_COMPOUND_SELECT
|
||||
# define SQLITE_MAX_COMPOUND_SELECT 500
|
||||
@ -18242,7 +18242,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){
|
||||
|
||||
/* Make sure the locking sequence is correct.
|
||||
** (1) We never move from unlocked to anything higher than shared lock.
|
||||
** (2) SQLite never explicitly requests a pendig lock.
|
||||
** (2) SQLite never explicitly requests a pending lock.
|
||||
** (3) A shared lock is always held when a reserve lock is requested.
|
||||
*/
|
||||
assert( pFile->eFileLock!=NO_LOCK || eFileLock==SHARED_LOCK );
|
||||
@ -19491,7 +19491,7 @@ static int afpLock(sqlite3_file *id, int eFileLock){
|
||||
|
||||
/* Make sure the locking sequence is correct
|
||||
** (1) We never move from unlocked to anything higher than shared lock.
|
||||
** (2) SQLite never explicitly requests a pendig lock.
|
||||
** (2) SQLite never explicitly requests a pending lock.
|
||||
** (3) A shared lock is always held when a reserve lock is requested.
|
||||
*/
|
||||
assert( pFile->eFileLock!=NO_LOCK || eFileLock==SHARED_LOCK );
|
||||
@ -22475,7 +22475,7 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){
|
||||
** setting the environment variable SQLITE_FORCE_PROXY_LOCKING to 1 will
|
||||
** force proxy locking to be used for every database file opened, and 0
|
||||
** will force automatic proxy locking to be disabled for all database
|
||||
** files (explicity calling the SQLITE_SET_LOCKPROXYFILE pragma or
|
||||
** files (explicitly calling the SQLITE_SET_LOCKPROXYFILE pragma or
|
||||
** sqlite_file_control API is not affected by SQLITE_FORCE_PROXY_LOCKING).
|
||||
*/
|
||||
|
||||
@ -67194,7 +67194,7 @@ static void zeroblobFunc(
|
||||
/*
|
||||
** The replace() function. Three arguments are all strings: call
|
||||
** them A, B, and C. The result is also a string which is derived
|
||||
** from A by replacing every occurance of B with C. The match
|
||||
** from A by replacing every occurrence of B with C. The match
|
||||
** must be exact. Collating sequences are not used.
|
||||
*/
|
||||
static void replaceFunc(
|
||||
@ -90931,7 +90931,7 @@ SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
|
||||
** end result.
|
||||
**
|
||||
** Ticket #1066. the SQL standard does not allow '$' in the
|
||||
** middle of identfiers. But many SQL implementations do.
|
||||
** middle of identifiers. But many SQL implementations do.
|
||||
** SQLite will allow '$' in identifiers for compatibility.
|
||||
** But the feature is undocumented.
|
||||
*/
|
||||
|
@ -218,7 +218,7 @@ void CServiceBase::Stop()
|
||||
// Log the error.
|
||||
WriteErrorLogEntry("Service Stop", dwError);
|
||||
|
||||
// Set the orginal service status.
|
||||
// Set the original service status.
|
||||
SetServiceStatus(dwOriginalState);
|
||||
}
|
||||
catch (...)
|
||||
@ -226,7 +226,7 @@ void CServiceBase::Stop()
|
||||
// Log the error.
|
||||
WriteEventLogEntry("Service failed to stop.", EVENTLOG_ERROR_TYPE);
|
||||
|
||||
// Set the orginal service status.
|
||||
// Set the original service status.
|
||||
SetServiceStatus(dwOriginalState);
|
||||
}
|
||||
}
|
||||
|
@ -2645,6 +2645,28 @@ void setupSlowTaskProfiler() {
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
// There's no good place to put this, so it's here.
|
||||
// Ubuntu's packaging of libstdc++_pic offers different symbols than libstdc++. Go figure.
|
||||
// Notably, it's missing a definition of std::istream::ignore(long), which causes compilation errors
|
||||
// in the bindings. Thus, we provide weak versions of their definitions, so that if the
|
||||
// linked-against libstdc++ is missing their definitions, we'll be able to use the provided
|
||||
// ignore(long, int) version.
|
||||
#include <istream>
|
||||
namespace std {
|
||||
typedef basic_istream<char, std::char_traits<char>> char_basic_istream;
|
||||
template <>
|
||||
char_basic_istream& __attribute__((weak)) char_basic_istream::ignore(streamsize count) {
|
||||
return ignore(count, std::char_traits<char>::eof());
|
||||
}
|
||||
typedef basic_istream<wchar_t, std::char_traits<wchar_t>> wchar_basic_istream;
|
||||
template <>
|
||||
wchar_basic_istream& __attribute__((weak)) wchar_basic_istream::ignore(streamsize count) {
|
||||
return ignore(count, std::char_traits<wchar_t>::eof());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// UnitTest for getMemoryInfo
|
||||
#ifdef __linux__
|
||||
TEST_CASE("flow/Platform/getMemoryInfo") {
|
||||
|
@ -355,7 +355,7 @@ template <> inline void FieldHeader<Standalone<StringRef>>::update(Standalone<St
|
||||
// data block or to read all field values from a metric value block. This usage pattern enables enables
|
||||
// encoding and decoding values as deltas from previous values.
|
||||
//
|
||||
// The default implemenation works for ints and writes delta from the previous value.
|
||||
// The default implementation works for ints and writes delta from the previous value.
|
||||
template <typename T>
|
||||
struct FieldValueBlockEncoding {
|
||||
FieldValueBlockEncoding() : prev(0) {}
|
||||
@ -1156,7 +1156,7 @@ struct FieldValueBlockEncoding<TimeAndValue<T>> {
|
||||
FieldValueBlockEncoding<T> value_encoding;
|
||||
};
|
||||
|
||||
// ValueBlock encoder/decoder specialization for continous bool metrics because they are encoded
|
||||
// ValueBlock encoder/decoder specialization for continuous bool metrics because they are encoded
|
||||
// more efficiently than encoding the time and bool types separately.
|
||||
// Instead, time and value are combined to a single value (time delta << 1) + (value ? 1 : 0) and then
|
||||
// that value is encoded as a delta.
|
||||
|
@ -1191,7 +1191,7 @@ int GetCPU();
|
||||
// family of functions as standardized in POSIX.1-2001.
|
||||
//
|
||||
// Note: While Apple provides <semaphore.h> for both iOS and macOS, it is
|
||||
// explicity deprecated and will cause build failures if enabled for those
|
||||
// explicitly deprecated and will cause build failures if enabled for those
|
||||
// platforms. We side-step the issue by not defining it here for Apple
|
||||
// platforms.
|
||||
#ifdef ABSL_HAVE_SEMAPHORE_H
|
||||
@ -1250,7 +1250,7 @@ int GetCPU();
|
||||
|
||||
// ABSL_HAVE_STD_ANY
|
||||
//
|
||||
// Checks whether C++17 std::any is availble by checking whether <any> exists.
|
||||
// Checks whether C++17 std::any is available by checking whether <any> exists.
|
||||
#ifdef ABSL_HAVE_STD_ANY
|
||||
#error "ABSL_HAVE_STD_ANY cannot be directly set."
|
||||
#endif
|
||||
|
@ -2,7 +2,7 @@
|
||||
##
|
||||
## Configuration file for FoundationDB server processes
|
||||
## Full documentation is available at
|
||||
## https://www.foundationdb.org/documentation/configuration.html#foundationdb-conf
|
||||
## https://apple.github.io/foundationdb/configuration.html#the-configuration-file
|
||||
|
||||
[fdbmonitor]
|
||||
user = foundationdb
|
||||
|
@ -99,9 +99,6 @@
|
||||
<CreateFolder />
|
||||
<Environment Action='set' Name='FOUNDATIONDB_INSTALL_PATH' Value='[INSTALLDIR]' Part='all' Id='InstallPathSetEnvVar' System='yes' Permanent='no' />
|
||||
</Component>
|
||||
<Component Id='LicenseFiles' Guid='{071FFA9B-EDE5-42E3-A8EC-B9AFA6B260D2}' Win64='yes'>
|
||||
<File Id='README' Name='README.txt' DiskId='1' Source='$(var.SolutionRoot)README.md'/>
|
||||
</Component>
|
||||
<Directory Id='IncludeDir' Name='include'>
|
||||
<Directory Id='IncludeFDBDir' Name='foundationdb'>
|
||||
<Component Id='FDBCLibraryHeader' Guid='{32D846FA-3BA8-4CF6-8777-51DFA1011198}' Win64='yes'>
|
||||
@ -301,7 +298,6 @@
|
||||
<ComponentRef Id='CreateClusterFileDir'/> <!-- In a client only install, we don't make any files here, but want it to be easy to drop fdb.cluster here -->
|
||||
<ComponentRef Id='PathAddition'/>
|
||||
<ComponentRef Id='InstallPathEnvVar'/>
|
||||
<ComponentRef Id='LicenseFiles'/>
|
||||
<ComponentRef Id='FDBCLibraryPFiles' />
|
||||
<ComponentRef Id='FDBCLibraryHeader'/>
|
||||
<ComponentRef Id='FDBCLibraryLib' />
|
||||
@ -390,10 +386,23 @@
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT"
|
||||
Value="Thank you for installing FoundationDB. For documentation, please visit https://www.foundationdb.org/documentation.
|
||||
Value="Thank you for installing FoundationDB. For documentation, please visit https://apple.github.io/foundationdb/index.html#documentation.
|
||||
|
||||
To allow path variables to update, please restart your IDE and any open terminal sessions." />
|
||||
|
||||
<UIRef Id='WixUI_FeatureTree' />
|
||||
<UI>
|
||||
<Publish Dialog="WelcomeDlg"
|
||||
Control="Next"
|
||||
Event="NewDialog"
|
||||
Value="FeaturesDlg"
|
||||
Order="2">1</Publish>
|
||||
<Publish Dialog="FeaturesDlg"
|
||||
Control="Back"
|
||||
Event="NewDialog"
|
||||
Value="WelcomeDlg"
|
||||
Order="2">1</Publish>
|
||||
</UI>
|
||||
<UIRef Id='WixUI_ErrorProgressText' />
|
||||
|
||||
<WixVariable Id="WixUIDialogBmp" Value="$(var.ProjectRoot)\art\dialog.jpg" />
|
||||
|
@ -2,7 +2,7 @@
|
||||
##
|
||||
## Configuration file for FoundationDB server processes
|
||||
## Full documentation is available at
|
||||
## https://www.foundationdb.org/documentation/configuration.html#foundationdb-conf
|
||||
## https://apple.github.io/foundationdb/configuration.html#the-configuration-file
|
||||
|
||||
[fdbmonitor]
|
||||
restart_delay = 20
|
||||
|
@ -2,7 +2,7 @@
|
||||
##
|
||||
## Configuration file for FoundationDB server processes
|
||||
## Full documentation is available at
|
||||
## https://www.foundationdb.org/documentation/configuration.html#foundationdb-conf
|
||||
## https://apple.github.io/foundationdb/configuration.html#the-configuration-file
|
||||
|
||||
[general]
|
||||
restart_delay = 60
|
||||
|
Loading…
x
Reference in New Issue
Block a user