Merge branch 'master' into mengxu/fast-restore-agent-PR

This commit is contained in:
Meng Xu 2020-02-03 17:23:54 -08:00
commit 3b57bf1781
142 changed files with 2130 additions and 773 deletions

View File

@ -26,7 +26,7 @@ sys.path[:0] = [os.path.join(os.path.dirname(__file__), '..', '..', 'bindings',
import util
FDB_API_VERSION = 620
FDB_API_VERSION = 700
LOGGING = {
'version': 1,

View File

@ -157,7 +157,7 @@ def choose_api_version(selected_api_version, tester_min_version, tester_max_vers
api_version = min_version
elif random.random() < 0.9:
api_version = random.choice([v for v in [13, 14, 16, 21, 22, 23, 100, 200, 300, 400, 410, 420, 430,
440, 450, 460, 500, 510, 520, 600, 610, 620] if v >= min_version and v <= max_version])
440, 450, 460, 500, 510, 520, 600, 610, 620, 700] if v >= min_version and v <= max_version])
else:
api_version = random.randint(min_version, max_version)

View File

@ -20,7 +20,7 @@
import os
MAX_API_VERSION = 620
MAX_API_VERSION = 700
COMMON_TYPES = ['null', 'bytes', 'string', 'int', 'uuid', 'bool', 'float', 'double', 'tuple']
ALL_TYPES = COMMON_TYPES + ['versionstamp']

View File

@ -34,7 +34,7 @@ fdb.api_version(FDB_API_VERSION)
class ScriptedTest(Test):
TEST_API_VERSION = 620
TEST_API_VERSION = 700
def __init__(self, subspace):
super(ScriptedTest, self).__init__(subspace, ScriptedTest.TEST_API_VERSION, ScriptedTest.TEST_API_VERSION)

View File

@ -18,7 +18,7 @@
* limitations under the License.
*/
#define FDB_API_VERSION 620
#define FDB_API_VERSION 700
#define FDB_INCLUDE_LEGACY_TYPES
#include "fdbclient/MultiVersionTransaction.h"

View File

@ -28,10 +28,10 @@
#endif
#if !defined(FDB_API_VERSION)
#error You must #define FDB_API_VERSION prior to including fdb_c.h (current version is 620)
#error You must #define FDB_API_VERSION prior to including fdb_c.h (current version is 700)
#elif FDB_API_VERSION < 13
#error API version no longer supported (upgrade to 13)
#elif FDB_API_VERSION > 620
#elif FDB_API_VERSION > 700
#error Requested API version requires a newer version of this header
#endif
@ -91,12 +91,21 @@ extern "C" {
DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_add_network_thread_completion_hook(void (*hook)(void*), void *hook_parameter);
#pragma pack(push, 4)
#if FDB_API_VERSION >= 700
typedef struct keyvalue {
const uint8_t* key;
int key_length;
const uint8_t* value;
int value_length;
} FDBKeyValue;
#else
typedef struct keyvalue {
const void* key;
int key_length;
const void* value;
int value_length;
} FDBKeyValue;
#endif
#pragma pack(pop)
DLLEXPORT void fdb_future_cancel( FDBFuture* f );

View File

@ -3,7 +3,7 @@
#pragma once
#ifndef FDB_API_VERSION
#define FDB_API_VERSION 620
#define FDB_API_VERSION 700
#endif
#include <foundationdb/fdb_c.h>

View File

@ -603,7 +603,7 @@ void runTests(struct ResultSet *rs) {
int main(int argc, char **argv) {
srand(time(NULL));
struct ResultSet *rs = newResultSet();
checkError(fdb_select_api_version(620), "select API version", rs);
checkError(fdb_select_api_version(700), "select API version", rs);
printf("Running performance test at client version: %s\n", fdb_get_client_version());
valueStr = (uint8_t*)malloc((sizeof(uint8_t))*valueSize);

View File

@ -244,7 +244,7 @@ void runTests(struct ResultSet *rs) {
int main(int argc, char **argv) {
srand(time(NULL));
struct ResultSet *rs = newResultSet();
checkError(fdb_select_api_version(620), "select API version", rs);
checkError(fdb_select_api_version(700), "select API version", rs);
printf("Running RYW Benchmark test at client version: %s\n", fdb_get_client_version());
keys = generateKeys(numKeys, keySize);

View File

@ -29,7 +29,7 @@
#include <inttypes.h>
#ifndef FDB_API_VERSION
#define FDB_API_VERSION 620
#define FDB_API_VERSION 700
#endif
#include <foundationdb/fdb_c.h>

View File

@ -97,7 +97,7 @@ void runTests(struct ResultSet *rs) {
int main(int argc, char **argv) {
srand(time(NULL));
struct ResultSet *rs = newResultSet();
checkError(fdb_select_api_version(620), "select API version", rs);
checkError(fdb_select_api_version(700), "select API version", rs);
printf("Running performance test at client version: %s\n", fdb_get_client_version());
keys = generateKeys(numKeys, KEY_SIZE);

View File

@ -18,7 +18,7 @@
* limitations under the License.
*/
#define FDB_API_VERSION 620
#define FDB_API_VERSION 700
#include "foundationdb/fdb_c.h"
#undef DLLEXPORT
#include "workloads.h"
@ -258,7 +258,7 @@ struct SimpleWorkload : FDBWorkload {
insertsPerTx = context->getOption("insertsPerTx", 100ul);
opsPerTx = context->getOption("opsPerTx", 100ul);
runFor = context->getOption("runFor", 10.0);
auto err = fdb_select_api_version(620);
auto err = fdb_select_api_version(700);
if (err) {
context->trace(FDBSeverity::Info, "SelectAPIVersionFailed",
{ { "Error", std::string(fdb_get_error(err)) } });

View File

@ -35,7 +35,7 @@ THREAD_FUNC networkThread(void* fdb) {
}
ACTOR Future<Void> _test() {
API *fdb = FDB::API::selectAPIVersion(620);
API *fdb = FDB::API::selectAPIVersion(700);
auto db = fdb->createDatabase();
state Reference<Transaction> tr = db->createTransaction();
@ -78,7 +78,7 @@ ACTOR Future<Void> _test() {
}
void fdb_flow_test() {
API *fdb = FDB::API::selectAPIVersion(620);
API *fdb = FDB::API::selectAPIVersion(700);
fdb->setupNetwork();
startThread(networkThread, fdb);

View File

@ -23,7 +23,7 @@
#include <flow/flow.h>
#define FDB_API_VERSION 620
#define FDB_API_VERSION 700
#include <bindings/c/foundationdb/fdb_c.h>
#undef DLLEXPORT

View File

@ -1793,7 +1793,7 @@ ACTOR void _test_versionstamp() {
try {
g_network = newNet2(false);
API *fdb = FDB::API::selectAPIVersion(620);
API *fdb = FDB::API::selectAPIVersion(700);
fdb->setupNetwork();
startThread(networkThread, fdb);

View File

@ -9,7 +9,7 @@ This package requires:
- [Mono](http://www.mono-project.com/) (macOS or Linux) or [Visual Studio](https://www.visualstudio.com/) (Windows) (build-time only)
- FoundationDB C API 2.0.x-6.1.x (part of the [FoundationDB client packages](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-620.
Use of this package requires the selection of a FoundationDB API version at runtime. This package currently supports FoundationDB API versions 200-700.
To install this package, you can run the "fdb-go-install.sh" script (for versions 5.0.x and greater):

View File

@ -22,7 +22,7 @@
package fdb
// #define FDB_API_VERSION 620
// #define FDB_API_VERSION 700
// #include <foundationdb/fdb_c.h>
import "C"

View File

@ -22,7 +22,7 @@
package fdb
// #define FDB_API_VERSION 620
// #define FDB_API_VERSION 700
// #include <foundationdb/fdb_c.h>
import "C"

View File

@ -45,6 +45,10 @@ func (dp directoryPartition) Pack(t tuple.Tuple) fdb.Key {
panic("cannot pack keys using the root of a directory partition")
}
func (dp directoryPartition) PackWithVersionstamp(t tuple.Tuple) (fdb.Key, error) {
panic("cannot pack keys using the root of a directory partition")
}
func (dp directoryPartition) Unpack(k fdb.KeyConvertible) (tuple.Tuple, error) {
panic("cannot unpack keys using the root of a directory partition")
}

View File

@ -46,7 +46,7 @@ A basic interaction with the FoundationDB API is demonstrated below:
func main() {
// Different API versions may expose different runtime behaviors.
fdb.MustAPIVersion(620)
fdb.MustAPIVersion(700)
// Open the default database from the system cluster
db := fdb.MustOpenDefault()

View File

@ -22,7 +22,7 @@
package fdb
// #define FDB_API_VERSION 620
// #define FDB_API_VERSION 700
// #include <foundationdb/fdb_c.h>
import "C"

View File

@ -22,7 +22,7 @@
package fdb
// #define FDB_API_VERSION 620
// #define FDB_API_VERSION 700
// #include <foundationdb/fdb_c.h>
// #include <stdlib.h>
import "C"
@ -108,7 +108,7 @@ func (opt NetworkOptions) setOpt(code int, param []byte) error {
// library, an error will be returned. APIVersion must be called prior to any
// other functions in the fdb package.
//
// Currently, this package supports API versions 200 through 620.
// Currently, this package supports API versions 200 through 700.
//
// Warning: When using the multi-version client API, setting an API version that
// is not supported by a particular client library will prevent that client from
@ -116,7 +116,7 @@ func (opt NetworkOptions) setOpt(code int, param []byte) error {
// the API version of your application after upgrading your client until the
// cluster has also been upgraded.
func APIVersion(version int) error {
headerVersion := 620
headerVersion := 700
networkMutex.Lock()
defer networkMutex.Unlock()
@ -128,7 +128,7 @@ func APIVersion(version int) error {
return errAPIVersionAlreadySet
}
if version < 200 || version > 620 {
if version < 200 || version > 700 {
return errAPIVersionNotSupported
}

View File

@ -23,7 +23,7 @@
package fdb
// #cgo LDFLAGS: -lfdb_c -lm
// #define FDB_API_VERSION 620
// #define FDB_API_VERSION 700
// #include <foundationdb/fdb_c.h>
// #include <string.h>
//

View File

@ -22,7 +22,7 @@
package fdb
// #define FDB_API_VERSION 620
// #define FDB_API_VERSION 700
// #include <foundationdb/fdb_c.h>
import "C"

View File

@ -54,6 +54,15 @@ type Subspace interface {
// Subspace prepended.
Pack(t tuple.Tuple) fdb.Key
// PackWithVersionstamp returns the key encoding the specified tuple in
// the subspace so that it may be used as the key in fdb.Transaction's
// SetVersionstampedKey() method. The passed tuple must contain exactly
// one incomplete tuple.Versionstamp instance or the method will return
// with an error. The behavior here is the same as if one used the
// tuple.PackWithVersionstamp() method to appropriately pack together this
// subspace and the passed tuple.
PackWithVersionstamp(t tuple.Tuple) (fdb.Key, error)
// Unpack returns the Tuple encoded by the given key with the prefix of this
// Subspace removed. Unpack will return an error if the key is not in this
// Subspace or does not encode a well-formed Tuple.
@ -108,6 +117,10 @@ func (s subspace) Pack(t tuple.Tuple) fdb.Key {
return fdb.Key(concat(s.b, t.Pack()...))
}
func (s subspace) PackWithVersionstamp(t tuple.Tuple) (fdb.Key, error) {
return t.PackWithVersionstamp(s.b)
}
func (s subspace) Unpack(k fdb.KeyConvertible) (tuple.Tuple, error) {
key := k.FDBKey()
if !bytes.HasPrefix(key, s.b) {

View File

@ -22,7 +22,7 @@
package fdb
// #define FDB_API_VERSION 620
// #define FDB_API_VERSION 700
// #include <foundationdb/fdb_c.h>
import "C"

View File

@ -19,7 +19,7 @@
*/
#include <foundationdb/ClientWorkload.h>
#define FDB_API_VERSION 620
#define FDB_API_VERSION 700
#include <foundationdb/fdb_c.h>
#include <jni.h>
@ -370,7 +370,7 @@ struct JVM {
jmethodID selectMethod =
env->GetStaticMethodID(fdbClass, "selectAPIVersion", "(IZ)Lcom/apple/foundationdb/FDB;");
checkException();
env->CallStaticObjectMethod(fdbClass, selectMethod, jint(620), jboolean(false));
env->CallStaticObjectMethod(fdbClass, selectMethod, jint(700), jboolean(false));
checkException();
}

View File

@ -21,7 +21,7 @@
#include <jni.h>
#include <string.h>
#define FDB_API_VERSION 620
#define FDB_API_VERSION 700
#include <foundationdb/fdb_c.h>

View File

@ -35,7 +35,7 @@ import java.util.concurrent.atomic.AtomicInteger;
* This call is required before using any other part of the API. The call allows
* an error to be thrown at this point to prevent client code from accessing a later library
* with incorrect assumptions from the current version. The API version documented here is version
* {@code 620}.<br><br>
* {@code 700}.<br><br>
* FoundationDB encapsulates multiple versions of its interface by requiring
* the client to explicitly specify the version of the API it uses. The purpose
* of this design is to allow you to upgrade the server, client libraries, or
@ -193,8 +193,8 @@ public class FDB {
}
if(version < 510)
throw new IllegalArgumentException("API version not supported (minimum 510)");
if(version > 620)
throw new IllegalArgumentException("API version not supported (maximum 620)");
if(version > 700)
throw new IllegalArgumentException("API version not supported (maximum 700)");
Select_API_version(version);
FDB fdb = new FDB(version, controlRuntime);

View File

@ -13,7 +13,7 @@ and then added to your classpath.<br>
<h1>Getting started</h1>
To start using FoundationDB from Java, create an instance of the
{@link com.apple.foundationdb.FDB FoundationDB API interface} with the version of the
API that you want to use (this release of the FoundationDB Java API supports versions between {@code 510} and {@code 620}).
API that you want to use (this release of the FoundationDB Java API supports versions between {@code 510} and {@code 700}).
With this API object you can then open {@link com.apple.foundationdb.Cluster Cluster}s and
{@link com.apple.foundationdb.Database Database}s and start using
{@link com.apple.foundationdb.Transaction Transaction}s.
@ -29,7 +29,7 @@ import com.apple.foundationdb.tuple.Tuple;
public class Example {
public static void main(String[] args) {
FDB fdb = FDB.selectAPIVersion(620);
FDB fdb = FDB.selectAPIVersion(700);
try(Database db = fdb.open()) {
// Run an operation on the database

View File

@ -27,7 +27,7 @@ import com.apple.foundationdb.Database;
import com.apple.foundationdb.FDB;
public abstract class AbstractTester {
public static final int API_VERSION = 620;
public static final int API_VERSION = 700;
protected static final int NUM_RUNS = 25;
protected static final Charset ASCII = Charset.forName("ASCII");

View File

@ -33,7 +33,7 @@ public class BlockingBenchmark {
private static final int PARALLEL = 100;
public static void main(String[] args) throws InterruptedException {
FDB fdb = FDB.selectAPIVersion(620);
FDB fdb = FDB.selectAPIVersion(700);
// The cluster file DOES NOT need to be valid, although it must exist.
// This is because the database is never really contacted in this test.

View File

@ -48,7 +48,7 @@ public class ConcurrentGetSetGet {
}
public static void main(String[] args) {
try(Database database = FDB.selectAPIVersion(620).open()) {
try(Database database = FDB.selectAPIVersion(700).open()) {
new ConcurrentGetSetGet().apply(database);
}
}

View File

@ -33,7 +33,7 @@ import com.apple.foundationdb.directory.DirectorySubspace;
public class DirectoryTest {
public static void main(String[] args) throws Exception {
try {
FDB fdb = FDB.selectAPIVersion(620);
FDB fdb = FDB.selectAPIVersion(700);
try(Database db = fdb.open()) {
runTests(db);
}

View File

@ -26,7 +26,7 @@ import com.apple.foundationdb.tuple.Tuple;
public class Example {
public static void main(String[] args) {
FDB fdb = FDB.selectAPIVersion(620);
FDB fdb = FDB.selectAPIVersion(700);
try(Database db = fdb.open()) {
// Run an operation on the database

View File

@ -31,7 +31,7 @@ public class IterableTest {
public static void main(String[] args) throws InterruptedException {
final int reps = 1000;
try {
FDB fdb = FDB.selectAPIVersion(620);
FDB fdb = FDB.selectAPIVersion(700);
try(Database db = fdb.open()) {
runTests(reps, db);
}

View File

@ -34,7 +34,7 @@ import com.apple.foundationdb.tuple.ByteArrayUtil;
public class LocalityTests {
public static void main(String[] args) {
FDB fdb = FDB.selectAPIVersion(620);
FDB fdb = FDB.selectAPIVersion(700);
try(Database database = fdb.open(args[0])) {
try(Transaction tr = database.createTransaction()) {
String[] keyAddresses = LocalityUtil.getAddressesForKey(tr, "a".getBytes()).join();

View File

@ -43,7 +43,7 @@ public class ParallelRandomScan {
private static final int PARALLELISM_STEP = 5;
public static void main(String[] args) throws InterruptedException {
FDB api = FDB.selectAPIVersion(620);
FDB api = FDB.selectAPIVersion(700);
try(Database database = api.open(args[0])) {
for(int i = PARALLELISM_MIN; i <= PARALLELISM_MAX; i += PARALLELISM_STEP) {
runTest(database, i, ROWS, DURATION_MS);

View File

@ -34,7 +34,7 @@ import com.apple.foundationdb.Transaction;
import com.apple.foundationdb.async.AsyncIterable;
public class RangeTest {
private static final int API_VERSION = 620;
private static final int API_VERSION = 700;
public static void main(String[] args) {
System.out.println("About to use version " + API_VERSION);

View File

@ -34,7 +34,7 @@ public class SerialInsertion {
private static final int NODES = 1000000;
public static void main(String[] args) {
FDB api = FDB.selectAPIVersion(620);
FDB api = FDB.selectAPIVersion(700);
try(Database database = api.open()) {
long start = System.currentTimeMillis();

View File

@ -39,7 +39,7 @@ public class SerialIteration {
private static final int THREAD_COUNT = 1;
public static void main(String[] args) throws InterruptedException {
FDB api = FDB.selectAPIVersion(620);
FDB api = FDB.selectAPIVersion(700);
try(Database database = api.open(args[0])) {
for(int i = 1; i <= THREAD_COUNT; i++) {
runThreadedTest(database, i);

View File

@ -30,7 +30,7 @@ public class SerialTest {
public static void main(String[] args) throws InterruptedException {
final int reps = 1000;
try {
FDB fdb = FDB.selectAPIVersion(620);
FDB fdb = FDB.selectAPIVersion(700);
try(Database db = fdb.open()) {
runTests(reps, db);
}

View File

@ -39,7 +39,7 @@ public class SnapshotTransactionTest {
private static final Subspace SUBSPACE = new Subspace(Tuple.from("test", "conflict_ranges"));
public static void main(String[] args) {
FDB fdb = FDB.selectAPIVersion(620);
FDB fdb = FDB.selectAPIVersion(700);
try(Database db = fdb.open()) {
snapshotReadShouldNotConflict(db);
snapshotShouldNotAddConflictRange(db);

View File

@ -50,7 +50,7 @@ public class TupleTest {
public static void main(String[] args) throws NoSuchFieldException {
final int reps = 1000;
try {
FDB fdb = FDB.selectAPIVersion(620);
FDB fdb = FDB.selectAPIVersion(700);
addMethods();
comparisons();
emptyTuple();

View File

@ -32,7 +32,7 @@ import com.apple.foundationdb.tuple.Versionstamp;
public class VersionstampSmokeTest {
public static void main(String[] args) {
FDB fdb = FDB.selectAPIVersion(620);
FDB fdb = FDB.selectAPIVersion(700);
try(Database db = fdb.open()) {
db.run(tr -> {
tr.clear(Tuple.from("prefix").range());

View File

@ -34,7 +34,7 @@ import com.apple.foundationdb.Transaction;
public class WatchTest {
public static void main(String[] args) {
FDB fdb = FDB.selectAPIVersion(620);
FDB fdb = FDB.selectAPIVersion(700);
try(Database database = fdb.open(args[0])) {
database.options().setLocationCacheSize(42);
try(Transaction tr = database.createTransaction()) {

View File

@ -52,7 +52,7 @@ def get_api_version():
def api_version(ver):
header_version = 620
header_version = 700
if '_version' in globals():
if globals()['_version'] != ver:

View File

@ -22,7 +22,7 @@ import fdb
import sys
if __name__ == '__main__':
fdb.api_version(620)
fdb.api_version(700)
@fdb.transactional
def setValue(tr, key, value):

View File

@ -36,7 +36,7 @@ module FDB
end
end
def self.api_version(version)
header_version = 620
header_version = 700
if self.is_api_version_selected?()
if @@chosen_version != version
raise "FDB API already loaded at version #{@@chosen_version}."

View File

@ -1,7 +1,7 @@
#define FDB_API_VERSION 620
#define FDB_API_VERSION 700
#include <foundationdb/fdb_c.h>
int main(int argc, char* argv[]) {
fdb_select_api_version(620);
fdb_select_api_version(700);
return 0;
}

View File

@ -65,7 +65,7 @@ then
python setup.py install
successOr "Installing python bindings failed"
popd
python -c 'import fdb; fdb.api_version(620)'
python -c 'import fdb; fdb.api_version(700)'
successOr "Loading python bindings failed"
# Test cmake and pkg-config integration: https://github.com/apple/foundationdb/issues/1483

View File

@ -199,6 +199,10 @@ else()
endif()
if (CLANG)
add_compile_options()
# Clang has link errors unless `atomic` is specifically requested.
if(NOT APPLE)
add_link_options(-latomic)
endif()
if (APPLE OR USE_LIBCXX)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++>)
add_compile_definitions(WITH_LIBCXX)

View File

@ -1,3 +1,24 @@
#!/usr/bin/env python3
#
# transaction_profiling_analyzer.py
#
# This source file is part of the FoundationDB open source project
#
# Copyright 2013-2020 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.
#
"""
Requirements:
python3

View File

@ -0,0 +1,126 @@
#!/usr/bin/env python3
#
# transaction_profiling_analyzer_tests.py
#
# This source file is part of the FoundationDB open source project
#
# Copyright 2013-2020 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.
#
from transaction_profiling_analyzer import RangeCounter
from sortedcontainers import SortedDict
import random
import string
import unittest
class RangeCounterTest(unittest.TestCase):
def test_one_range(self):
rc = RangeCounter(1)
rc._insert_range("a", "b")
assert rc.ranges == SortedDict({"a": ("b", 1)}), rc.ranges
def test_two_non_overlapping_desc(self):
rc = RangeCounter(1)
rc._insert_range("c", "d")
rc._insert_range("a", "b")
assert rc.ranges == SortedDict({"a": ("b", 1), "c": ("d", 1)}), rc.ranges
def test_two_non_overlapping_asc(self):
rc = RangeCounter(1)
rc._insert_range("a", "b")
rc._insert_range("c", "d")
assert rc.ranges == SortedDict({"a": ("b", 1), "c": ("d", 1)}), rc.ranges
def test_two_touching(self):
rc = RangeCounter(1)
rc._insert_range("a", "b")
rc._insert_range("b", "c")
assert rc.ranges == SortedDict({"a": ("b", 1), "b": ("c", 1)}), rc.ranges
assert rc.get_count_for_key('a') == 1
assert rc.get_count_for_key('b') == 1
assert rc.get_count_for_key('c') == 0
def test_two_duplicates(self):
rc = RangeCounter(1)
rc._insert_range("a", "b")
rc._insert_range("a", "b")
assert rc.ranges == SortedDict({"a": ("b", 2)}), rc.ranges
def test_wholly_outside(self):
rc = RangeCounter(1)
rc._insert_range("b", "c")
rc._insert_range("a", "d")
assert rc.ranges == SortedDict({"a": ("b", 1), "b": ("c", 2), "c": ("d", 1)}), rc.ranges
def test_wholly_inside(self):
rc = RangeCounter(1)
rc._insert_range("a", "d")
rc._insert_range("b", "c")
assert rc.ranges == SortedDict({"a": ("b", 1), "b": ("c", 2), "c": ("d", 1)}), rc.ranges
def test_intersect_before(self):
rc = RangeCounter(1)
rc._insert_range("b", "d")
rc._insert_range("a", "c")
assert rc.ranges == SortedDict({"a": ("b", 1), "b": ("c", 2), "c": ("d", 1)}), rc.ranges
def test_intersect_after(self):
rc = RangeCounter(1)
rc._insert_range("a", "c")
rc._insert_range("b", "d")
assert rc.ranges == SortedDict({"a": ("b", 1), "b": ("c", 2), "c": ("d", 1)}), rc.ranges
def test_wide(self):
rc = RangeCounter(1)
rc._insert_range("a", "c")
rc._insert_range("e", "g")
rc._insert_range("i", "k")
rc._insert_range("b", "j")
assert rc.ranges == SortedDict({"a": ("b", 1), "b": ("c", 2), "c": ("e", 1), "e": ("g", 2), "g": ("i", 1), "i": ("j", 2), "j": ("k", 1)}), rc.ranges
def test_random(self):
letters = string.ascii_lowercase
for _ in range(0, 100):
rc = RangeCounter(1)
count_dict = {}
def test_correct():
for (k, v) in count_dict.items():
rc_count = rc.get_count_for_key(k)
assert rc_count == v, "Counts for %s mismatch. Expected %d got %d" % (k, v, rc_count)
for _ in range(0, 100):
i = random.randint(0, len(letters)-1)
j = random.randint(0, len(letters)-2)
if i == j:
j += 1
start_index = min(i, j)
end_index = max(i, j)
start_key = letters[start_index]
end_key = letters[end_index]
rc._insert_range(start_key, end_key)
for letter in letters[start_index:end_index]:
if letter not in count_dict:
count_dict[letter] = 0
count_dict[letter] = count_dict[letter] + 1
test_correct()
if __name__ == "__main__":
unittest.main() # run all tests

View File

@ -7,7 +7,7 @@ docprereqs:
ln -s . sphinx/.out/html/documentation
docpreview: docprereqs
@( cd sphinx/.out/html && ! grep FIXME * && python -m SimpleHTTPServer $$((0x$$(echo ${USER} | $(MD5SUM) | awk '{print $$1}' | cut -c1-8)%8000+8000)) )
@( cd sphinx/.out/html && ! grep FIXME * && python3 -m http.server $$((0x$$(echo ${USER} | $(MD5SUM) | awk '{print $$1}' | cut -c1-8)%8000+8000)) )
docpreview_clean:
$(MAKE) -C sphinx clean

View File

@ -1,4 +1,5 @@
--index-url https://pypi.python.org/simple
setuptools>=20.10.0
sphinx==1.5.6
sphinx-bootstrap-theme==0.4.8
pygments-style-solarized
pygments-style-solarized

View File

@ -634,6 +634,8 @@ To upgrade a FoundationDB cluster, you must install the updated version of Found
.. warning:: |development-use-only-warning|
.. note:: For information about upgrading client application code to newer API versions, see the :doc:`api-version-upgrade-guide`.
Install updated client binaries
-------------------------------

View File

@ -135,7 +135,7 @@ API versioning
Prior to including ``fdb_c.h``, you must define the ``FDB_API_VERSION`` macro. This, together with the :func:`fdb_select_api_version()` function, allows programs written against an older version of the API to compile and run with newer versions of the C library. The current version of the FoundationDB C API is |api-version|. ::
#define FDB_API_VERSION 620
#define FDB_API_VERSION 700
#include <foundationdb/fdb_c.h>
.. function:: fdb_error_t fdb_select_api_version(int version)

View File

@ -150,7 +150,7 @@
.. |atomic-versionstamps-tuple-warning-value| replace::
At this time, versionstamped values are not compatible with the Tuple layer except in Java, Python, and Go. Note that this implies versionstamped values may not be used with the Subspace and Directory layers except in those languages.
.. |api-version| replace:: 620
.. |api-version| replace:: 700
.. |streaming-mode-blurb1| replace::
When using |get-range-func| and similar interfaces, API clients can request large ranges of the database to iterate over. Making such a request doesn't necessarily mean that the client will consume all of the data in the range - sometimes the client doesn't know how far it intends to iterate in advance. FoundationDB tries to balance latency and bandwidth by requesting data for iteration in batches.

View File

@ -11,6 +11,8 @@ Versioning
FoundationDB supports a robust versioning system for both its API and binaries. This system allows clusters to be upgraded with minimal changes to both application code and FoundationDB binaries. The API and the FoundationDB binaries are each released in numbered versions. Each version of the binaries has a corresponding API version.
.. _api-versions:
API versions
------------

View File

@ -102,7 +102,7 @@ When you import the ``fdb`` module, it exposes only one useful symbol:
.. warning:: |api-version-multi-version-warning|
For API changes between version 13 and |api-version| (for the purpose of porting older programs), see :doc:`release-notes`.
For API changes between version 13 and |api-version| (for the purpose of porting older programs), see :doc:`release-notes` and :doc:`api-version-upgrade-guide`.
Opening a database
==================
@ -110,7 +110,7 @@ Opening a database
After importing the ``fdb`` module and selecting an API version, you probably want to open a :class:`Database` using :func:`open`::
import fdb
fdb.api_version(620)
fdb.api_version(700)
db = fdb.open()
.. function:: open( cluster_file=None, event_model=None )

View File

@ -87,7 +87,7 @@ When you require the ``FDB`` gem, it exposes only one useful method:
.. warning:: |api-version-multi-version-warning|
For API changes between version 14 and |api-version| (for the purpose of porting older programs), see :doc:`release-notes`.
For API changes between version 14 and |api-version| (for the purpose of porting older programs), see :doc:`release-notes` and :doc:`api-version-upgrade-guide`.
Opening a database
==================
@ -95,7 +95,7 @@ Opening a database
After requiring the ``FDB`` gem and selecting an API version, you probably want to open a :class:`Database` using :func:`open`::
require 'fdb'
FDB.api_version 620
FDB.api_version 700
db = FDB.open
.. function:: open( cluster_file=nil ) -> Database

View File

@ -0,0 +1,226 @@
#########################
API Version Upgrade Guide
#########################
Overview
========
This document provides an overview of changes that an application developer may need to make or effects that they should consider when upgrading the API version in their code. For each version, a list is provided that details the relevant changes when upgrading to that version from a prior version. To upgrade across multiple versions, make sure you apply changes from each version starting after your start version up to and including your target version.
For more details about API versions, see :ref:`api-versions`.
.. _api-version-upgrade-guide-700:
API version 700
===============
C bindings
----------
* The ``FDBKeyValue`` struct's ``key`` and ``value`` members have changed type from ``void*`` to ``uint8_t*``.
.. _api-version-upgrade-guide-620:
API version 620
===============
C bindings
----------
* ``fdb_future_get_version`` has been renamed to ``fdb_future_get_int64``.
.. _api-version-upgrade-guide-610:
API version 610
===============
General
-------
* The concept of opening a cluster has been removed from the API. Instead, databases are opened directly. See binding specific notes for the details as they apply to your language binding.
* The ``TIMEOUT``, ``MAX_RETRY_DELAY``, and ``RETRY_LIMIT`` transaction options are no longer reset by calls to ``onError``.
* Calling ``onError`` with a non-retryable error will now put a transaction into an error state. Previously, this would partially reset the transaction.
* The ``TRANSACTION_LOGGING_ENABLE`` option has been deprecated. Its behavior can be replicated by setting the ``DEBUG_TRANSACTION_IDENTIFIER`` and ``LOG_TRANSACTION`` options.
C bindings
----------
* Creating a database is now done by calling ``fdb_create_database``, which is a synchronous operation.
* The ``FDBCluster`` type has been eliminated and the following functions have been removed: ``fdb_create_cluster``, ``fdb_cluster_create_database``, ``fdb_cluster_set_option``, ``fdb_cluster_destroy``, ``fdb_future_get_cluster``, and ``fdb_future_get_database``.
Python bindings
---------------
* ``fdb.open`` no longer accepts a ``database_name`` parameter.
* Removed ``fdb.init``, ``fdb.create_cluster``, and ``fdb.Cluster``. ``fdb.open`` should be used instead.
Java bindings
-------------
* ``FDB.createCluster`` and the ``Cluster`` class have been deprecated. ``FDB.open`` should be used instead.
Ruby bindings
-------------
* ``FDB.open`` no longer accepts a ``database_name`` parameter.
* Removed ``FDB.init``, ``FDB.create_cluster``, and ``FDB.Cluster``. ``FDB.open`` should be used instead.
Go bindings
-----------
* Added ``fdb.OpenDatabase`` and ``fdb.MustOpenDatabase`` to open a connection to the database by specifying a cluster file.
* Deprecated ``fdb.StartNetwork``, ``fdb.Open``, ``fdb.MustOpen``, and ``fdb.CreateCluster``. ``fdb.OpenDatabase`` or ``fdb.OpenDefault`` should be used instead.
.. _api-version-upgrade-guide-600:
API version 600
===============
General
-------
* The ``TLS_PLUGIN`` option is now a no-op and has been deprecated. TLS support is now included in the published binaries.
.. _api-version-upgrade-guide-520:
API version 520
===============
General
-------
* The ``SET_VERSIONSTAMPED_KEY`` atomic operation now uses four bytes instead of two to specify the versionstamp offset.
* The ``SET_VERSIONSTAMPED_VALUE`` atomic operation now requires a four byte versionstamp offset to be specified at the end of the value, similar to the behavior with ``SET_VERSIONSTAMPED_KEY``.
* The ``READ_AHEAD_DISABLE`` option has been deprecated.
Java and Python bindings
------------------------
* Tuples packed with versionstamps will be encoded with four byte offsets instead of two.
.. _api-version-upgrade-guide-510:
API version 510
===============
General
-------
* The atomic operations ``AND`` and ``MIN`` have changed behavior when used on a key that isn't present in the database. Previously, these operations would set an unset key to a value of equal length with the specified value but containing all null bytes (0x00). Now, an unset key will be set with the value passed to the operation (equivalent to a set).
Java bindings
-------------
* Note: the Java bindings as of 5.1 no longer support API versions older that 510.
* The Java bindings have moved packages from ``com.apple.cie.foundationdb`` to ``com.apple.foundationdb``.
* The version of the Java bindings using our custom futures library has been deprecated and is no longer being maintained. The Java bindings using ``CompletableFuture`` are the only ones that remain.
* Finalizers now log a warning to ``stderr`` if an object with native resources is not closed. This can be disabled by calling ``FDB.setUnclosedWarning()``.
* Implementers of the ``Disposable`` interface now implement ``AutoCloseable`` instead, with ``close()`` replacing ``dispose()``.
* ``AutoCloseable`` objects will continue to be closed in object finalizers, but this behavior is being deprecated. All ``AutoCloseable`` objects should be explicitly closed.
* ``AsyncIterator`` is no longer closeable.
* ``getBoundaryKeys()`` now returns a ``CloseableAsyncIterable`` rather than an ``AsyncIterator``.
.. _api-version-upgrade-guide-500:
API version 500
===============
Java bindings
-------------
* Note: the Java bindings as of 5.0 no longer support API versions older than 500.
* ``FDB.open`` and ``Cluster.openDatabase`` no longer take a DB name parameter.
* ``Transaction.onError`` invalidates its transaction and asynchronously return a new replacement ``Transaction``.
* ``Transaction.reset`` has been removed.
.. _api-version-upgrade-guide-460:
API version 460
===============
There are no behavior changes in this API version.
.. _api-version-upgrade-guide-450:
API version 450
===============
There are no behavior changes in this API version.
.. _api-version-upgrade-guide-440:
API version 440
===============
There are no behavior changes in this API version.
.. _api-version-upgrade-guide-430:
API version 430
===============
There are no behavior changes in this API version.
.. _api-version-upgrade-guide-420:
API version 420
===============
There are no behavior changes in this API version.
.. _api-version-upgrade-guide-410:
API version 410
===============
General
-------
* Transactions no longer reset after a successful commit.
.. _api-version-upgrade-guide-400:
API version 400
===============
Java bindings
-------------
* The Java bindings have moved packages from ``com.foundationdb`` to ``com.apple.cie.foundationdb``.
.. _api-version-upgrade-guide-300:
API version 300
===============
General
-------
* Snapshot reads now see the effects of prior writes within the same transaction. The previous behavior can be achieved using the ``SNAPSHOT_RYW_DISABLE`` transaction option.
* The transaction size limit now includes the size of conflict ranges in its calculation. The size of a conflict range is the sum of the lengths of its begin and end keys.
* Adding conflict ranges or watches in the system keyspace (beginning with ``\xFF``) now requires setting the ``READ_SYSTEM_KEYS`` or ``ACCESS_SYSTEM_KEYS`` option.
.. _api-version-upgrade-guide-200:
API version 200
===============
General
-------
* Read version requests will now fail when the transaction is reset or has experienced another error.
.. _api-version-upgrade-guide-100:
API version 100
===============
Java bindings
-------------
* ``Transaction.clearRangeStartsWith`` has been deprecated. ``Transaction.clear(Range)`` should be used instead.
Older API versions
==================
API versions from the beta and alpha releases of Foundationdb (pre-100) are not documented here. See :doc:`old-release-notes/release-notes-023` for details about changes in those releases.

View File

@ -29,7 +29,7 @@ Before using the API, we need to specify the API version. This allows programs t
.. code-block:: go
fdb.MustAPIVersion(620)
fdb.MustAPIVersion(700)
Next, we open a FoundationDB database. The API will connect to the FoundationDB cluster indicated by the :ref:`default cluster file <default-cluster-file>`.
@ -78,7 +78,7 @@ If this is all working, it looks like we are ready to start building a real appl
func main() {
// Different API versions may expose different runtime behaviors.
fdb.MustAPIVersion(620)
fdb.MustAPIVersion(700)
// Open the default database from the system cluster
db := fdb.MustOpenDefault()
@ -229,7 +229,7 @@ Furthermore, this version can only be called with a ``Database``, making it impo
Note that by default, the operation will be retried an infinite number of times and the transaction will never time out. It is therefore recommended that the client choose a default transaction retry limit or timeout value that is suitable for their application. This can be set either at the transaction level using the ``SetRetryLimit`` or ``SetTimeout`` transaction options or at the database level with the ``SetTransactionRetryLimit`` or ``SetTransactionTimeout`` database options. For example, one can set a one minute timeout on each transaction and a default retry limit of 100 by calling::
db.Options().SetTransactionTimeout(60000) // 60,000 ms = 1 minute
db.Options().SetRetryLimit(100)
db.Options().SetTransactionRetryLimit(100)
Making some sample classes
--------------------------
@ -666,7 +666,7 @@ Here's the code for the scheduling tutorial:
}
func main() {
fdb.MustAPIVersion(620)
fdb.MustAPIVersion(700)
db := fdb.MustOpenDefault()
db.Options().SetTransactionTimeout(60000) // 60,000 ms = 1 minute
db.Options().SetTransactionRetryLimit(100)

View File

@ -30,7 +30,7 @@ Before using the API, we need to specify the API version. This allows programs t
private static final Database db;
static {
fdb = FDB.selectAPIVersion(620);
fdb = FDB.selectAPIVersion(700);
db = fdb.open();
}
@ -66,7 +66,7 @@ If this is all working, it looks like we are ready to start building a real appl
private static final Database db;
static {
fdb = FDB.selectAPIVersion(620);
fdb = FDB.selectAPIVersion(700);
db = fdb.open();
}
@ -157,7 +157,7 @@ If instead you pass a :class:`Transaction` for the :class:`TransactionContext` p
Note that by default, the operation will be retried an infinite number of times and the transaction will never time out. It is therefore recommended that the client choose a default transaction retry limit or timeout value that is suitable for their application. This can be set either at the transaction level using the ``setRetryLimit`` or ``setTimeout`` transaction options or at the database level with the ``setTransactionRetryLimit`` or ``setTransactionTimeout`` database options. For example, one can set a one minute timeout on each transaction and a default retry limit of 100 by calling::
db.options().setTransactionTimeout(60000); // 60,000 ms = 1 minute
db.options().setRetryLimit(100);
db.options().setTransactionRetryLimit(100);
Making some sample classes
--------------------------
@ -441,10 +441,10 @@ Here's the code for the scheduling tutorial:
private static final Database db;
static {
fdb = FDB.selectAPIVersion(620);
fdb = FDB.selectAPIVersion(700);
db = fdb.open();
db.options().setTransactionTimeout(60000); // 60,000 ms = 1 minute
db.options().setRetryLimit(100);
db.options().setTransactionRetryLimit(100);
}
// Generate 1,620 classes like '9:00 chem for dummies'

View File

@ -23,7 +23,7 @@ Open a Ruby interactive interpreter and import the FoundationDB API module::
Before using the API, we need to specify the API version. This allows programs to maintain compatibility even if the API is modified in future versions::
> FDB.api_version 620
> FDB.api_version 700
=> nil
Next, we open a FoundationDB database. The API will connect to the FoundationDB cluster indicated by the :ref:`default cluster file <default-cluster-file>`. ::
@ -46,7 +46,7 @@ If this is all working, it looks like we are ready to start building a real appl
.. code-block:: ruby
require 'fdb'
FDB.api_version 620
FDB.api_version 700
@db = FDB.open
@db['hello'] = 'world'
print 'hello ', @db['hello']
@ -126,7 +126,7 @@ If instead you pass a :class:`Transaction` for the ``db_or_tr`` parameter, the t
Note that by default, the operation will be retried an infinite number of times and the transaction will never time out. It is therefore recommended that the client choose a default transaction retry limit or timeout value that is suitable for their application. This can be set either at the transaction level using the ``set_retry_limit`` or ``set_timeout`` transaction options or at the database level with the ``set_transaction_retry_limit`` or ``set_transaction_timeout`` database options. For example, one can set a one minute timeout on each transaction and a default retry limit of 100 by calling::
@db.options.set_transaction_timeout(60000) # 60,000 ms = 1 minute
@db.options.set_retry_limit(100)
@db.options.set_transaction_retry_limit(100)
Making some sample classes
--------------------------
@ -373,7 +373,7 @@ Here's the code for the scheduling tutorial:
require 'fdb'
FDB.api_version 620
FDB.api_version 700
####################################
## Initialization ##

View File

@ -30,7 +30,7 @@ Open a Python interactive interpreter and import the FoundationDB API module::
Before using the API, we need to specify the API version. This allows programs to maintain compatibility even if the API is modified in future versions::
>>> fdb.api_version(620)
>>> fdb.api_version(700)
Next, we open a FoundationDB database. The API will connect to the FoundationDB cluster indicated by the :ref:`default cluster file <default-cluster-file>`. ::
@ -48,7 +48,7 @@ When this command returns without exception, the modification is durably stored
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"::
import fdb
fdb.api_version(620)
fdb.api_version(700)
db = fdb.open()
db[b'hello'] = b'world'
print 'hello', db[b'hello']
@ -91,7 +91,7 @@ FoundationDB includes a few tools that make it easy to model data using this app
opening a :ref:`directory <developer-guide-directories>` in the database::
import fdb
fdb.api_version(620)
fdb.api_version(700)
db = fdb.open()
scheduling = fdb.directory.create_or_open(db, ('scheduling',))
@ -136,7 +136,7 @@ If instead you pass a :class:`Transaction` for the ``tr`` parameter, the transac
Note that by default, the operation will be retried an infinite number of times and the transaction will never time out. It is therefore recommended that the client choose a default transaction retry limit or timeout value that is suitable for their application. This can be set either at the transaction level using the ``set_retry_limit`` or ``set_timeout`` transaction options or at the database level with the ``set_transaction_retry_limit`` or ``set_transaction_timeout`` database options. For example, one can set a one minute timeout on each transaction and a default retry limit of 100 by calling::
db.options.set_transaction_timeout(60000) # 60,000 ms = 1 minute
db.options.set_retry_limit(100)
db.options.set_transaction_retry_limit(100)
Making some sample classes
--------------------------
@ -337,7 +337,7 @@ Here's the code for the scheduling tutorial::
import fdb
import fdb.tuple
fdb.api_version(620)
fdb.api_version(700)
####################################
@ -350,7 +350,7 @@ Here's the code for the scheduling tutorial::
db = fdb.open()
db.options.set_transaction_timeout(60000) # 60,000 ms = 1 minute
db.options.set_retry_limit(100)
db.options.set_transaction_retry_limit(100)
scheduling = fdb.directory.create_or_open(db, ('scheduling',))
course = scheduling['class']
attends = scheduling['attends']

View File

@ -18,6 +18,8 @@ FoundationDB supports language bindings for application development using the or
* :doc:`api-general` contains information on FoundationDB clients applicable across all language bindings.
* :doc:`api-version-upgrade-guide` contains information about upgrading client code to a new API version.
* :doc:`known-limitations` describes both long-term design limitations of FoundationDB and short-term limitations applicable to the current version.
.. toctree::
@ -34,3 +36,4 @@ FoundationDB supports language bindings for application development using the or
client-testing
api-general
known-limitations
api-version-upgrade-guide

View File

@ -99,13 +99,13 @@ To write the equivalent code directly in C++, a developer would have to implemen
Caveats
=======
Even though flow-code looks a lot like C++, it is not. It has different rules and the files are preprocessed. It is always important to keep this in mind when programming flow.
Even though Flow code looks a lot like C++, it is not. It has different rules and the files are preprocessed. It is always important to keep this in mind when programming flow.
We still want to be able to use IDEs and modern editors (with language servers like cquery or clang-based completion engines like ycm). Because of this there is a header-file ``actorcompiler.h`` in flow which defines preprocessor definitions to make flow compile as normal C++ code. CMake even supports a special mode so that it doesn't preprocess flow files. This mode can be used by passing ``-DOPEN_FOR_IDE=ON`` to cmake. Additionally we generate a special ``compile_commands.json`` into the source-directory which will support opening the project in IDEs and editors that look for a compilation database.
Some preprocessor definitions will not fix all issues though. When programming flow the following things have to be taken care of by the programmer:
Some preprocessor definitions will not fix all issues though. When programming Flow the following things have to be taken care of by the programmer:
- Local variables don't survive a call to ``wait``. So this would be legal flow-code, but NOT legal C++-code:
- Local variables don't survive a call to ``wait``. So this would be legal Flow code, but NOT legal C++ code:
.. code-block:: c
@ -133,8 +133,8 @@ Some preprocessor definitions will not fix all issues though. When programming f
}
}
- An ``ACTOR`` is compiled into a class internally. Which means that within an actor-function, ``this`` is a valid pointer to this class. But using them explicitely (or as described later implicitely) will break IDE support. One can use ``THIS`` and ``THIS_ADDR`` instead. But be careful as ``THIS`` will be of type ``nullptr_t`` in IDE-mode and of the actor-type in normal compilation mode.
- Lambdas and state variables are weird in a sense. After actorcompilation a state variable is a member of the compiled actor class. In IDE mode it is considered a normal local variable. This can result in some surprising side-effects. So the following code will only compile if the method ``Foo::bar`` is defined as ``const``:
- An ``ACTOR`` is compiled into a class internally. Which means that within an actor-function, ``this`` is a valid pointer to this class. But using them explicitly (or as described later implicitly) will break IDE support. One can use ``THIS`` and ``THIS_ADDR`` instead. But be careful as ``THIS`` will be of type ``nullptr_t`` in IDE-mode and of the actor-type in normal compilation mode.
- Lambdas and state variables are weird in a sense. After actor compilation, a state variable is a member of the compiled actor class. In IDE mode it is considered a normal local variable. This can result in some surprising side-effects. So the following code will only compile if the method ``Foo::bar`` is defined as ``const``:
.. code-block:: c
@ -144,7 +144,7 @@ Some preprocessor definitions will not fix all issues though. When programming f
}
If it is not, one has to pass the member explictely as reference:
If it is not, one has to pass the member explicitly as a reference:
.. code-block:: c
@ -154,5 +154,5 @@ Some preprocessor definitions will not fix all issues though. When programming f
foo([x]() { x->bar(); })
}
- state variables in flow don't follow the normal scoping rules. So in flow a state variable can be defined in a inner scope and later it can be used in the outer scope. In order to not break compilation in IDE-mode, always define state variables in the outermost scope they will be used.
- state variables in Flow don't follow the normal scoping rules. So in Flow a state variable can be defined in an inner scope and later it can be used in the outer scope. In order to not break compilation in IDE-mode, always define state variables in the outermost scope they will be used.

View File

@ -69,7 +69,7 @@ Heres a basic implementation of the recipe.
private static final long EMPTY_ARRAY = -1;
static {
fdb = FDB.selectAPIVersion(620);
fdb = FDB.selectAPIVersion(700);
db = fdb.open();
docSpace = new Subspace(Tuple.from("D"));
}

View File

@ -20,7 +20,7 @@ The master is responsible for coordinating the transition of the write sub-syste
Proxies
=======
The proxies are responsible for providing read versions, committing transactions, and tracking the storage servers responsible for each range of keys. To provide a read version, a proxy will ask all other proxies to see the largest committed version at this point in time, while simultaneously checking that the transaction logs have not been stopped. Ratekeeper will artificially slow down the rate at which the proxy provides read versions.
The proxies are responsible for providing read versions, committing transactions, and tracking the storage servers responsible for each range of keys. To provide a read version, a proxy will ask all other proxies to see the largest committed version at this point in time, while simultaneously checking that the transaction logs have not been stopped. Ratekeeper will artificially slow down the rate at which the proxy provides read versions.
Commits are accomplished by:
@ -28,7 +28,7 @@ Commits are accomplished by:
* Use the resolvers to determine if the transaction conflicts with previously committed transactions.
* Make the transaction durable on the transaction logs.
The key space starting with the '\xff' byte is reserved for system metadata. All mutations committed into this key space are distributed to all of the proxies through the resolvers. This metadata includes a mapping between key ranges and the storage servers which have the data for that range of keys. The proxies provides this information to clients on-demand. The clients cache this mapping; if they ask a storage server for a key it does not have, they will clear their cache and get a more up-to-date list of servers from the proxies.
The key space starting with the '\xff' byte is reserved for system metadata. All mutations committed into this key space are distributed to all of the proxies through the resolvers. This metadata includes a mapping between key ranges and the storage servers which have the data for that range of keys. The proxies provide this information to clients on-demand. The clients cache this mapping; if they ask a storage server for a key it does not have, they will clear their cache and get a more up-to-date list of servers from the proxies.
Transaction Logs
================
@ -43,7 +43,7 @@ The resolvers are responsible determining conflicts between transactions. A tran
Storage Servers
===============
The vast majority of processes in a cluster are storage servers. Storage servers are assigned ranges of key, and are responsible to storing all of the data for that range. They keep 5 seconds of mutations in memory, and an on disk copy of the data as of 5 second ago. Clients must read at a version within the last 5 seconds, or they will get a transaction_too_old error. The ssd storage engine stores the data in a b-tree. The memory storage engine store the data in memory with an append only log that is only read from disk if the process is rebooted.
The vast majority of processes in a cluster are storage servers. Storage servers are assigned ranges of keys, and are responsible for storing all of the data for that range. They keep 5 seconds of mutations in memory, and an on disk copy of the data as of 5 second ago. Clients must read at a version within the last 5 seconds, or they will get a transaction_too_old error. The ssd storage engine stores the data in a b-tree. The memory storage engine stores the data in memory with an append only log that is only read from disk if the process is rebooted.
Clients
=======

View File

@ -74,7 +74,7 @@ Heres a simple implementation of multimaps with multisets as described:
private static final int N = 100;
static {
fdb = FDB.selectAPIVersion(620);
fdb = FDB.selectAPIVersion(700);
db = fdb.open();
multi = new Subspace(Tuple.from("M"));
}

View File

@ -1,12 +1,12 @@
#######################
Release Notes (Alpha 5)
#######################
#############
Release Notes
#############
FoundationDB Alpha 5
====================
Language support
-------------------------
----------------
* FoundationDB now supports :doc:`Ruby </api-ruby>`
@ -17,7 +17,8 @@ Language support
.. _alpha-5-rel-notes-features:
Features
------------
--------
* A new :doc:`backup </backups>` system allows scheduled backups of a snapshot of the FoundationDB database to an external filesystem.
* :doc:`Integrated HTML documentation </index>`

View File

@ -1,12 +1,12 @@
#######################
Release Notes (Alpha 6)
#######################
#############
Release Notes
#############
FoundationDB Alpha 6
====================
Platform support
-------------------------
----------------
* FoundationDB now supports both clients and development servers on :doc:`Mac OS X </getting-started-mac>`.
@ -15,7 +15,7 @@ Platform support
* All language APIs are supported on Linux, Mac, and Windows (except for Ruby on Windows, because there is not a 64-bit Ruby for Windows.)
Features
------------
--------
* The set of coordination servers can be safely :ref:`changed <configuration-changing-coordination-servers>` on-the-fly via the CLI.
@ -34,14 +34,14 @@ Features
* The database size estimate shown in the CLI status is much more accurate.
Performance
--------------
-----------
* Improved latency performance for intense workloads with range-read operations.
* Improved performance and decreased memory usage for certain intense write workloads targeting a small set of keys (such as sequential insert).
Fixes
--------
-----
* An incorrect result could be returned by a range read when: (1) The range start was specified using a non-default "less than" type key selector; and (2) the range read started at the beginning of the database; and (3) the transaction also included a prior write to a key less than the key of the begin key selector.
@ -61,7 +61,7 @@ Changes to all APIs
* Three new transaction options (:py:meth:`READ_AHEAD_DISABLE <fdb.Transaction.options.set_read_ahead_disable>`, :py:meth:`READ_YOUR_WRITES_DISABLE <fdb.Transaction.options.set_read_your_writes_disable>`, and :py:meth:`ACCESS_SYSTEM_KEYS <fdb.Transaction.options.set_access_system_keys>`) enable more control for advanced applications.
Changes to the Java API
------------------------
-----------------------
* A new construct `AsyncUtil.whileTrue() <../javadoc/com/apple/cie/foundationdb/async/AsyncUtil.html#whileTrue-com.apple.foundationdb.async.Function->`_ simplifies writing loops using the asynchronous version of the Java FDB client.

View File

@ -1,6 +1,6 @@
######################
Release Notes (Beta 1)
######################
#############
Release Notes
#############
Beta 1
======

View File

@ -1,6 +1,6 @@
######################
Release Notes (Beta 2)
######################
#############
Release Notes
#############
Beta 2
======

View File

@ -1,6 +1,6 @@
######################
Release Notes (Beta 3)
######################
#############
Release Notes
#############
Beta 3
======

View File

@ -1,6 +1,6 @@
###################
Release Notes (1.0)
###################
#############
Release Notes
#############
1.0.1
=====
@ -20,19 +20,23 @@ There are only minor technical differences between this release and the 0.3.0 re
Java
----
* ``clear(Range)`` replaces the now deprecated ``clearRangeStartsWith()``.
Python
------
* Windows installer supports Python 3.
Node and Ruby
-------------
* String option parameters are converted to UTF-8.
All
---
* API version changed to 100. Programs with lower versions continue to work.
* API version updated to 100. See the :ref:`API version upgrade guide <api-version-upgrade-guide-100>` for upgrade details.
* Runs on Mac OS X 10.7.
* Improvements to installation packages, including package paths and directory modes.
* Eliminated cases of excessive resource usage in the locality API.
@ -41,6 +45,7 @@ All
Fixes
-----
* A few Python API entry points failed to respect the ``as_foundationdb_key()`` convenience interface.
* ``fdbcli`` could print commit version numbers incorrectly in Windows.
* Multiple watches set on the same key were not correctly triggered by a subsequent write in the same transaction.

View File

@ -1,6 +1,6 @@
###################
Release Notes (2.0)
###################
#############
Release Notes
#############
2.0.10
======
@ -49,12 +49,14 @@ Fixes
PHP
---
* Package updated to support PHP 5.4+ (instead of 5.3+).
* Fix: ``get_boundary_keys()`` could fail to complete successfully if certain retryable errors were encountered.
* Fix: Bindings set error reporting level, which could interfere with clients that used alternate settings.
Java
----
* Fix: Calling ``getRange`` on a ``Transaction`` could leak memory.
2.0.7
@ -110,10 +112,12 @@ Release 2.0.5 is protocol-compatible with 2.0.0, 2.0.1, 2.0.2, 2.0.3, and 2.0.4.
Fixes
-----
* Clients and servers that specified a cluster file as a filename only (without path) could crash when the coordinators were changed.
PHP
---
* Directory layer partitions created with the PHP bindings were incompatible with other language bindings. Contact us if you have data stored in a directory partition created by PHP that can't easily be restored and needs to be migrated.
2.0.4
@ -123,11 +127,13 @@ Release 2.0.4 is protocol-compatible with 2.0.0, 2.0.1, 2.0.2, and 2.0.3. Users
Fixes
-----
* Clearing a key larger than the legal limit of 10 kB caused the database to crash and become unreadable.
* Explicitly added write conflict ranges were ignored when read-your-writes was disabled.
Java
----
* ``ByteArrayUtil.compareUnsigned()`` failed to return in some circumstances.
2.0.3
@ -137,6 +143,7 @@ Release 2.0.3 is protocol-compatible with 2.0.0, 2.0.1, and 2.0.2. There are no
Fixes
-----
* Updated FDBGnuTLS plugin with GnuTLS 3.2.12, incorporating fixes for `GNUTLS-SA-2014-1 <http://gnutls.org/security.html#GNUTLS-SA-2014-1>`_ and `GNUTLS-SA-2014-2 <http://gnutls.org/security.html#GNUTLS-SA-2014-2>`_.
* When inserting a large number of keys close to the key size limit, server logs were unexpectedly verbose.
@ -147,6 +154,7 @@ Release 2.0.2 is protocol-compatible with 2.0.0 and 2.0.1. There are no updates
Fixes
-----
* Windows: Possible database corruption when the FoundationDB service is stopped but unable to kill its child processes.
2.0.1
@ -156,6 +164,7 @@ Release 2.0.1 is protocol-compatible with 2.0.0. There are no updates to the lan
Fixes
-----
* In some cases, a server reincluded after previous exclusion would not participate in data distribution.
* Clients could not reliably connect to multiple clusters.
* The calculation of usable disk space on Linux and Mac OS X improperly included space reserved for superuser.
@ -165,24 +174,29 @@ Fixes
New language support
--------------------
* `Go <../godoc/fdb.html>`_
* PHP
New layers available in all languages
-------------------------------------
* The :ref:`Subspace <developer-guide-sub-keyspaces>` layer provides a recommended way to define subspaces of keys by managing key prefixes.
* The :ref:`Directory <developer-guide-directories>` layer provides a tool to manage related subspaces as virtual directories. Recommended as a convenient and high-performance way to organize and layout different kinds of data within a single FoundationDB database.
Security
--------
* Added certificate-based :doc:`Transport Layer Security </tls>` to encrypt network traffic.
Monitoring
----------
* The ``fdbcli`` command-line interface reports information and warnings about available memory.
Performance
-----------
* Improved client CPU performance overall.
* Greatly improved client CPU performance for range-read operations.
* Greatly improved concurrency when issuing writes between reads.
@ -192,6 +206,7 @@ Performance
Fixes
-----
* In rare cases when many keys very close to the maximum key size are inserted, the database could become unavailable.
* ``GetReadVersion`` did not properly throw ``transaction_cancelled`` when called on a transaction that had been cancelled.
* When using the ``access_system_keys`` option, a ``get_range_startswith(\xff)`` would incorrectly return no results.
@ -204,14 +219,20 @@ Fixes
Other changes
-------------
* To avoid confusing situations, any use of a transaction that is currently committing will cause both the commit and the use to throw a ``used_during_commit`` error.
* The ``FDB_CLUSTER_FILE`` environment variable can point to a cluster file that takes precedence over both the current working directory and (e.g., in Linux) ``/etc/foundationdb/fdb.cluster``.
* Disabled unloading the ``fdb_c`` library to prevent consequent unavoidable race conditions.
* Discontinued testing and support for Ubuntu 11.04. We continue to support Ubuntu 11.10 and later.
Bindings
--------
* API version updated to 200. See the :ref:`API version upgrade guide <api-version-upgrade-guide-200>` for upgrade details.
Java
----
* Support for API version 200 and backwards compatibility with previous API versions.
* New APIs for allocating and managing keyspace (:ref:`Directory <developer-guide-directories>`).
* In most cases, exceptions thrown in synchronous-style Java programs will have the original calling line of code in the backtrace.
* Native resources are handled in a safer and more efficient manner.
@ -221,7 +242,7 @@ Java
Node
----
* Support for API version 200 and backwards compatibility with previous API versions.
* New APIs for allocating and managing keyspace (:ref:`Directory <developer-guide-directories>`).
* Support for the Promise/A+ specification with supporting utilities.
* Futures can take multiple callbacks. Callbacks can be added if the original function was called with a callback. The Future type is exposed in our binding.
@ -235,7 +256,7 @@ Node
Ruby
----
* Support for API version 200 and backwards compatibility with previous API versions.
* New APIs for allocating and managing keyspace (:ref:`Directory <developer-guide-directories>`).
* Tuple and subspace range assume the empty tuple if none is passed.
* Added ``as_foundationdb_key`` and ``as_foundationdb_value`` support.
@ -245,7 +266,7 @@ Ruby
Python
------
* Support for API version 200 and backwards compatibility with previous API versions.
* New APIs for allocating and managing keyspace (:ref:`Directory <developer-guide-directories>`).
* Snapshot transactions can be used in retry loops.
* Support for gevent 1.0.
@ -255,15 +276,14 @@ Python
C
-
* Support for API version 200 and backwards compatibility with previous API versions.
.NET
----
* Support for API version 200 and backwards compatibility with previous API versions.
* New APIs for allocating and managing keyspace (:ref:`Directory <developer-guide-directories>`).
Earlier release notes
---------------------
* :doc:`1.0 (API Version 100) <release-notes-100>`

View File

@ -1,6 +1,6 @@
###################
Release Notes (3.0)
###################
#############
Release Notes
#############
3.0.8
=====
@ -13,6 +13,7 @@ Release 3.0.8 is protocol-compatible with all prior 3.0.x releases. All users sh
Fixes
-----
* Backup: the backup agent could crash in some circumstances, preventing a backup from completing.
* Linux: On some systems, disk space usage tracking could be inaccurate.
* In rare cases, range reading could get stuck in an infinite past_version loop.
@ -20,6 +21,7 @@ Fixes
Java
----
* Fix: getBoundaryKeys could throw a NullPointerException.
3.0.7
@ -32,6 +34,7 @@ Release 3.0.7 is protocol-compatible with all prior 3.0.x releases. All users sh
Fixes
-----
* ``fdbcli`` would segmentation fault if there was a semicolon after a quoted string.
* :ref:`Atomic operations <api-python-transaction-atomic-operations>` performed on keys that had been :ref:`snapshot read <api-python-snapshot-reads>` would be converted into a set operation.
* Reading a key to which an atomic operation had already been applied would cause the read to behave as a snapshot read.
@ -40,6 +43,7 @@ Fixes
Ruby
----
* Fix: ``FDB`` objects could not be garbage collected.
3.0.6
@ -51,16 +55,19 @@ Release 3.0.6 is protocol-compatible with all prior 3.0.x releases. All users sh
Fixes
-----
* Read-latency probes for status incorrectly returned zero.
* Commit-latency probe for status included the time to acquire its read version.
* Client and server could crash when experiencing problems with network connections.
Node.js
-------
* Fix: npm source package did not compile on Mac OS X 10.9 or newer.
Windows
-------
* Added registry key during installation.
3.0.5
@ -72,6 +79,7 @@ Release 3.0.5 is protocol-compatible with all prior 3.0.x releases. This release
Fixes
-----
* Windows: fix Visual Studio 2013 code generation bug on older processors or versions of Windows that don't support the AVX instruction set (see https://connect.microsoft.com/VisualStudio/feedback/details/811093).
3.0.4
@ -83,6 +91,7 @@ Release 3.0.4 is protocol-compatible with all prior 3.0.x releases. Users should
Fixes
-----
* Mac OS X: backup agent used 100% CPU even when idle.
* Backups were inoperative on databases with greater than 32-bit versions.
* Backup agents were not started on Windows.
@ -92,6 +101,7 @@ Fixes
Node.js
-------
* Fixed a compilation problem on Linux and Mac OS X as distributed on ``npm``. (Note: The corrected binding is distributed as version 3.0.3.)
3.0.2
@ -131,7 +141,7 @@ Fixes
Client
------
* Support for API version 300 and backwards compatible with previous API versions.
* API version updated to 300. See the :ref:`API version upgrade guide <api-version-upgrade-guide-300>` for upgrade details.
* By default, :ref:`snapshot reads <snapshot isolation>` see writes within the same transaction. The previous behavior can be achieved using transaction options.
* The :ref:`transaction size limit <large-transactions>` includes conflict ranges.
* Explicitly added read or write :ref:`conflict ranges <api-python-conflict-ranges>` and :ref:`watches <api-python-watches>` for keys that begin with ``\xFF`` require one of the transaction options ``access_system_keys`` or ``read_system_keys`` to be set.
@ -150,6 +160,7 @@ Java
Node.js
-------
* Fix: ``fdb.open``, ``fdb.createCluster``, and ``cluster.openDatabase`` didn't use the callback in API versions 22 or lower.
* Tuple performance is improved.

View File

@ -1,6 +1,6 @@
###################
Release Notes (4.0)
###################
#############
Release Notes
#############
4.0.2
=====
@ -41,6 +41,11 @@ Fixes
* It was not safe to allocate multiple directories concurrently in the same transaction in the directory layer.
Bindings
--------
* API version updated to 400. See the :ref:`API version upgrade guide <api-version-upgrade-guide-400>` for upgrade details.
Java
----

View File

@ -1,6 +1,6 @@
###################
Release Notes (4.1)
###################
#############
Release Notes
#############
4.1.1
=====
@ -40,6 +40,11 @@ Fixes
* A rare scenario could cause a crash when a master is recovering metadata from the previous generation of logs.
* Streaming mode ``EXACT`` was ignoring the ``target_bytes`` parameter.
Bindings
--------
* API version updated to 410. See the :ref:`API version upgrade guide <api-version-upgrade-guide-410>` for upgrade details.
Earlier release notes
---------------------
* :doc:`4.0 (API Version 400) <release-notes-400>`

View File

@ -1,6 +1,6 @@
###################
Release Notes (4.2)
###################
#############
Release Notes
#############
4.2.1
=====
@ -21,6 +21,11 @@ Features
* Information on the versions of connected clients has been added to :doc:`Machine-Readable Status </mr-status>`.
* Information on the status of running backups has been added to :doc:`Machine-Readable Status </mr-status>`.
Bindings
--------
* API version updated to 420. There are no behavior changes in this API version. See the :ref:`API version upgrade guide <api-version-upgrade-guide-420>` for upgrade details.
Earlier release notes
---------------------
* :doc:`4.1 (API Version 410) <release-notes-410>`

View File

@ -1,6 +1,6 @@
###################
Release Notes (4.3)
###################
#############
Release Notes
#############
4.3.0
=====
@ -22,6 +22,11 @@ Fixes
* Changed the blob restore read pattern to work around blob store issues.
* External clients do not load environment variable options.
Bindings
--------
* API version updated to 430. There are no behavior changes in this API version. See the :ref:`API version upgrade guide <api-version-upgrade-guide-430>` for upgrade details.
Earlier release notes
---------------------
* :doc:`4.2 (API Version 420) <release-notes-420>`

View File

@ -1,6 +1,6 @@
###################
Release Notes (4.4)
###################
#############
Release Notes
#############
4.4.2
=====
@ -44,6 +44,11 @@ Fixes
* DR errors were not being reported properly in DR status.
* Backup and DR layer status expiration and cleanup now use database read version instead of time. <rdar://problem/24805824>
Bindings
--------
* API version updated to 440. There are no behavior changes in this API version. See the :ref:`API version upgrade guide <api-version-upgrade-guide-440>` for upgrade details.
Java
----

View File

@ -1,6 +1,6 @@
###################
Release Notes (4.5)
###################
#############
Release Notes
#############
4.5.6
=====
@ -115,6 +115,7 @@ Backup
Bindings
--------
* API version updated to 450. There are no behavior changes in this API version. See the :ref:`API version upgrade guide <api-version-upgrade-guide-450>` for upgrade details.
* Add error predicate testing to client bindings. This new functionality should help complex use cases write correct transaction retry loops where dispatching on error classes is needed. <rdar://problem/24492860>
Other Changes

View File

@ -107,6 +107,11 @@ Fixes
* Java: fix race condition when removing an empty directory which could lead to a NoSuchElementException <rdar://problem/28858833>
* Fixed a source of potential crashes in fdbcli <rdar://problem/27063940>
Bindings
--------
* API version updated to 460. There are no behavior changes in this API version. See the :ref:`API version upgrade guide <api-version-upgrade-guide-460>` for upgrade details.
Status
------

View File

@ -141,7 +141,7 @@ Status
Bindings
--------
* API version updated to 500.
* API version updated to 500. See the :ref:`API version upgrade guide <api-version-upgrade-guide-500>` for upgrade details.
* Tuples now support single- and double-precision floating point numbers, UUIDs, booleans, and nested tuples. <rdar://problem/30053926>
* Add ``TRANSACTION_LOGGING_ENABLE`` transaction option that causes the details of a transaction's operations to be logged to the client trace logs. <rdar://problem/32074484>
* Add ``USED_DURING_COMMIT_PROTECTION_DISABLE`` transaction option that prevents operations performed during that transaction's commit from causing the commit to fail. <rdar://problem/30378251>

View File

@ -159,7 +159,7 @@ Status
Bindings
--------
* API version updated to 510.
* API version updated to 510. See the :ref:`API version upgrade guide <api-version-upgrade-guide-510>` for upgrade details.
* Add versionstamp support to the Tuple layer in Java and Python. <rdar://problem/25560444>
Java

View File

@ -85,7 +85,7 @@ Status
Bindings
--------
* API version updated to 520.
* API version updated to 520. See the :ref:`API version upgrade guide <api-version-upgrade-guide-520>` for upgrade details.
* Java and Python: Versionstamp packing methods within tuple class now add four bytes for the offset instead of two if the API version is set to 520 or higher. `(Issue #148) <https://github.com/apple/foundationdb/issues/148>`_
* Added convenience methods to determine if an API version has been set. `(PR #72) <https://github.com/apple/foundationdb/pull/72>`_
* Go: Reduce memory allocations when packing tuples. `(PR #278) <https://github.com/apple/foundationdb/pull/278>`_

View File

@ -139,7 +139,7 @@ Status
Bindings
--------
* API version updated to 600. There are no changes since API version 520.
* API version updated to 600. See the :ref:`API version upgrade guide <api-version-upgrade-guide-600>` for upgrade details.
* Several cases where functions in go might previously cause a panic now return a non-``nil`` error. `(PR #532) <https://github.com/apple/foundationdb/pull/532>`_
* C API calls made on the network thread could be reordered with calls made from other threads. [6.0.2] `(Issue #518) <https://github.com/apple/foundationdb/issues/518>`_
* The TLS_PLUGIN option is now a no-op and has been deprecated. [6.0.10] `(PR #710) <https://github.com/apple/foundationdb/pull/710>`_

View File

@ -134,7 +134,7 @@ Status
Bindings
--------
* API version updated to 610.
* API version updated to 610. See the :ref:`API version upgrade guide <api-version-upgrade-guide-610>` for upgrade details.
* The API to create a database has been simplified across the bindings. All changes are backward compatible with previous API versions, with one exception in Java noted below. `(PR #942) <https://github.com/apple/foundationdb/pull/942>`_
* C: ``FDBCluster`` objects and related methods (``fdb_create_cluster``, ``fdb_cluster_create_database``, ``fdb_cluster_set_option``, ``fdb_cluster_destroy``, ``fdb_future_get_cluster``) have been removed. `(PR #942) <https://github.com/apple/foundationdb/pull/942>`_
* C: Added ``fdb_create_database`` that creates a new ``FDBDatabase`` object synchronously and removed ``fdb_future_get_database``. `(PR #942) <https://github.com/apple/foundationdb/pull/942>`_

View File

@ -168,6 +168,7 @@ Status
Bindings
--------
* API version updated to 620. See the :ref:`API version upgrade guide <api-version-upgrade-guide-620>` for upgrade details.
* Add a transaction size limit as both a database option and a transaction option. `(PR #1725) <https://github.com/apple/foundationdb/pull/1725>`_.
* Added a new API to get the approximated transaction size before commit, e.g., ``fdb_transaction_get_approximate_size`` in the C binding. `(PR #1756) <https://github.com/apple/foundationdb/pull/1756>`_.
* C: ``fdb_future_get_version`` has been renamed to ``fdb_future_get_int64``. `(PR #1756) <https://github.com/apple/foundationdb/pull/1756>`_.
@ -244,4 +245,4 @@ Earlier release notes
* :doc:`Beta 2 (API Version 22) </old-release-notes/release-notes-022>`
* :doc:`Beta 1 (API Version 21) </old-release-notes/release-notes-021>`
* :doc:`Alpha 6 (API Version 16) </old-release-notes/release-notes-016>`
* :doc:`Alpha 5 (API Version 14) </old-release-notes/release-notes-014>`
* :doc:`Alpha 5 (API Version 14) </old-release-notes/release-notes-014>`

View File

@ -74,7 +74,7 @@ Here's a basic implementation of the model:
private static final Random randno;
static{
fdb = FDB.selectAPIVersion(620);
fdb = FDB.selectAPIVersion(700);
db = fdb.open();
pq = new Subspace(Tuple.from("P"));

View File

@ -73,7 +73,7 @@ The following is a simple implementation of the basic pattern:
private static final Random randno;
static{
fdb = FDB.selectAPIVersion(620);
fdb = FDB.selectAPIVersion(700);
db = fdb.open();
queue = new Subspace(Tuple.from("Q"));
randno = new Random();

View File

@ -17,7 +17,9 @@ Status
Bindings
--------
* API version updated to 700. See the :ref:`API version upgrade guide <api-version-upgrade-guide-700>` for upgrade details.
* Java: Introduced ``keyAfter`` utility function that can be used to create the immediate next key for a given byte array. `(PR #2458) <https://github.com/apple/foundationdb/pull/2458>`_
* C: The ``FDBKeyValue`` struct's ``key`` and ``value`` members have changed type from ``void*`` to ``uint8_t*``. `(PR #2622) <https://github.com/apple/foundationdb/pull/2622>`_
Other Changes
-------------

View File

@ -87,7 +87,7 @@ In this example, were storing user data based on user ID but sometimes need t
private static final Subspace index;
static {
fdb = FDB.selectAPIVersion(620);
fdb = FDB.selectAPIVersion(700);
db = fdb.open();
main = new Subspace(Tuple.from("user"));
index = new Subspace(Tuple.from("zipcode_index"));

View File

@ -62,7 +62,7 @@ Heres a simple implementation of the basic table pattern:
private static final Subspace colIndex;
static {
fdb = FDB.selectAPIVersion(620);
fdb = FDB.selectAPIVersion(700);
db = fdb.open();
table = new Subspace(Tuple.from("T"));
rowIndex = table.subspace(Tuple.from("R"));

View File

@ -77,7 +77,7 @@ Heres the basic pattern:
private static final Subspace vector;
static {
fdb = FDB.selectAPIVersion(620);
fdb = FDB.selectAPIVersion(700);
db = fdb.open();
vector = new Subspace(Tuple.from("V"));
}

View File

@ -460,7 +460,7 @@ void initHelp() {
"clear a range of keys from the database",
"All keys between BEGINKEY (inclusive) and ENDKEY (exclusive) are cleared from the database. This command will succeed even if the specified range is empty, but may fail because of conflicts." ESCAPINGK);
helpMap["configure"] = CommandHelp(
"configure [new] <single|double|triple|three_data_hall|three_datacenter|ssd|memory|proxies=<PROXIES>|logs=<LOGS>|resolvers=<RESOLVERS>>*",
"configure [new] <single|double|triple|three_data_hall|three_datacenter|ssd|memory|memory-radixtree-beta|proxies=<PROXIES>|logs=<LOGS>|resolvers=<RESOLVERS>>*",
"change the database configuration",
"The `new' option, if present, initializes a new database with the given configuration rather than changing the configuration of an existing one. When used, both a redundancy mode and a storage engine must be specified.\n\nRedundancy mode:\n single - one copy of the data. Not fault tolerant.\n double - two copies of data (survive one failure).\n triple - three copies of data (survive two failures).\n three_data_hall - See the Admin Guide.\n three_datacenter - See the Admin Guide.\n\nStorage engine:\n ssd - B-Tree storage engine optimized for solid state disks.\n memory - Durable in-memory storage engine for small datasets.\n\nproxies=<PROXIES>: Sets the desired number of proxies in the cluster. Must be at least 1, or set to -1 which restores the number of proxies to the default value.\n\nlogs=<LOGS>: Sets the desired number of log servers in the cluster. Must be at least 1, or set to -1 which restores the number of logs to the default value.\n\nresolvers=<RESOLVERS>: Sets the desired number of resolvers in the cluster. Must be at least 1, or set to -1 which restores the number of resolvers to the default value.\n\nSee the FoundationDB Administration Guide for more information.");
helpMap["fileconfigure"] = CommandHelp(
@ -2377,7 +2377,7 @@ void onoff_generator(const char* text, const char *line, std::vector<std::string
}
void configure_generator(const char* text, const char *line, std::vector<std::string>& lc) {
const char* opts[] = {"new", "single", "double", "triple", "three_data_hall", "three_datacenter", "ssd", "ssd-1", "ssd-2", "memory", "memory-1", "memory-2", "proxies=", "logs=", "resolvers=", NULL};
const char* opts[] = {"new", "single", "double", "triple", "three_data_hall", "three_datacenter", "ssd", "ssd-1", "ssd-2", "memory", "memory-1", "memory-2", "memory-radixtree-beta", "proxies=", "logs=", "resolvers=", NULL};
array_generator(text, line, opts, lc);
}

Some files were not shown because too many files have changed in this diff Show More