Merge branch 'master' into bindings-versionstamps-in-tuples
This commit is contained in:
commit
c12c928141
2
Makefile
2
Makefile
|
@ -20,7 +20,7 @@ ifeq ($(MCS),)
|
||||||
MCS := /usr/bin/dmcs
|
MCS := /usr/bin/dmcs
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS := -Werror -Wno-error=format -fPIC -DNO_INTELLISENSE -fvisibility=hidden -DNDEBUG=1 -Wreturn-type
|
CFLAGS := -Werror -Wno-error=format -fPIC -DNO_INTELLISENSE -fvisibility=hidden -DNDEBUG=1 -Wreturn-type -fno-omit-frame-pointer
|
||||||
ifeq ($(RELEASE),true)
|
ifeq ($(RELEASE),true)
|
||||||
CFLAGS += -DFDB_CLEAN_BUILD
|
CFLAGS += -DFDB_CLEAN_BUILD
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -47,11 +47,11 @@ class Tester:
|
||||||
def _absolute_path(path):
|
def _absolute_path(path):
|
||||||
return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', path)
|
return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', path)
|
||||||
|
|
||||||
_java_cmd = 'java -ea -cp %s:%s com.apple.cie.foundationdb.test.' % (
|
_java_cmd = 'java -ea -cp %s:%s com.apple.foundationdb.test.' % (
|
||||||
_absolute_path('java/foundationdb-client.jar'),
|
_absolute_path('java/foundationdb-client.jar'),
|
||||||
_absolute_path('java/foundationdb-tests.jar'))
|
_absolute_path('java/foundationdb-tests.jar'))
|
||||||
|
|
||||||
_java_completable_cmd = 'java -ea -cp %s:%s com.apple.cie.foundationdb.test.' % (
|
_java_completable_cmd = 'java -ea -cp %s:%s com.apple.foundationdb.test.' % (
|
||||||
_absolute_path('java/foundationdb-client-completable.jar'),
|
_absolute_path('java/foundationdb-client-completable.jar'),
|
||||||
_absolute_path('java/foundationdb-tests-completable.jar'))
|
_absolute_path('java/foundationdb-tests-completable.jar'))
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ fdb_bool_t fdb_error_predicate( int predicate_test, fdb_error_t code ) {
|
||||||
}
|
}
|
||||||
if(predicate_test == FDBErrorPredicates::RETRYABLE_NOT_COMMITTED) {
|
if(predicate_test == FDBErrorPredicates::RETRYABLE_NOT_COMMITTED) {
|
||||||
return code == error_code_not_committed ||
|
return code == error_code_not_committed ||
|
||||||
code == error_code_past_version ||
|
code == error_code_transaction_too_old ||
|
||||||
code == error_code_future_version ||
|
code == error_code_future_version ||
|
||||||
code == error_code_database_locked;
|
code == error_code_database_locked;
|
||||||
}
|
}
|
||||||
|
@ -124,6 +124,12 @@ fdb_error_t fdb_stop_network() {
|
||||||
CATCH_AND_RETURN( API->stopNetwork(); );
|
CATCH_AND_RETURN( API->stopNetwork(); );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" DLLEXPORT
|
||||||
|
fdb_error_t fdb_add_network_thread_completion_hook(void (*hook)(void*), void *hook_parameter) {
|
||||||
|
CATCH_AND_RETURN( API->addNetworkThreadCompletionHook(hook, hook_parameter); );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extern "C" DLLEXPORT
|
extern "C" DLLEXPORT
|
||||||
FDBFuture* fdb_cluster_configure_database( FDBCluster* c, int config_type,
|
FDBFuture* fdb_cluster_configure_database( FDBCluster* c, int config_type,
|
||||||
int config_mode, uint8_t const* db_name,
|
int config_mode, uint8_t const* db_name,
|
||||||
|
|
|
@ -89,6 +89,8 @@ extern "C" {
|
||||||
|
|
||||||
DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_stop_network();
|
DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_stop_network();
|
||||||
|
|
||||||
|
DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_add_network_thread_completion_hook(void (*hook)(void*), void *hook_parameter);
|
||||||
|
|
||||||
#pragma pack(push, 4)
|
#pragma pack(push, 4)
|
||||||
typedef struct keyvalue {
|
typedef struct keyvalue {
|
||||||
const void* key;
|
const void* key;
|
||||||
|
|
|
@ -131,7 +131,7 @@ namespace FDB {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(versionBytes.get().size() != 12) {
|
if(versionBytes.get().size() != 12) {
|
||||||
throw invalid_database_value();
|
throw invalid_directory_layer_metadata();
|
||||||
}
|
}
|
||||||
if(((uint32_t*)versionBytes.get().begin())[0] > DirectoryLayer::VERSION[0]) {
|
if(((uint32_t*)versionBytes.get().begin())[0] > DirectoryLayer::VERSION[0]) {
|
||||||
throw incompatible_directory_version();
|
throw incompatible_directory_version();
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace FDB {
|
||||||
int64_t count = 0;
|
int64_t count = 0;
|
||||||
if(countValue.present()) {
|
if(countValue.present()) {
|
||||||
if(countValue.get().size() != 8) {
|
if(countValue.get().size() != 8) {
|
||||||
throw invalid_database_value();
|
throw invalid_directory_layer_metadata();
|
||||||
}
|
}
|
||||||
count = *(int64_t*)countValue.get().begin();
|
count = *(int64_t*)countValue.get().begin();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1585,7 +1585,7 @@ ACTOR static Future<Void> doInstructions(Reference<FlowTesterData> data) {
|
||||||
}
|
}
|
||||||
catch (Error& e) {
|
catch (Error& e) {
|
||||||
if(LOG_ERRORS) {
|
if(LOG_ERRORS) {
|
||||||
printf("Error: %s (%d)\n", e.what(), e.code());
|
printf("Error: %s (%d)\n", e.name(), e.code());
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1673,7 +1673,7 @@ ACTOR void startTest(std::string clusterFilename, StringRef prefix, int apiVersi
|
||||||
catch(Error &e) {
|
catch(Error &e) {
|
||||||
TraceEvent("ErrorRunningTest").error(e);
|
TraceEvent("ErrorRunningTest").error(e);
|
||||||
if(LOG_ERRORS) {
|
if(LOG_ERRORS) {
|
||||||
printf("Flow tester encountered error: %s\n", e.what());
|
printf("Flow tester encountered error: %s\n", e.name());
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
flushAndExit(1);
|
flushAndExit(1);
|
||||||
|
@ -1715,7 +1715,7 @@ ACTOR void _test_versionstamp() {
|
||||||
catch (Error &e) {
|
catch (Error &e) {
|
||||||
TraceEvent("ErrorRunningTest").error(e);
|
TraceEvent("ErrorRunningTest").error(e);
|
||||||
if (LOG_ERRORS) {
|
if (LOG_ERRORS) {
|
||||||
printf("Flow tester encountered error: %s\n", e.what());
|
printf("Flow tester encountered error: %s\n", e.name());
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
flushAndExit(1);
|
flushAndExit(1);
|
||||||
|
@ -1756,7 +1756,7 @@ int main( int argc, char** argv ) {
|
||||||
flushAndExit(FDB_EXIT_SUCCESS);
|
flushAndExit(FDB_EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
catch (Error& e) {
|
catch (Error& e) {
|
||||||
fprintf(stderr, "Error: %s\n", e.what());
|
fprintf(stderr, "Error: %s\n", e.name());
|
||||||
TraceEvent(SevError, "MainError").error(e);
|
TraceEvent(SevError, "MainError").error(e);
|
||||||
flushAndExit(FDB_EXIT_MAIN_ERROR);
|
flushAndExit(FDB_EXIT_MAIN_ERROR);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,8 +38,18 @@
|
||||||
#error Missing thread local storage
|
#error Missing thread local storage
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static JavaVM* g_jvm = 0;
|
||||||
static thread_local JNIEnv* g_thread_jenv = 0; // Defined for the network thread once it is running, and for any thread that has called registerCallback
|
static thread_local JNIEnv* g_thread_jenv = 0; // Defined for the network thread once it is running, and for any thread that has called registerCallback
|
||||||
static thread_local jmethodID g_IFutureCallback_call_methodID = 0;
|
static thread_local jmethodID g_IFutureCallback_call_methodID = 0;
|
||||||
|
static thread_local bool is_external = false;
|
||||||
|
|
||||||
|
void detachIfExternalThread(void *ignore) {
|
||||||
|
if(is_external && g_thread_jenv != 0) {
|
||||||
|
g_thread_jenv = 0;
|
||||||
|
g_IFutureCallback_call_methodID = 0;
|
||||||
|
g_jvm->DetachCurrentThread();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void throwOutOfMem(JNIEnv *jenv) {
|
void throwOutOfMem(JNIEnv *jenv) {
|
||||||
const char *className = "java/lang/OutOfMemoryError";
|
const char *className = "java/lang/OutOfMemoryError";
|
||||||
|
@ -59,7 +69,7 @@ void throwOutOfMem(JNIEnv *jenv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static jthrowable getThrowable(JNIEnv *jenv, fdb_error_t e, const char* msg = NULL) {
|
static jthrowable getThrowable(JNIEnv *jenv, fdb_error_t e, const char* msg = NULL) {
|
||||||
jclass excepClass = jenv->FindClass("com/apple/cie/foundationdb/FDBException");
|
jclass excepClass = jenv->FindClass("com/apple/foundationdb/FDBException");
|
||||||
if(jenv->ExceptionOccurred())
|
if(jenv->ExceptionOccurred())
|
||||||
return JNI_NULL;
|
return JNI_NULL;
|
||||||
|
|
||||||
|
@ -103,12 +113,6 @@ void throwParamNotNull(JNIEnv *jenv) {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void callCallback( FDBFuture* f, void* data ) {
|
|
||||||
jobject callback = (jobject)data;
|
|
||||||
g_thread_jenv->CallVoidMethod( callback, g_IFutureCallback_call_methodID );
|
|
||||||
g_thread_jenv->DeleteGlobalRef(callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the methods are not found, exceptions are thrown and this will return false.
|
// If the methods are not found, exceptions are thrown and this will return false.
|
||||||
// Returns TRUE on success, false otherwise.
|
// Returns TRUE on success, false otherwise.
|
||||||
static bool findCallbackMethods(JNIEnv *jenv) {
|
static bool findCallbackMethods(JNIEnv *jenv) {
|
||||||
|
@ -123,6 +127,27 @@ static bool findCallbackMethods(JNIEnv *jenv) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void callCallback( FDBFuture* f, void* data ) {
|
||||||
|
if (g_thread_jenv == 0) {
|
||||||
|
// We are on an external thread and must attach to the JVM.
|
||||||
|
// The shutdown hook will later detach this thread.
|
||||||
|
is_external = true;
|
||||||
|
if( g_jvm != 0 && g_jvm->AttachCurrentThreadAsDaemon((void **) &g_thread_jenv, JNI_NULL) == JNI_OK ) {
|
||||||
|
if( !findCallbackMethods( g_thread_jenv ) ) {
|
||||||
|
g_thread_jenv->FatalError("FDB: Could not find callback method.\n");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Can't call FatalError, because we don't have a pointer to the jenv...
|
||||||
|
// There will be a segmentation fault from the attempt to call the callback method.
|
||||||
|
fprintf(stderr, "FDB: Could not attach external client thread to the JVM as daemon.\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jobject callback = (jobject)data;
|
||||||
|
g_thread_jenv->CallVoidMethod( callback, g_IFutureCallback_call_methodID );
|
||||||
|
g_thread_jenv->DeleteGlobalRef(callback);
|
||||||
|
}
|
||||||
|
|
||||||
// Attempts to throw 't', attempts to shut down the JVM if this fails.
|
// Attempts to throw 't', attempts to shut down the JVM if this fails.
|
||||||
void safeThrow( JNIEnv *jenv, jthrowable t ) {
|
void safeThrow( JNIEnv *jenv, jthrowable t ) {
|
||||||
if( jenv->Throw( t ) != 0 ) {
|
if( jenv->Throw( t ) != 0 ) {
|
||||||
|
@ -130,7 +155,7 @@ void safeThrow( JNIEnv *jenv, jthrowable t ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1registerCallback(JNIEnv *jenv, jobject cls, jlong future, jobject callback) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_NativeFuture_Future_1registerCallback(JNIEnv *jenv, jobject cls, jlong future, jobject callback) {
|
||||||
// SOMEDAY: Do this on module load instead. Can we cache method ids across threads?
|
// SOMEDAY: Do this on module load instead. Can we cache method ids across threads?
|
||||||
if( !g_IFutureCallback_call_methodID ) {
|
if( !g_IFutureCallback_call_methodID ) {
|
||||||
if( !findCallbackMethods( jenv ) ) {
|
if( !findCallbackMethods( jenv ) ) {
|
||||||
|
@ -163,7 +188,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1regi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1blockUntilReady(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_NativeFuture_Future_1blockUntilReady(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -175,7 +200,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1bloc
|
||||||
safeThrow( jenv, getThrowable( jenv, err ) );
|
safeThrow( jenv, getThrowable( jenv, err ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jthrowable JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1getError(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT jthrowable JNICALL Java_com_apple_foundationdb_NativeFuture_Future_1getError(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return JNI_NULL;
|
return JNI_NULL;
|
||||||
|
@ -184,7 +209,7 @@ JNIEXPORT jthrowable JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future
|
||||||
return getThrowable( jenv, fdb_future_get_error( sav ) );
|
return getThrowable( jenv, fdb_future_get_error( sav ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1isReady(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT jboolean JNICALL Java_com_apple_foundationdb_NativeFuture_Future_1isReady(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
@ -193,7 +218,7 @@ JNIEXPORT jboolean JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1
|
||||||
return (jboolean)fdb_future_is_ready(var);
|
return (jboolean)fdb_future_is_ready(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1dispose(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_NativeFuture_Future_1dispose(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -202,7 +227,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1disp
|
||||||
fdb_future_destroy(var);
|
fdb_future_destroy(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1cancel(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_NativeFuture_Future_1cancel(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -211,7 +236,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1canc
|
||||||
fdb_future_cancel(var);
|
fdb_future_cancel(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1releaseMemory(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_NativeFuture_Future_1releaseMemory(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -220,7 +245,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_NativeFuture_Future_1rele
|
||||||
fdb_future_release_memory(var);
|
fdb_future_release_memory(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FutureVersion_FutureVersion_1get(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FutureVersion_FutureVersion_1get(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -237,7 +262,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FutureVersion_FutureVers
|
||||||
return (jlong)version;
|
return (jlong)version;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jobject JNICALL Java_com_apple_cie_foundationdb_FutureStrings_FutureStrings_1get(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT jobject JNICALL Java_com_apple_foundationdb_FutureStrings_FutureStrings_1get(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return JNI_NULL;
|
return JNI_NULL;
|
||||||
|
@ -278,13 +303,13 @@ JNIEXPORT jobject JNICALL Java_com_apple_cie_foundationdb_FutureStrings_FutureSt
|
||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jobject JNICALL Java_com_apple_cie_foundationdb_FutureResults_FutureResults_1getSummary(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT jobject JNICALL Java_com_apple_foundationdb_FutureResults_FutureResults_1getSummary(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return JNI_NULL;
|
return JNI_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
jclass resultCls = jenv->FindClass("com/apple/cie/foundationdb/RangeResultSummary");
|
jclass resultCls = jenv->FindClass("com/apple/foundationdb/RangeResultSummary");
|
||||||
if( jenv->ExceptionOccurred() )
|
if( jenv->ExceptionOccurred() )
|
||||||
return JNI_NULL;
|
return JNI_NULL;
|
||||||
jmethodID resultCtorId = jenv->GetMethodID(resultCls, "<init>", "([BIZ)V");
|
jmethodID resultCtorId = jenv->GetMethodID(resultCls, "<init>", "([BIZ)V");
|
||||||
|
@ -322,13 +347,13 @@ JNIEXPORT jobject JNICALL Java_com_apple_cie_foundationdb_FutureResults_FutureRe
|
||||||
}
|
}
|
||||||
|
|
||||||
// SOMEDAY: explore doing this more efficiently with Direct ByteBuffers
|
// SOMEDAY: explore doing this more efficiently with Direct ByteBuffers
|
||||||
JNIEXPORT jobject JNICALL Java_com_apple_cie_foundationdb_FutureResults_FutureResults_1get(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT jobject JNICALL Java_com_apple_foundationdb_FutureResults_FutureResults_1get(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return JNI_NULL;
|
return JNI_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
jclass resultCls = jenv->FindClass("com/apple/cie/foundationdb/RangeResult");
|
jclass resultCls = jenv->FindClass("com/apple/foundationdb/RangeResult");
|
||||||
jmethodID resultCtorId = jenv->GetMethodID(resultCls, "<init>", "([B[IZ)V");
|
jmethodID resultCtorId = jenv->GetMethodID(resultCls, "<init>", "([B[IZ)V");
|
||||||
|
|
||||||
FDBFuture *f = (FDBFuture *)future;
|
FDBFuture *f = (FDBFuture *)future;
|
||||||
|
@ -353,10 +378,18 @@ JNIEXPORT jobject JNICALL Java_com_apple_cie_foundationdb_FutureResults_FutureRe
|
||||||
throwOutOfMem(jenv);
|
throwOutOfMem(jenv);
|
||||||
return JNI_NULL;
|
return JNI_NULL;
|
||||||
}
|
}
|
||||||
|
uint8_t *keyvalues_barr = (uint8_t *)jenv->GetByteArrayElements(keyValueArray, NULL);
|
||||||
|
if (!keyvalues_barr) {
|
||||||
|
throwRuntimeEx( jenv, "Error getting handle to native resources" );
|
||||||
|
return JNI_NULL;
|
||||||
|
}
|
||||||
|
|
||||||
jintArray lengthArray = jenv->NewIntArray(count * 2);
|
jintArray lengthArray = jenv->NewIntArray(count * 2);
|
||||||
if( !lengthArray ) {
|
if( !lengthArray ) {
|
||||||
if( !jenv->ExceptionOccurred() )
|
if( !jenv->ExceptionOccurred() )
|
||||||
throwOutOfMem(jenv);
|
throwOutOfMem(jenv);
|
||||||
|
|
||||||
|
jenv->ReleaseByteArrayElements(keyValueArray, (jbyte *)keyvalues_barr, 0);
|
||||||
return JNI_NULL;
|
return JNI_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,20 +397,23 @@ JNIEXPORT jobject JNICALL Java_com_apple_cie_foundationdb_FutureResults_FutureRe
|
||||||
if( !length_barr ) {
|
if( !length_barr ) {
|
||||||
if( !jenv->ExceptionOccurred() )
|
if( !jenv->ExceptionOccurred() )
|
||||||
throwOutOfMem(jenv);
|
throwOutOfMem(jenv);
|
||||||
|
|
||||||
|
jenv->ReleaseByteArrayElements(keyValueArray, (jbyte *)keyvalues_barr, 0);
|
||||||
return JNI_NULL;
|
return JNI_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
for(int i = 0; i < count; i++) {
|
for(int i = 0; i < count; i++) {
|
||||||
jenv->SetByteArrayRegion(keyValueArray, offset, kvs[i].key_length, (jbyte *)kvs[i].key);
|
memcpy(keyvalues_barr + offset, kvs[i].key, kvs[i].key_length);
|
||||||
length_barr[ i * 2 ] = kvs[i].key_length;
|
length_barr[ i * 2 ] = kvs[i].key_length;
|
||||||
offset += kvs[i].key_length;
|
offset += kvs[i].key_length;
|
||||||
|
|
||||||
jenv->SetByteArrayRegion(keyValueArray, offset, kvs[i].value_length, (jbyte *)kvs[i].value);
|
memcpy(keyvalues_barr + offset, kvs[i].value, kvs[i].value_length);
|
||||||
length_barr[ (i * 2) + 1 ] = kvs[i].value_length;
|
length_barr[ (i * 2) + 1 ] = kvs[i].value_length;
|
||||||
offset += kvs[i].value_length;
|
offset += kvs[i].value_length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jenv->ReleaseByteArrayElements(keyValueArray, (jbyte *)keyvalues_barr, 0);
|
||||||
jenv->ReleaseIntArrayElements(lengthArray, length_barr, 0);
|
jenv->ReleaseIntArrayElements(lengthArray, length_barr, 0);
|
||||||
|
|
||||||
jobject result = jenv->NewObject(resultCls, resultCtorId, keyValueArray, lengthArray, (jboolean)more);
|
jobject result = jenv->NewObject(resultCls, resultCtorId, keyValueArray, lengthArray, (jboolean)more);
|
||||||
|
@ -388,7 +424,7 @@ JNIEXPORT jobject JNICALL Java_com_apple_cie_foundationdb_FutureResults_FutureRe
|
||||||
}
|
}
|
||||||
|
|
||||||
// SOMEDAY: explore doing this more efficiently with Direct ByteBuffers
|
// SOMEDAY: explore doing this more efficiently with Direct ByteBuffers
|
||||||
JNIEXPORT jbyteArray JNICALL Java_com_apple_cie_foundationdb_FutureResult_FutureResult_1get(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT jbyteArray JNICALL Java_com_apple_foundationdb_FutureResult_FutureResult_1get(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return JNI_NULL;
|
return JNI_NULL;
|
||||||
|
@ -418,7 +454,7 @@ JNIEXPORT jbyteArray JNICALL Java_com_apple_cie_foundationdb_FutureResult_Future
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jbyteArray JNICALL Java_com_apple_cie_foundationdb_FutureKey_FutureKey_1get(JNIEnv * jenv, jclass, jlong future) {
|
JNIEXPORT jbyteArray JNICALL Java_com_apple_foundationdb_FutureKey_FutureKey_1get(JNIEnv * jenv, jclass, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return JNI_NULL;
|
return JNI_NULL;
|
||||||
|
@ -444,7 +480,7 @@ JNIEXPORT jbyteArray JNICALL Java_com_apple_cie_foundationdb_FutureKey_FutureKey
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FutureCluster_FutureCluster_1get(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FutureCluster_FutureCluster_1get(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -460,7 +496,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FutureCluster_FutureClus
|
||||||
return (jlong)cluster;
|
return (jlong)cluster;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FutureDatabase_FutureDatabase_1get(JNIEnv *jenv, jobject, jlong future) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FutureDatabase_FutureDatabase_1get(JNIEnv *jenv, jobject, jlong future) {
|
||||||
if( !future ) {
|
if( !future ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -476,7 +512,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FutureDatabase_FutureDat
|
||||||
return (jlong)database;
|
return (jlong)database;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBDatabase_Database_1createTransaction(JNIEnv *jenv, jobject, jlong dbPtr) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDBDatabase_Database_1createTransaction(JNIEnv *jenv, jobject, jlong dbPtr) {
|
||||||
if( !dbPtr ) {
|
if( !dbPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -491,7 +527,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBDatabase_Database_1cr
|
||||||
return (jlong)tr;
|
return (jlong)tr;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBDatabase_Database_1dispose(JNIEnv *jenv, jobject, jlong dPtr) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBDatabase_Database_1dispose(JNIEnv *jenv, jobject, jlong dPtr) {
|
||||||
if( !dPtr ) {
|
if( !dPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -499,7 +535,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBDatabase_Database_1dis
|
||||||
fdb_database_destroy( (FDBDatabase *)dPtr );
|
fdb_database_destroy( (FDBDatabase *)dPtr );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBDatabase_Database_1setOption(JNIEnv *jenv, jobject, jlong dPtr, jint code, jbyteArray value) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBDatabase_Database_1setOption(JNIEnv *jenv, jobject, jlong dPtr, jint code, jbyteArray value) {
|
||||||
if( !dPtr ) {
|
if( !dPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -524,11 +560,11 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBDatabase_Database_1set
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_com_apple_cie_foundationdb_FDB_Error_1predicate(JNIEnv *jenv, jobject, jint predicate, jint code) {
|
JNIEXPORT jboolean JNICALL Java_com_apple_foundationdb_FDB_Error_1predicate(JNIEnv *jenv, jobject, jint predicate, jint code) {
|
||||||
return (jboolean)fdb_error_predicate(predicate, code);
|
return (jboolean)fdb_error_predicate(predicate, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDB_Cluster_1create(JNIEnv *jenv, jobject, jstring clusterFileName) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDB_Cluster_1create(JNIEnv *jenv, jobject, jstring clusterFileName) {
|
||||||
const char* fileName = 0;
|
const char* fileName = 0;
|
||||||
if(clusterFileName != 0) {
|
if(clusterFileName != 0) {
|
||||||
fileName = jenv->GetStringUTFChars(clusterFileName, 0);
|
fileName = jenv->GetStringUTFChars(clusterFileName, 0);
|
||||||
|
@ -541,7 +577,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDB_Cluster_1create(JNIE
|
||||||
return (jlong)cluster;
|
return (jlong)cluster;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_Cluster_Cluster_1setOption(JNIEnv *jenv, jobject, jlong cPtr, jint code, jbyteArray value) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_Cluster_Cluster_1setOption(JNIEnv *jenv, jobject, jlong cPtr, jint code, jbyteArray value) {
|
||||||
if( !cPtr ) {
|
if( !cPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -566,7 +602,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_Cluster_Cluster_1setOptio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_Cluster_Cluster_1dispose(JNIEnv *jenv, jobject, jlong cPtr) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_Cluster_Cluster_1dispose(JNIEnv *jenv, jobject, jlong cPtr) {
|
||||||
if( !cPtr ) {
|
if( !cPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -574,7 +610,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_Cluster_Cluster_1dispose(
|
||||||
fdb_cluster_destroy( (FDBCluster *)cPtr );
|
fdb_cluster_destroy( (FDBCluster *)cPtr );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_Cluster_Cluster_1createDatabase(JNIEnv *jenv, jobject, jlong cPtr, jbyteArray dbNameBytes) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_Cluster_Cluster_1createDatabase(JNIEnv *jenv, jobject, jlong cPtr, jbyteArray dbNameBytes) {
|
||||||
if( !cPtr || !dbNameBytes ) {
|
if( !cPtr || !dbNameBytes ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -593,7 +629,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_Cluster_Cluster_1createD
|
||||||
return (jlong)f;
|
return (jlong)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1setVersion(JNIEnv *jenv, jobject, jlong tPtr, jlong version) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1setVersion(JNIEnv *jenv, jobject, jlong tPtr, jlong version) {
|
||||||
if( !tPtr ) {
|
if( !tPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -602,7 +638,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transactio
|
||||||
fdb_transaction_set_read_version( tr, version );
|
fdb_transaction_set_read_version( tr, version );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1getReadVersion(JNIEnv *jenv, jobject, jlong tPtr) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1getReadVersion(JNIEnv *jenv, jobject, jlong tPtr) {
|
||||||
if( !tPtr ) {
|
if( !tPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -612,7 +648,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transacti
|
||||||
return (jlong)f;
|
return (jlong)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1get(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBytes, jboolean snapshot) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1get(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBytes, jboolean snapshot) {
|
||||||
if( !tPtr || !keyBytes ) {
|
if( !tPtr || !keyBytes ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -631,7 +667,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transacti
|
||||||
return (jlong)f;
|
return (jlong)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1getKey(JNIEnv *jenv, jobject, jlong tPtr,
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1getKey(JNIEnv *jenv, jobject, jlong tPtr,
|
||||||
jbyteArray keyBytes, jboolean orEqual, jint offset, jboolean snapshot) {
|
jbyteArray keyBytes, jboolean orEqual, jint offset, jboolean snapshot) {
|
||||||
if( !tPtr || !keyBytes ) {
|
if( !tPtr || !keyBytes ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
|
@ -651,7 +687,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transacti
|
||||||
return (jlong)f;
|
return (jlong)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1getRange
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1getRange
|
||||||
(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBeginBytes, jboolean orEqualBegin, jint offsetBegin,
|
(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBeginBytes, jboolean orEqualBegin, jint offsetBegin,
|
||||||
jbyteArray keyEndBytes, jboolean orEqualEnd, jint offsetEnd, jint rowLimit, jint targetBytes,
|
jbyteArray keyEndBytes, jboolean orEqualEnd, jint offsetEnd, jint rowLimit, jint targetBytes,
|
||||||
jint streamingMode, jint iteration, jboolean snapshot, jboolean reverse) {
|
jint streamingMode, jint iteration, jboolean snapshot, jboolean reverse) {
|
||||||
|
@ -685,7 +721,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transacti
|
||||||
return (jlong)f;
|
return (jlong)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1set(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBytes, jbyteArray valueBytes) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1set(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBytes, jbyteArray valueBytes) {
|
||||||
if( !tPtr || !keyBytes || !valueBytes ) {
|
if( !tPtr || !keyBytes || !valueBytes ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -714,7 +750,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transactio
|
||||||
jenv->ReleaseByteArrayElements( valueBytes, (jbyte *)barrValue, JNI_ABORT );
|
jenv->ReleaseByteArrayElements( valueBytes, (jbyte *)barrValue, JNI_ABORT );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1clear__J_3B(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBytes) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1clear__J_3B(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBytes) {
|
||||||
if( !tPtr || !keyBytes ) {
|
if( !tPtr || !keyBytes ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -732,7 +768,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transactio
|
||||||
jenv->ReleaseByteArrayElements( keyBytes, (jbyte *)barr, JNI_ABORT );
|
jenv->ReleaseByteArrayElements( keyBytes, (jbyte *)barr, JNI_ABORT );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1clear__J_3B_3B(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBeginBytes, jbyteArray keyEndBytes) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1clear__J_3B_3B(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBeginBytes, jbyteArray keyEndBytes) {
|
||||||
if( !tPtr || !keyBeginBytes || !keyEndBytes ) {
|
if( !tPtr || !keyBeginBytes || !keyEndBytes ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -761,7 +797,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transactio
|
||||||
jenv->ReleaseByteArrayElements( keyEndBytes, (jbyte *)barrKeyEnd, JNI_ABORT );
|
jenv->ReleaseByteArrayElements( keyEndBytes, (jbyte *)barrKeyEnd, JNI_ABORT );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1mutate(JNIEnv *jenv, jobject, jlong tPtr, jint code,
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1mutate(JNIEnv *jenv, jobject, jlong tPtr, jint code,
|
||||||
jbyteArray key, jbyteArray value ) {
|
jbyteArray key, jbyteArray value ) {
|
||||||
if( !tPtr || !key || !value ) {
|
if( !tPtr || !key || !value ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
|
@ -793,7 +829,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transactio
|
||||||
jenv->ReleaseByteArrayElements( value, (jbyte *)barrValue, JNI_ABORT );
|
jenv->ReleaseByteArrayElements( value, (jbyte *)barrValue, JNI_ABORT );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1commit(JNIEnv *jenv, jobject, jlong tPtr) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1commit(JNIEnv *jenv, jobject, jlong tPtr) {
|
||||||
if( !tPtr ) {
|
if( !tPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -803,7 +839,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transacti
|
||||||
return (jlong)f;
|
return (jlong)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1setOption(JNIEnv *jenv, jobject, jlong tPtr, jint code, jbyteArray value) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1setOption(JNIEnv *jenv, jobject, jlong tPtr, jint code, jbyteArray value) {
|
||||||
if( !tPtr ) {
|
if( !tPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -829,7 +865,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transactio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1getCommittedVersion(JNIEnv *jenv, jobject, jlong tPtr) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1getCommittedVersion(JNIEnv *jenv, jobject, jlong tPtr) {
|
||||||
if( !tPtr ) {
|
if( !tPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -844,7 +880,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transacti
|
||||||
return (jlong)version;
|
return (jlong)version;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1getVersionstamp(JNIEnv *jenv, jobject, jlong tPtr) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1getVersionstamp(JNIEnv *jenv, jobject, jlong tPtr) {
|
||||||
if (!tPtr) {
|
if (!tPtr) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -854,7 +890,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transacti
|
||||||
return (jlong)f;
|
return (jlong)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1getKeyLocations(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray key) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1getKeyLocations(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray key) {
|
||||||
if( !tPtr || !key ) {
|
if( !tPtr || !key ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -875,7 +911,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transacti
|
||||||
return (jlong)f;
|
return (jlong)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1onError(JNIEnv *jenv, jobject, jlong tPtr, jint errorCode) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1onError(JNIEnv *jenv, jobject, jlong tPtr, jint errorCode) {
|
||||||
if( !tPtr ) {
|
if( !tPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -885,7 +921,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transacti
|
||||||
return (jlong)f;
|
return (jlong)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1dispose(JNIEnv *jenv, jobject, jlong tPtr) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1dispose(JNIEnv *jenv, jobject, jlong tPtr) {
|
||||||
if( !tPtr ) {
|
if( !tPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -893,7 +929,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transactio
|
||||||
fdb_transaction_destroy( (FDBTransaction *)tPtr );
|
fdb_transaction_destroy( (FDBTransaction *)tPtr );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1reset(JNIEnv *jenv, jobject, jlong tPtr) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1reset(JNIEnv *jenv, jobject, jlong tPtr) {
|
||||||
if( !tPtr ) {
|
if( !tPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -901,7 +937,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transactio
|
||||||
fdb_transaction_reset( (FDBTransaction *)tPtr );
|
fdb_transaction_reset( (FDBTransaction *)tPtr );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1watch(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray key) {
|
JNIEXPORT jlong JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1watch(JNIEnv *jenv, jobject, jlong tPtr, jbyteArray key) {
|
||||||
if( !tPtr || !key ) {
|
if( !tPtr || !key ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -921,7 +957,7 @@ JNIEXPORT jlong JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transacti
|
||||||
return (jlong)f;
|
return (jlong)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1cancel(JNIEnv *jenv, jobject, jlong tPtr) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1cancel(JNIEnv *jenv, jobject, jlong tPtr) {
|
||||||
if( !tPtr ) {
|
if( !tPtr ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
return;
|
return;
|
||||||
|
@ -929,7 +965,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transactio
|
||||||
fdb_transaction_cancel( (FDBTransaction *)tPtr );
|
fdb_transaction_cancel( (FDBTransaction *)tPtr );
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transaction_1addConflictRange(
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDBTransaction_Transaction_1addConflictRange(
|
||||||
JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBegin, jbyteArray keyEnd, jint conflictType) {
|
JNIEnv *jenv, jobject, jlong tPtr, jbyteArray keyBegin, jbyteArray keyEnd, jint conflictType) {
|
||||||
if( !tPtr || !keyBegin || !keyEnd ) {
|
if( !tPtr || !keyBegin || !keyEnd ) {
|
||||||
throwParamNotNull(jenv);
|
throwParamNotNull(jenv);
|
||||||
|
@ -964,7 +1000,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDBTransaction_Transactio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDB_Select_1API_1version(JNIEnv *jenv, jclass, jint version) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDB_Select_1API_1version(JNIEnv *jenv, jclass, jint version) {
|
||||||
fdb_error_t err = fdb_select_api_version( (int)version );
|
fdb_error_t err = fdb_select_api_version( (int)version );
|
||||||
if( err ) {
|
if( err ) {
|
||||||
if( err == 2203 ) {
|
if( err == 2203 ) {
|
||||||
|
@ -989,7 +1025,7 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDB_Select_1API_1version(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDB_Network_1setOption(JNIEnv *jenv, jobject, jint code, jbyteArray value) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDB_Network_1setOption(JNIEnv *jenv, jobject, jint code, jbyteArray value) {
|
||||||
uint8_t *barr = NULL;
|
uint8_t *barr = NULL;
|
||||||
int size = 0;
|
int size = 0;
|
||||||
if(value != 0) {
|
if(value != 0) {
|
||||||
|
@ -1009,14 +1045,14 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDB_Network_1setOption(JN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDB_Network_1setup(JNIEnv *jenv, jobject) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDB_Network_1setup(JNIEnv *jenv, jobject) {
|
||||||
fdb_error_t err = fdb_setup_network();
|
fdb_error_t err = fdb_setup_network();
|
||||||
if( err ) {
|
if( err ) {
|
||||||
safeThrow( jenv, getThrowable( jenv, err ) );
|
safeThrow( jenv, getThrowable( jenv, err ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDB_Network_1run(JNIEnv *jenv, jobject) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDB_Network_1run(JNIEnv *jenv, jobject) {
|
||||||
// initialize things for the callbacks on the network thread
|
// initialize things for the callbacks on the network thread
|
||||||
g_thread_jenv = jenv;
|
g_thread_jenv = jenv;
|
||||||
if( !g_IFutureCallback_call_methodID ) {
|
if( !g_IFutureCallback_call_methodID ) {
|
||||||
|
@ -1024,19 +1060,29 @@ JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDB_Network_1run(JNIEnv *
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fdb_error_t hookErr = fdb_add_network_thread_completion_hook( &detachIfExternalThread, NULL );
|
||||||
|
if( hookErr ) {
|
||||||
|
safeThrow( jenv, getThrowable( jenv, hookErr ) );
|
||||||
|
}
|
||||||
|
|
||||||
fdb_error_t err = fdb_run_network();
|
fdb_error_t err = fdb_run_network();
|
||||||
if( err ) {
|
if( err ) {
|
||||||
safeThrow( jenv, getThrowable( jenv, err ) );
|
safeThrow( jenv, getThrowable( jenv, err ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_apple_cie_foundationdb_FDB_Network_1stop(JNIEnv *jenv, jobject) {
|
JNIEXPORT void JNICALL Java_com_apple_foundationdb_FDB_Network_1stop(JNIEnv *jenv, jobject) {
|
||||||
fdb_error_t err = fdb_stop_network();
|
fdb_error_t err = fdb_stop_network();
|
||||||
if( err ) {
|
if( err ) {
|
||||||
safeThrow( jenv, getThrowable( jenv, err ) );
|
safeThrow( jenv, getThrowable( jenv, err ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||||
|
g_jvm = vm;
|
||||||
|
return JNI_VERSION_1_1;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -58,12 +58,12 @@ if exist "$(OutDir)fdb-java-*.jar" del "$(OutDir)fdb-java-*.jar"</Command>
|
||||||
<Command>rmdir /S /Q classes
|
<Command>rmdir /S /Q classes
|
||||||
mkdir classes\main
|
mkdir classes\main
|
||||||
mkdir classes\test
|
mkdir classes\test
|
||||||
"C:\Program Files\Java\jdk6\bin\javac.exe" -source 1.6 -target 1.6 -d classes\main src\main\com\apple\cie\foundationdb\*.java src\main\com\apple\cie\foundationdb\async\*.java src\main\com\apple\cie\foundationdb\tuple\*.java src\main\com\apple\cie\foundationdb\directory\*.java src\main\com\apple\cie\foundationdb\subspace\*.java
|
"C:\Program Files\Java\jdk6\bin\javac.exe" -source 1.6 -target 1.6 -d classes\main src\main\com\apple\foundationdb\*.java src\main\com\apple\foundationdb\async\*.java src\main\com\apple\foundationdb\tuple\*.java src\main\com\apple\foundationdb\directory\*.java src\main\com\apple\foundationdb\subspace\*.java
|
||||||
"C:\Program Files\Java\jdk6\bin\javac.exe" -source 1.6 -target 1.6 -cp classes\main -d classes\test src\test\com\apple\cie\foundationdb\test\*.java
|
"C:\Program Files\Java\jdk6\bin\javac.exe" -source 1.6 -target 1.6 -cp classes\main -d classes\test src\test\com\apple\foundationdb\test\*.java
|
||||||
mkdir classes\main\lib\windows\amd64
|
mkdir classes\main\lib\windows\amd64
|
||||||
copy "$(TargetPath)" "classes\main\lib\windows\amd64"
|
copy "$(TargetPath)" "classes\main\lib\windows\amd64"
|
||||||
"C:\Program Files\Java\jdk6\bin\jar.exe" cf "$(OutDir)fdb-java-$(Version)$(PreReleaseDecoration)-windows-$(Platform).jar" -C classes\main com\apple\cie\foundationdb -C classes\main lib\windows\amd64
|
"C:\Program Files\Java\jdk6\bin\jar.exe" cf "$(OutDir)fdb-java-$(Version)$(PreReleaseDecoration)-windows-$(Platform).jar" -C classes\main com\apple\foundationdb -C classes\main lib\windows\amd64
|
||||||
"C:\Program Files\Java\jdk6\bin\jar.exe" cf "$(OutDir)foundationdb-tests.jar" -C classes\test com\apple\cie\foundationdb
|
"C:\Program Files\Java\jdk6\bin\jar.exe" cf "$(OutDir)foundationdb-tests.jar" -C classes\test com\apple\foundationdb
|
||||||
FOR /F "tokens=1" %%i in ('hg.exe id') do copy /Y "$(TargetPath)" "$(TargetPath)-%%i"</Command>
|
FOR /F "tokens=1" %%i in ('hg.exe id') do copy /Y "$(TargetPath)" "$(TargetPath)-%%i"</Command>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<Link>
|
<Link>
|
||||||
|
@ -121,4 +121,4 @@ FOR /F "tokens=1" %%i in ('hg.exe id') do copy /Y "$(TargetPath)" "$(TargetPath)
|
||||||
<Message Text="Cleaning old jar and dll files" Importance="high" />
|
<Message Text="Cleaning old jar and dll files" Importance="high" />
|
||||||
<Delete Files="@(FilesToDelete)" />
|
<Delete Files="@(FilesToDelete)" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -40,22 +40,22 @@ endif
|
||||||
|
|
||||||
define add_java_binding_targets
|
define add_java_binding_targets
|
||||||
|
|
||||||
JAVA$(1)_GENERATED_SOURCES := bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/NetworkOptions.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/ClusterOptions.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/DatabaseOptions.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/TransactionOptions.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/StreamingMode.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/ConflictRangeType.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/MutationType.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/FDBException.java
|
JAVA$(1)_GENERATED_SOURCES := bindings/java/src$(1)/main/com/apple/foundationdb/NetworkOptions.java bindings/java/src$(1)/main/com/apple/foundationdb/ClusterOptions.java bindings/java/src$(1)/main/com/apple/foundationdb/DatabaseOptions.java bindings/java/src$(1)/main/com/apple/foundationdb/TransactionOptions.java bindings/java/src$(1)/main/com/apple/foundationdb/StreamingMode.java bindings/java/src$(1)/main/com/apple/foundationdb/ConflictRangeType.java bindings/java/src$(1)/main/com/apple/foundationdb/MutationType.java bindings/java/src$(1)/main/com/apple/foundationdb/FDBException.java
|
||||||
|
|
||||||
JAVA$(1)_SOURCES := $$(JAVA$(1)_GENERATED_SOURCES) bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/*.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/async/*.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/tuple/*.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/directory/*.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/subspace/*.java bindings/java/src$(1)/test/com/apple/apple/foundationdbdb/test/*.java
|
JAVA$(1)_SOURCES := $$(JAVA$(1)_GENERATED_SOURCES) bindings/java/src$(1)/main/com/apple/foundationdb/*.java bindings/java/src$(1)/main/com/apple/foundationdb/async/*.java bindings/java/src$(1)/main/com/apple/foundationdb/tuple/*.java bindings/java/src$(1)/main/com/apple/foundationdb/directory/*.java bindings/java/src$(1)/main/com/apple/foundationdb/subspace/*.java bindings/java/src$(1)/test/com/apple/foundationdb/test/*.java
|
||||||
|
|
||||||
fdb_java$(1): bindings/java/foundationdb-client$(1).jar bindings/java/foundationdb-tests$(1).jar
|
fdb_java$(1): bindings/java/foundationdb-client$(1).jar bindings/java/foundationdb-tests$(1).jar
|
||||||
|
|
||||||
bindings/java/foundationdb-tests$(1).jar: bindings/java/.classstamp$(1)
|
bindings/java/foundationdb-tests$(1).jar: bindings/java/.classstamp$(1)
|
||||||
@echo "Building $$@"
|
@echo "Building $$@"
|
||||||
@jar cf $$@ -C bindings/java/classes$(1)/test com/apple/apple/foundationdbdb
|
@jar cf $$@ -C bindings/java/classes$(1)/test com/apple/foundationdb
|
||||||
|
|
||||||
bindings/java/foundationdb-client$(1).jar: bindings/java/.classstamp$(1) lib/libfdb_java.$(DLEXT)
|
bindings/java/foundationdb-client$(1).jar: bindings/java/.classstamp$(1) lib/libfdb_java.$(DLEXT)
|
||||||
@echo "Building $$@"
|
@echo "Building $$@"
|
||||||
@rm -rf bindings/java/classes$(1)/main/lib/$$(PLATFORM)/$$(java_ARCH)
|
@rm -rf bindings/java/classes$(1)/main/lib/$$(PLATFORM)/$$(java_ARCH)
|
||||||
@mkdir -p bindings/java/classes$(1)/main/lib/$$(PLATFORM)/$$(java_ARCH)
|
@mkdir -p bindings/java/classes$(1)/main/lib/$$(PLATFORM)/$$(java_ARCH)
|
||||||
@cp lib/libfdb_java.$$(DLEXT) bindings/java/classes$(1)/main/lib/$$(PLATFORM)/$$(java_ARCH)/libfdb_java.$$(java_DLEXT)
|
@cp lib/libfdb_java.$$(DLEXT) bindings/java/classes$(1)/main/lib/$$(PLATFORM)/$$(java_ARCH)/libfdb_java.$$(java_DLEXT)
|
||||||
@jar cf $$@ -C bindings/java/classes$(1)/main com/apple/apple/foundationdbdb -C bindings/java/classes$(1)/main lib
|
@jar cf $$@ -C bindings/java/classes$(1)/main com/apple/foundationdb -C bindings/java/classes$(1)/main lib
|
||||||
|
|
||||||
fdb_java$(1)_jar_clean:
|
fdb_java$(1)_jar_clean:
|
||||||
@rm -rf $$(JAVA$(1)_GENERATED_SOURCES)
|
@rm -rf $$(JAVA$(1)_GENERATED_SOURCES)
|
||||||
|
@ -65,20 +65,20 @@ define add_java_binding_targets
|
||||||
# Redefinition of a target already defined in generated.mk, but it's "okay" and the way things were done before.
|
# Redefinition of a target already defined in generated.mk, but it's "okay" and the way things were done before.
|
||||||
fdb_java_clean: fdb_java$(1)_jar_clean
|
fdb_java_clean: fdb_java$(1)_jar_clean
|
||||||
|
|
||||||
bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/StreamingMode.java: bin/vexillographer.exe fdbclient/vexillographer/fdb.options
|
bindings/java/src$(1)/main/com/apple/foundationdb/StreamingMode.java: bin/vexillographer.exe fdbclient/vexillographer/fdb.options
|
||||||
@echo "Building Java options"
|
@echo "Building Java options"
|
||||||
@$$(MONO) bin/vexillographer.exe fdbclient/vexillographer/fdb.options java $$(@D)
|
@$$(MONO) bin/vexillographer.exe fdbclient/vexillographer/fdb.options java $$(@D)
|
||||||
|
|
||||||
bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/MutationType.java: bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/StreamingMode.java
|
bindings/java/src$(1)/main/com/apple/foundationdb/MutationType.java: bindings/java/src$(1)/main/com/apple/foundationdb/StreamingMode.java
|
||||||
@true
|
@true
|
||||||
|
|
||||||
bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/ConflictRangeType.java: bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/StreamingMode.java
|
bindings/java/src$(1)/main/com/apple/foundationdb/ConflictRangeType.java: bindings/java/src$(1)/main/com/apple/foundationdb/StreamingMode.java
|
||||||
@true
|
@true
|
||||||
|
|
||||||
bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/FDBException.java: bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/StreamingMode.java
|
bindings/java/src$(1)/main/com/apple/foundationdb/FDBException.java: bindings/java/src$(1)/main/com/apple/foundationdb/StreamingMode.java
|
||||||
@true
|
@true
|
||||||
|
|
||||||
bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/%Options.java: bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/StreamingMode.java
|
bindings/java/src$(1)/main/com/apple/foundationdb/%Options.java: bindings/java/src$(1)/main/com/apple/foundationdb/StreamingMode.java
|
||||||
@true
|
@true
|
||||||
|
|
||||||
bindings/java/src$(1)/main/overview.html: bindings/java/src$(1)/main/overview.html.in $$(ALL_MAKEFILES) versions.target
|
bindings/java/src$(1)/main/overview.html: bindings/java/src$(1)/main/overview.html.in $$(ALL_MAKEFILES) versions.target
|
||||||
|
@ -89,8 +89,8 @@ define add_java_binding_targets
|
||||||
@rm -rf bindings/java/classes$(1)
|
@rm -rf bindings/java/classes$(1)
|
||||||
@mkdir -p bindings/java/classes$(1)/main
|
@mkdir -p bindings/java/classes$(1)/main
|
||||||
@mkdir -p bindings/java/classes$(1)/test
|
@mkdir -p bindings/java/classes$(1)/test
|
||||||
@$$(JAVAC) $$(JAVA$(1)FLAGS) -d bindings/java/classes$(1)/main bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/*.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/async/*.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/tuple/*.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/directory/*.java bindings/java/src$(1)/main/com/apple/apple/foundationdbdb/subspace/*.java
|
@$$(JAVAC) $$(JAVA$(1)FLAGS) -d bindings/java/classes$(1)/main bindings/java/src$(1)/main/com/apple/foundationdb/*.java bindings/java/src$(1)/main/com/apple/foundationdb/async/*.java bindings/java/src$(1)/main/com/apple/foundationdb/tuple/*.java bindings/java/src$(1)/main/com/apple/foundationdb/directory/*.java bindings/java/src$(1)/main/com/apple/foundationdb/subspace/*.java
|
||||||
@$$(JAVAC) $$(JAVA$(1)FLAGS) -cp bindings/java/classes$(1)/main -d bindings/java/classes$(1)/test bindings/java/src$(1)/test/com/apple/apple/foundationdbdb/test/*.java
|
@$$(JAVAC) $$(JAVA$(1)FLAGS) -cp bindings/java/classes$(1)/main -d bindings/java/classes$(1)/test bindings/java/src$(1)/test/com/apple/foundationdb/test/*.java
|
||||||
@echo timestamp > bindings/java/.classstamp$(1)
|
@echo timestamp > bindings/java/.classstamp$(1)
|
||||||
|
|
||||||
javadoc$(1): $$(JAVA$(1)_SOURCES) bindings/java/src$(1)/main/overview.html
|
javadoc$(1): $$(JAVA$(1)_SOURCES) bindings/java/src$(1)/main/overview.html
|
||||||
|
@ -101,7 +101,7 @@ define add_java_binding_targets
|
||||||
-windowtitle "FoundationDB Java Client API" \
|
-windowtitle "FoundationDB Java Client API" \
|
||||||
-doctitle "FoundationDB Java Client API" \
|
-doctitle "FoundationDB Java Client API" \
|
||||||
-link "http://docs.oracle.com/javase/8/docs/api" \
|
-link "http://docs.oracle.com/javase/8/docs/api" \
|
||||||
com.apple.cie.foundationdb.org.apple.cie.foundationdb.async com.apple.cie.foundationdb.tuple com.apple.cie.foundationdb.directory com.apple.cie.foundationdb.subspace
|
com.apple.foundationdb.org.apple.foundationdb.async com.apple.foundationdb.tuple com.apple.foundationdb.directory com.apple.foundationdb.subspace
|
||||||
|
|
||||||
javadoc$(1)_clean:
|
javadoc$(1)_clean:
|
||||||
@rm -rf $$(JAVADOC_DIR)/javadoc$(1)
|
@rm -rf $$(JAVADOC_DIR)/javadoc$(1)
|
||||||
|
@ -152,7 +152,7 @@ define add_java_binding_targets
|
||||||
packages/fdb-java$(1)-$$(JARVER)-sources.jar: $$(JAVA$(1)_GENERATED_SOURCES) versions.target
|
packages/fdb-java$(1)-$$(JARVER)-sources.jar: $$(JAVA$(1)_GENERATED_SOURCES) versions.target
|
||||||
@echo "Building $$@"
|
@echo "Building $$@"
|
||||||
@rm -f $$@
|
@rm -f $$@
|
||||||
@jar cf $(TOPDIR)/$$@ -C bindings/java/src$(1)/main com/apple/apple/foundationdbdb
|
@jar cf $(TOPDIR)/$$@ -C bindings/java/src$(1)/main com/apple/foundationdb
|
||||||
|
|
||||||
packages/fdb-java$(1)-$$(JARVER)-javadoc.jar: javadoc$(1) versions.target
|
packages/fdb-java$(1)-$$(JARVER)-javadoc.jar: javadoc$(1) versions.target
|
||||||
@echo "Building $$@"
|
@echo "Building $$@"
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.tuple;
|
package com.apple.foundationdb.tuple;
|
||||||
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Suite;
|
import org.junit.runners.Suite;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.tuple;
|
package com.apple.foundationdb.tuple;
|
||||||
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
@ -29,7 +29,7 @@ import static org.junit.Assert.fail;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A FoundationDB object with native resources that can be freed. It is not mandatory to call
|
* A FoundationDB object with native resources that can be freed. It is not mandatory to call
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
@ -165,7 +165,7 @@ public class FDB {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connects to the cluster specified by the
|
* Connects to the cluster specified by the
|
||||||
* <a href="https://foundationdb.com/documentation/api-general.html#default-cluster-file" target="_blank">default fdb.cluster file</a>.
|
* <a href="https://foundationdb.org/documentation/api-general.html#default-cluster-file" target="_blank">default fdb.cluster file</a>.
|
||||||
* If the FoundationDB network has not been started, it will be started in the course of this call
|
* If the FoundationDB network has not been started, it will be started in the course of this call
|
||||||
* as if {@link FDB#startNetwork()} had been called.
|
* as if {@link FDB#startNetwork()} had been called.
|
||||||
*
|
*
|
||||||
|
@ -230,7 +230,7 @@ public class FDB {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes networking, connects with the
|
* Initializes networking, connects with the
|
||||||
* <a href="https://foundationdb.com/documentation/api-general.html#default-cluster-file" target="_blank">default fdb.cluster file</a>,
|
* <a href="https://foundationdb.org/documentation/api-general.html#default-cluster-file" target="_blank">default fdb.cluster file</a>,
|
||||||
* and opens the database.
|
* and opens the database.
|
||||||
*
|
*
|
||||||
* @return a {@code CompletableFuture} that will be set to a FoundationDB {@link Database}
|
* @return a {@code CompletableFuture} that will be set to a FoundationDB {@link Database}
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CompletionException;
|
import java.util.concurrent.CompletionException;
|
||||||
|
@ -28,7 +28,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.async.AsyncUtil;
|
import com.apple.foundationdb.async.AsyncUtil;
|
||||||
|
|
||||||
class FDBDatabase extends DefaultDisposableImpl implements Database, Disposable, OptionConsumer {
|
class FDBDatabase extends DefaultDisposableImpl implements Database, Disposable, OptionConsumer {
|
||||||
private DatabaseOptions options;
|
private DatabaseOptions options;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CompletionException;
|
import java.util.concurrent.CompletionException;
|
||||||
|
@ -26,8 +26,8 @@ import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.async.*;
|
import com.apple.foundationdb.async.*;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
|
|
||||||
class FDBTransaction extends DefaultDisposableImpl implements Disposable, Transaction, OptionConsumer {
|
class FDBTransaction extends DefaultDisposableImpl implements Disposable, Transaction, OptionConsumer {
|
||||||
private final Database database;
|
private final Database database;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
|
@ -18,9 +18,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@code KeySelector} identifies a particular key in the database. FoundationDB's
|
* A {@code KeySelector} identifies a particular key in the database. FoundationDB's
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -27,10 +27,10 @@ import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CompletionException;
|
import java.util.concurrent.CompletionException;
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterable;
|
import com.apple.foundationdb.async.AsyncIterable;
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterator;
|
import com.apple.foundationdb.async.AsyncIterator;
|
||||||
import com.apple.cie.foundationdb.async.AsyncUtil;
|
import com.apple.foundationdb.async.AsyncUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The FoundationDB API comes with a set of functions for discovering the
|
* The FoundationDB API comes with a set of functions for discovering the
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An object on which encoded options can be set. Rarely used outside of
|
* An object on which encoded options can be set. Rarely used outside of
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
|
@ -18,11 +18,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple description of an exact range of keyspace, specified by a begin and end key. As with
|
* A simple description of an exact range of keyspace, specified by a begin and end key. As with
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
|
@ -27,9 +27,9 @@ import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterable;
|
import com.apple.foundationdb.async.AsyncIterable;
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterator;
|
import com.apple.foundationdb.async.AsyncIterator;
|
||||||
import com.apple.cie.foundationdb.async.AsyncUtil;
|
import com.apple.foundationdb.async.AsyncUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a query against FoundationDB for a range of keys. The
|
* Represents a query against FoundationDB for a range of keys. The
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
class RangeResultInfo {
|
class RangeResultInfo {
|
||||||
RangeResultSummary getSummary() {
|
RangeResultSummary getSummary() {
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
class RangeResultSummary {
|
class RangeResultSummary {
|
||||||
final byte[] lastKey;
|
final byte[] lastKey;
|
|
@ -18,13 +18,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterable;
|
import com.apple.foundationdb.async.AsyncIterable;
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterator;
|
import com.apple.foundationdb.async.AsyncIterator;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A read-only subset of a FoundationDB {@link Transaction}. This is the interface that
|
* A read-only subset of a FoundationDB {@link Transaction}. This is the interface that
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
|
@ -18,11 +18,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Transaction represents a FoundationDB database transaction. All operations on FoundationDB
|
* A Transaction represents a FoundationDB database transaction. All operations on FoundationDB
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.async;
|
package com.apple.foundationdb.async;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
|
@ -18,13 +18,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.async;
|
package com.apple.foundationdb.async;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Disposable;
|
import com.apple.foundationdb.Disposable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A version of {@code Iterator} that allows for non-blocking iteration over elements.
|
* A version of {@code Iterator} that allows for non-blocking iteration over elements.
|
|
@ -18,11 +18,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.async;
|
package com.apple.foundationdb.async;
|
||||||
|
|
||||||
import static com.apple.cie.foundationdb.FDB.DEFAULT_EXECUTOR;
|
import static com.apple.foundationdb.FDB.DEFAULT_EXECUTOR;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.FDBException;
|
import com.apple.foundationdb.FDBException;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.async;
|
package com.apple.foundationdb.async;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes an operation or signal that can be cancelled. Cancellation will be assumed
|
* Describes an operation or signal that can be cancelled. Cancellation will be assumed
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.async;
|
package com.apple.foundationdb.async;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An {@link Exception} that can be duplicated with a new backtrace.
|
* An {@link Exception} that can be duplicated with a new backtrace.
|
|
@ -22,4 +22,4 @@
|
||||||
* Provides additional constructs for asynchronous programming against Java's {@link java.util.concurrent.CompletableFuture CompletableFuture}s.
|
* Provides additional constructs for asynchronous programming against Java's {@link java.util.concurrent.CompletableFuture CompletableFuture}s.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.apple.cie.foundationdb.async;
|
package com.apple.foundationdb.async;
|
|
@ -18,16 +18,16 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
import static com.apple.cie.foundationdb.directory.DirectoryLayer.EMPTY_BYTES;
|
import static com.apple.foundationdb.directory.DirectoryLayer.EMPTY_BYTES;
|
||||||
import static com.apple.cie.foundationdb.directory.DirectoryLayer.EMPTY_PATH;
|
import static com.apple.foundationdb.directory.DirectoryLayer.EMPTY_PATH;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.ReadTransactionContext;
|
import com.apple.foundationdb.ReadTransactionContext;
|
||||||
import com.apple.cie.foundationdb.TransactionContext;
|
import com.apple.foundationdb.TransactionContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a directory in the {@code DirectoryLayer}. A {@code Directory} stores the path
|
* Represents a directory in the {@code DirectoryLayer}. A {@code Directory} stores the path
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
||||||
|
@ -31,19 +31,19 @@ import java.util.Random;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.KeyValue;
|
import com.apple.foundationdb.KeyValue;
|
||||||
import com.apple.cie.foundationdb.MutationType;
|
import com.apple.foundationdb.MutationType;
|
||||||
import com.apple.cie.foundationdb.Range;
|
import com.apple.foundationdb.Range;
|
||||||
import com.apple.cie.foundationdb.ReadTransaction;
|
import com.apple.foundationdb.ReadTransaction;
|
||||||
import com.apple.cie.foundationdb.ReadTransactionContext;
|
import com.apple.foundationdb.ReadTransactionContext;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.TransactionContext;
|
import com.apple.foundationdb.TransactionContext;
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterable;
|
import com.apple.foundationdb.async.AsyncIterable;
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterator;
|
import com.apple.foundationdb.async.AsyncIterator;
|
||||||
import com.apple.cie.foundationdb.async.AsyncUtil;
|
import com.apple.foundationdb.async.AsyncUtil;
|
||||||
import com.apple.cie.foundationdb.subspace.Subspace;
|
import com.apple.foundationdb.subspace.Subspace;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a class for managing directories in FoundationDB.
|
* Provides a class for managing directories in FoundationDB.
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -18,16 +18,16 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
import static com.apple.cie.foundationdb.directory.DirectoryLayer.DEFAULT_NODE_SUBSPACE_PREFIX;
|
import static com.apple.foundationdb.directory.DirectoryLayer.DEFAULT_NODE_SUBSPACE_PREFIX;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.subspace.Subspace;
|
import com.apple.foundationdb.subspace.Subspace;
|
||||||
import com.apple.cie.foundationdb.Range;
|
import com.apple.foundationdb.Range;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@code DirectoryPartition} is a {@link DirectorySubspace} whose prefix is prepended to all of its descendant directories' prefixes.
|
* A {@code DirectoryPartition} is a {@link DirectorySubspace} whose prefix is prepended to all of its descendant directories' prefixes.
|
|
@ -18,20 +18,20 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
import static com.apple.cie.foundationdb.directory.DirectoryLayer.EMPTY_BYTES;
|
import static com.apple.foundationdb.directory.DirectoryLayer.EMPTY_BYTES;
|
||||||
import static com.apple.cie.foundationdb.directory.DirectoryLayer.EMPTY_PATH;
|
import static com.apple.foundationdb.directory.DirectoryLayer.EMPTY_PATH;
|
||||||
import static com.apple.cie.foundationdb.tuple.ByteArrayUtil.printable;
|
import static com.apple.foundationdb.tuple.ByteArrayUtil.printable;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.ReadTransactionContext;
|
import com.apple.foundationdb.ReadTransactionContext;
|
||||||
import com.apple.cie.foundationdb.TransactionContext;
|
import com.apple.foundationdb.TransactionContext;
|
||||||
import com.apple.cie.foundationdb.subspace.Subspace;
|
import com.apple.foundationdb.subspace.Subspace;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A DirectorySubspace represents the <i>contents</i> of a directory, but it
|
* A DirectorySubspace represents the <i>contents</i> of a directory, but it
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An {@link Exception} that is thrown when the version of the directory layer
|
* An {@link Exception} that is thrown when the version of the directory layer
|
|
@ -18,9 +18,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
|
@ -35,4 +35,4 @@
|
||||||
* directory documentation</a> for information about how directories work and
|
* directory documentation</a> for information about how directories work and
|
||||||
* interact with other parts of the built-in keyspace management features.
|
* interact with other parts of the built-in keyspace management features.
|
||||||
*/
|
*/
|
||||||
package com.apple.cie.foundationdb.directory;
|
package com.apple.foundationdb.directory;
|
|
@ -20,16 +20,16 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides an API for the FoundationDB transactional key/value store. Clients operating
|
* Provides an API for the FoundationDB transactional key/value store. Clients operating
|
||||||
* on a {@link com.apple.cie.foundationdb.Database} should, in most cases, use the
|
* on a {@link com.apple.foundationdb.Database} should, in most cases, use the
|
||||||
* {@link com.apple.cie.foundationdb.TransactionContext#run(Function) run(Function)}
|
* {@link com.apple.foundationdb.TransactionContext#run(Function) run(Function)}
|
||||||
* or the
|
* or the
|
||||||
* {@link com.apple.cie.foundationdb.TransactionContext#runAsync(Function) runAsync(Function)}
|
* {@link com.apple.foundationdb.TransactionContext#runAsync(Function) runAsync(Function)}
|
||||||
* constructs. These two functions (and their two derivations) implement a proper
|
* constructs. These two functions (and their two derivations) implement a proper
|
||||||
* retry loop around the work that needs to get done and, in the case of {@code Database},
|
* retry loop around the work that needs to get done and, in the case of {@code Database},
|
||||||
* assure that {@link com.apple.cie.foundationdb.Transaction#commit()} has returned successfully
|
* assure that {@link com.apple.foundationdb.Transaction#commit()} has returned successfully
|
||||||
* before itself returning. If you are not able to use these functions for some reason
|
* before itself returning. If you are not able to use these functions for some reason
|
||||||
* please closely read and understand the other
|
* please closely read and understand the other
|
||||||
* <a href="/documentation/data-modeling.html#tuples">developer
|
* <a href="/documentation/data-modeling.html#tuples">developer
|
||||||
* documentation on FoundationDB transactions</a>.
|
* documentation on FoundationDB transactions</a>.
|
||||||
*/
|
*/
|
||||||
package com.apple.cie.foundationdb;
|
package com.apple.foundationdb;
|
|
@ -18,17 +18,17 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.subspace;
|
package com.apple.foundationdb.subspace;
|
||||||
|
|
||||||
import static com.apple.cie.foundationdb.tuple.ByteArrayUtil.join;
|
import static com.apple.foundationdb.tuple.ByteArrayUtil.join;
|
||||||
import static com.apple.cie.foundationdb.tuple.ByteArrayUtil.printable;
|
import static com.apple.foundationdb.tuple.ByteArrayUtil.printable;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Range;
|
import com.apple.foundationdb.Range;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
import com.apple.cie.foundationdb.tuple.Versionstamp;
|
import com.apple.foundationdb.tuple.Versionstamp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code Subspace} provide a convenient way to use {@link Tuple}s to define namespaces for
|
* {@code Subspace} provide a convenient way to use {@link Tuple}s to define namespaces for
|
|
@ -30,4 +30,4 @@
|
||||||
* subspace documentation</a> for information about how subspaces work and
|
* subspace documentation</a> for information about how subspaces work and
|
||||||
* interact with other parts of the built-in keyspace management features.
|
* interact with other parts of the built-in keyspace management features.
|
||||||
*/
|
*/
|
||||||
package com.apple.cie.foundationdb.subspace;
|
package com.apple.foundationdb.subspace;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.tuple;
|
package com.apple.foundationdb.tuple;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
@ -27,7 +27,7 @@ import java.util.Arrays;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility functions for operating on byte arrays. Although built for
|
* Utility functions for operating on byte arrays. Although built for
|
||||||
|
@ -368,12 +368,12 @@ public class ByteArrayUtil {
|
||||||
/**
|
/**
|
||||||
* Encode an 64-bit integer (long) into a byte array. Encodes the integer in little
|
* Encode an 64-bit integer (long) into a byte array. Encodes the integer in little
|
||||||
* endian byte order. The result is valid for use with
|
* endian byte order. The result is valid for use with
|
||||||
* {@link Transaction#mutate(com.apple.cie.foundationdb.MutationType, byte[], byte[]) Transaction.mutate(...)}.
|
* {@link Transaction#mutate(com.apple.foundationdb.MutationType, byte[], byte[]) Transaction.mutate(...)}.
|
||||||
*
|
*
|
||||||
* @param i the number to encode
|
* @param i the number to encode
|
||||||
* @return an 8-byte array containing the
|
* @return an 8-byte array containing the
|
||||||
*
|
*
|
||||||
* @see Transaction#mutate(com.apple.cie.foundationdb.MutationType, byte[], byte[])
|
* @see Transaction#mutate(com.apple.foundationdb.MutationType, byte[], byte[])
|
||||||
*/
|
*/
|
||||||
public static byte[] encodeInt(long i) {
|
public static byte[] encodeInt(long i) {
|
||||||
return ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(i).array();
|
return ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(i).array();
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.tuple;
|
package com.apple.foundationdb.tuple;
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.tuple;
|
package com.apple.foundationdb.tuple;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
@ -34,7 +34,7 @@ import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Range;
|
import com.apple.foundationdb.Range;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a set of elements that make up a sortable, typed key. This object
|
* Represents a set of elements that make up a sortable, typed key. This object
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.tuple;
|
package com.apple.foundationdb.tuple;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.tuple;
|
package com.apple.foundationdb.tuple;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
||||||
|
@ -152,8 +152,8 @@ public class Versionstamp implements Comparable<Versionstamp> {
|
||||||
* from the transaction resolver and used to construct this
|
* from the transaction resolver and used to construct this
|
||||||
* object. If the commit is still yet to occur, the <code>Versionstamp</code>
|
* object. If the commit is still yet to occur, the <code>Versionstamp</code>
|
||||||
* is considered incomplete. If one uses this class with
|
* is considered incomplete. If one uses this class with
|
||||||
* our {@link com.apple.cie.foundationdb.MutationType#SET_VERSIONSTAMPED_KEY SET_VERSIONSTAMPED_KEY}
|
* our {@link com.apple.foundationdb.MutationType#SET_VERSIONSTAMPED_KEY SET_VERSIONSTAMPED_KEY}
|
||||||
* or {@link com.apple.cie.foundationdb.MutationType#SET_VERSIONSTAMPED_VALUE SET_VERSIONSTAMPED_VALUE}
|
* or {@link com.apple.foundationdb.MutationType#SET_VERSIONSTAMPED_VALUE SET_VERSIONSTAMPED_VALUE}
|
||||||
* mutations, then the appropriate bytes should be filled in within
|
* mutations, then the appropriate bytes should be filled in within
|
||||||
* the database during the commit.
|
* the database during the commit.
|
||||||
*
|
*
|
||||||
|
@ -169,8 +169,8 @@ public class Versionstamp implements Comparable<Versionstamp> {
|
||||||
* If this <code>Versionstamp</code> is not complete, the first
|
* If this <code>Versionstamp</code> is not complete, the first
|
||||||
* 10 bytes (representing the transaction version) will
|
* 10 bytes (representing the transaction version) will
|
||||||
* not be meaningful and one should probably use either the
|
* not be meaningful and one should probably use either the
|
||||||
* {@link com.apple.cie.foundationdb.MutationType#SET_VERSIONSTAMPED_KEY SET_VERSIONSTAMPED_KEY}
|
* {@link com.apple.foundationdb.MutationType#SET_VERSIONSTAMPED_KEY SET_VERSIONSTAMPED_KEY}
|
||||||
* or {@link com.apple.cie.foundationdb.MutationType#SET_VERSIONSTAMPED_VALUE SET_VERSIONSTAMPED_VALUE}
|
* or {@link com.apple.foundationdb.MutationType#SET_VERSIONSTAMPED_VALUE SET_VERSIONSTAMPED_VALUE}
|
||||||
* mutations.
|
* mutations.
|
||||||
*
|
*
|
||||||
* <b>Warning:</b> For performance reasons, this method does not create a copy of
|
* <b>Warning:</b> For performance reasons, this method does not create a copy of
|
|
@ -20,10 +20,10 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a set of utilities for serializing and deserializing typed data
|
* Provides a set of utilities for serializing and deserializing typed data
|
||||||
* for use in FoundationDB. When packed together into a {@link com.apple.cie.foundationdb.tuple.Tuple}
|
* for use in FoundationDB. When packed together into a {@link com.apple.foundationdb.tuple.Tuple}
|
||||||
* this data is suitable for use as an index or organizational structure within FoundationDB
|
* this data is suitable for use as an index or organizational structure within FoundationDB
|
||||||
* keyspace. See <a href="/documentation/data-modeling.html#tuples">general Tuple
|
* keyspace. See <a href="/documentation/data-modeling.html#tuples">general Tuple
|
||||||
* documentation</a> for information about how Tuples sort and can be used to efficiently
|
* documentation</a> for information about how Tuples sort and can be used to efficiently
|
||||||
* model data.
|
* model data.
|
||||||
*/
|
*/
|
||||||
package com.apple.cie.foundationdb.tuple;
|
package com.apple.foundationdb.tuple;
|
|
@ -24,18 +24,18 @@ and add it to your classpath.<br>
|
||||||
<br>
|
<br>
|
||||||
<h3>Getting started</h3>
|
<h3>Getting started</h3>
|
||||||
To start using FoundationDB from Java, create an instance of the
|
To start using FoundationDB from Java, create an instance of the
|
||||||
{@link com.apple.cie.foundationdb.FDB FoundationDB API interface} with the version 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 only version {@code 500}).
|
API that you want to use (this release of the FoundationDB Java API supports only version {@code 500}).
|
||||||
With this API object you can then open {@link com.apple.cie.foundationdb.Cluster Cluster}s and
|
With this API object you can then open {@link com.apple.foundationdb.Cluster Cluster}s and
|
||||||
{@link com.apple.cie.foundationdb.Database Database}s and start using
|
{@link com.apple.foundationdb.Database Database}s and start using
|
||||||
{@link com.apple.cie.foundationdb.Transaction Transactions}s.
|
{@link com.apple.foundationdb.Transaction Transactions}s.
|
||||||
Here we give an example. The example relies on a cluster file at the
|
Here we give an example. The example relies on a cluster file at the
|
||||||
<a href="/documentation/api-general.html#default-cluster-file">default location</a>
|
<a href="/documentation/api-general.html#default-cluster-file">default location</a>
|
||||||
for your platform and a running server.<br>
|
for your platform and a running server.<br>
|
||||||
<br>
|
<br>
|
||||||
<pre>
|
<pre>
|
||||||
{@code
|
{@code
|
||||||
import com.apple.cie.foundationdb.*;
|
import com.apple.foundationdb.*;
|
||||||
import Function;
|
import Function;
|
||||||
import Tuple;
|
import Tuple;
|
||||||
|
|
||||||
|
@ -64,21 +64,21 @@ public class Example {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
<h3>FoundationDB {@link com.apple.cie.foundationdb.tuple Tuple API}</h3>
|
<h3>FoundationDB {@link com.apple.foundationdb.tuple Tuple API}</h3>
|
||||||
The {@link com.apple.cie.foundationdb.tuple Tuple API} is provided with the core Java API for FoundationDB.
|
The {@link com.apple.foundationdb.tuple Tuple API} is provided with the core Java API for FoundationDB.
|
||||||
This layer is provided in some form in all official language bindings. It enables
|
This layer is provided in some form in all official language bindings. It enables
|
||||||
cross-language support for storing and retrieving typed data from the
|
cross-language support for storing and retrieving typed data from the
|
||||||
binary data that FoundationDB supports. And, just as importantly, data packed into
|
binary data that FoundationDB supports. And, just as importantly, data packed into
|
||||||
{@code Tuple}s and used as keys sort in predictable and useful ways. See the
|
{@code Tuple}s and used as keys sort in predictable and useful ways. See the
|
||||||
{@link com.apple.cie.foundationdb.tuple Tuple class documentation} for information about use in Java
|
{@link com.apple.foundationdb.tuple Tuple class documentation} for information about use in Java
|
||||||
and <a href="/documentation/data-modeling.html#tuples">general Tuple documentation</a>
|
and <a href="/documentation/data-modeling.html#tuples">general Tuple documentation</a>
|
||||||
for information about how Tuples sort and can be used to efficiently model data.
|
for information about how Tuples sort and can be used to efficiently model data.
|
||||||
<br>
|
<br>
|
||||||
<h3>FoundationDB {@link com.apple.cie.foundationdb.directory Directory API}</h3>
|
<h3>FoundationDB {@link com.apple.foundationdb.directory Directory API}</h3>
|
||||||
The {@link com.apple.cie.foundationdb.directory Directory API} is provided with the core
|
The {@link com.apple.foundationdb.directory Directory API} is provided with the core
|
||||||
Java API for FoundationDB. This layer is provided in some form in all official
|
Java API for FoundationDB. This layer is provided in some form in all official
|
||||||
language bindings. The FoundationDB API provides directories as a tool for
|
language bindings. The FoundationDB API provides directories as a tool for
|
||||||
managing related {@link com.apple.cie.foundationdb.subspace.Subspace Subspace}s. Directories are a
|
managing related {@link com.apple.foundationdb.subspace.Subspace Subspace}s. Directories are a
|
||||||
recommended approach for administering applications. Each application should
|
recommended approach for administering applications. Each application should
|
||||||
create or open at least one directory to manage its subspaces. Directories are
|
create or open at least one directory to manage its subspaces. Directories are
|
||||||
identified by hierarchical paths analogous to the paths in a Unix-like file system.
|
identified by hierarchical paths analogous to the paths in a Unix-like file system.
|
||||||
|
|
|
@ -18,10 +18,10 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -27,14 +27,14 @@ import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Range;
|
import com.apple.foundationdb.Range;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.async.AsyncUtil;
|
import com.apple.foundationdb.async.AsyncUtil;
|
||||||
import com.apple.cie.foundationdb.directory.Directory;
|
import com.apple.foundationdb.directory.Directory;
|
||||||
import com.apple.cie.foundationdb.directory.DirectoryLayer;
|
import com.apple.foundationdb.directory.DirectoryLayer;
|
||||||
import com.apple.cie.foundationdb.directory.DirectorySubspace;
|
import com.apple.foundationdb.directory.DirectorySubspace;
|
||||||
import com.apple.cie.foundationdb.subspace.Subspace;
|
import com.apple.foundationdb.subspace.Subspace;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
class AsyncDirectoryExtension {
|
class AsyncDirectoryExtension {
|
||||||
List<Object> dirList = new ArrayList<Object>();
|
List<Object> dirList = new ArrayList<Object>();
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
public class AsyncPerformanceTester {
|
public class AsyncPerformanceTester {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -28,19 +28,19 @@ import java.nio.ByteOrder;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Cluster;
|
import com.apple.foundationdb.Cluster;
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.FDBException;
|
import com.apple.foundationdb.FDBException;
|
||||||
import com.apple.cie.foundationdb.KeySelector;
|
import com.apple.foundationdb.KeySelector;
|
||||||
import com.apple.cie.foundationdb.KeyValue;
|
import com.apple.foundationdb.KeyValue;
|
||||||
import com.apple.cie.foundationdb.MutationType;
|
import com.apple.foundationdb.MutationType;
|
||||||
import com.apple.cie.foundationdb.Range;
|
import com.apple.foundationdb.Range;
|
||||||
import com.apple.cie.foundationdb.StreamingMode;
|
import com.apple.foundationdb.StreamingMode;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.async.AsyncUtil;
|
import com.apple.foundationdb.async.AsyncUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
public class AsyncStackTester {
|
public class AsyncStackTester {
|
||||||
static final String DIRECTORY_PREFIX = "DIRECTORY_";
|
static final String DIRECTORY_PREFIX = "DIRECTORY_";
|
|
@ -18,15 +18,15 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
|
|
||||||
public class BlockingBenchmark {
|
public class BlockingBenchmark {
|
||||||
private static final int REPS = 100000;
|
private static final int REPS = 100000;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
|
@ -28,9 +28,9 @@ import java.util.concurrent.Semaphore;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
|
|
||||||
public class ConcurrentGetSetGet {
|
public class ConcurrentGetSetGet {
|
||||||
public static final Charset UTF8 = Charset.forName("UTF-8");
|
public static final Charset UTF8 = Charset.forName("UTF-8");
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -28,14 +28,14 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDBException;
|
import com.apple.foundationdb.FDBException;
|
||||||
import com.apple.cie.foundationdb.KeySelector;
|
import com.apple.foundationdb.KeySelector;
|
||||||
import com.apple.cie.foundationdb.Range;
|
import com.apple.foundationdb.Range;
|
||||||
import com.apple.cie.foundationdb.StreamingMode;
|
import com.apple.foundationdb.StreamingMode;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
abstract class Context implements Runnable {
|
abstract class Context implements Runnable {
|
||||||
final Stack stack = new Stack();
|
final Stack stack = new Stack();
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -26,12 +26,12 @@ import java.util.List;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Range;
|
import com.apple.foundationdb.Range;
|
||||||
import com.apple.cie.foundationdb.directory.Directory;
|
import com.apple.foundationdb.directory.Directory;
|
||||||
import com.apple.cie.foundationdb.directory.DirectoryLayer;
|
import com.apple.foundationdb.directory.DirectoryLayer;
|
||||||
import com.apple.cie.foundationdb.directory.DirectorySubspace;
|
import com.apple.foundationdb.directory.DirectorySubspace;
|
||||||
import com.apple.cie.foundationdb.subspace.Subspace;
|
import com.apple.foundationdb.subspace.Subspace;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
class DirectoryExtension {
|
class DirectoryExtension {
|
||||||
List<Object> dirList = new ArrayList<Object>();
|
List<Object> dirList = new ArrayList<Object>();
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
enum DirectoryOperation {
|
enum DirectoryOperation {
|
||||||
DIRECTORY_CREATE_SUBSPACE(true),
|
DIRECTORY_CREATE_SUBSPACE(true),
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -26,13 +26,13 @@ import java.util.List;
|
||||||
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Cluster;
|
import com.apple.foundationdb.Cluster;
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.TransactionContext;
|
import com.apple.foundationdb.TransactionContext;
|
||||||
import com.apple.cie.foundationdb.directory.DirectoryLayer;
|
import com.apple.foundationdb.directory.DirectoryLayer;
|
||||||
import com.apple.cie.foundationdb.directory.DirectorySubspace;
|
import com.apple.foundationdb.directory.DirectorySubspace;
|
||||||
|
|
||||||
public class DirectoryTest {
|
public class DirectoryTest {
|
||||||
private static final String CLUSTER_FILE = "/home/ajb/fdb.cluster";
|
private static final String CLUSTER_FILE = "/home/ajb/fdb.cluster";
|
|
@ -18,15 +18,15 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.async.AsyncUtil;
|
import com.apple.foundationdb.async.AsyncUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
class DirectoryUtil {
|
class DirectoryUtil {
|
||||||
private static class TuplePopper {
|
private static class TuplePopper {
|
|
@ -18,15 +18,15 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
public class Example {
|
public class Example {
|
||||||
public static void main(String[] args) throws ExecutionException, InterruptedException {
|
public static void main(String[] args) throws ExecutionException, InterruptedException {
|
|
@ -18,16 +18,16 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.ReadTransaction;
|
import com.apple.foundationdb.ReadTransaction;
|
||||||
import com.apple.cie.foundationdb.ReadTransactionContext;
|
import com.apple.foundationdb.ReadTransactionContext;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.TransactionContext;
|
import com.apple.foundationdb.TransactionContext;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -18,17 +18,17 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Cluster;
|
import com.apple.foundationdb.Cluster;
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.KeyValue;
|
import com.apple.foundationdb.KeyValue;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.TransactionContext;
|
import com.apple.foundationdb.TransactionContext;
|
||||||
|
|
||||||
public class IterableTest {
|
public class IterableTest {
|
||||||
private static final String CLUSTER_FILE = "C:\\Users\\Ben\\workspace\\fdb\\fdb.cluster";
|
private static final String CLUSTER_FILE = "C:\\Users\\Ben\\workspace\\fdb\\fdb.cluster";
|
|
@ -18,18 +18,18 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.LocalityUtil;
|
import com.apple.foundationdb.LocalityUtil;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterable;
|
import com.apple.foundationdb.async.AsyncIterable;
|
||||||
import com.apple.cie.foundationdb.async.AsyncUtil;
|
import com.apple.foundationdb.async.AsyncUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
|
|
||||||
public class LocalityTests {
|
public class LocalityTests {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
@ -28,14 +28,14 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.KeyValue;
|
import com.apple.foundationdb.KeyValue;
|
||||||
import com.apple.cie.foundationdb.StreamingMode;
|
import com.apple.foundationdb.StreamingMode;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterable;
|
import com.apple.foundationdb.async.AsyncIterable;
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterator;
|
import com.apple.foundationdb.async.AsyncIterator;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
|
|
||||||
public class ParallelRandomScan {
|
public class ParallelRandomScan {
|
||||||
private static final int ROWS = 1000000;
|
private static final int ROWS = 1000000;
|
|
@ -18,14 +18,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.KeySelector;
|
import com.apple.foundationdb.KeySelector;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.TransactionContext;
|
import com.apple.foundationdb.TransactionContext;
|
||||||
import com.apple.cie.foundationdb.async.AsyncUtil;
|
import com.apple.foundationdb.async.AsyncUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
|
@ -18,11 +18,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
|
@ -18,20 +18,20 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletionException;
|
import java.util.concurrent.CompletionException;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.FDBException;
|
import com.apple.foundationdb.FDBException;
|
||||||
import com.apple.cie.foundationdb.KeySelector;
|
import com.apple.foundationdb.KeySelector;
|
||||||
import com.apple.cie.foundationdb.KeyValue;
|
import com.apple.foundationdb.KeyValue;
|
||||||
import com.apple.cie.foundationdb.Range;
|
import com.apple.foundationdb.Range;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterable;
|
import com.apple.foundationdb.async.AsyncIterable;
|
||||||
|
|
||||||
public class RangeTest {
|
public class RangeTest {
|
||||||
private static final int API_VERSION = 500;
|
private static final int API_VERSION = 500;
|
|
@ -18,15 +18,15 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
|
|
||||||
public class SerialInsertion {
|
public class SerialInsertion {
|
||||||
private static final int THREAD_COUNT = 10;
|
private static final int THREAD_COUNT = 10;
|
|
@ -18,20 +18,20 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.KeyValue;
|
import com.apple.foundationdb.KeyValue;
|
||||||
import com.apple.cie.foundationdb.ReadTransaction;
|
import com.apple.foundationdb.ReadTransaction;
|
||||||
import com.apple.cie.foundationdb.StreamingMode;
|
import com.apple.foundationdb.StreamingMode;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterable;
|
import com.apple.foundationdb.async.AsyncIterable;
|
||||||
|
|
||||||
public class SerialIteration {
|
public class SerialIteration {
|
||||||
private static final int ROWS = 1000000;
|
private static final int ROWS = 1000000;
|
|
@ -18,16 +18,16 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Cluster;
|
import com.apple.foundationdb.Cluster;
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.TransactionContext;
|
import com.apple.foundationdb.TransactionContext;
|
||||||
|
|
||||||
public class SerialTest {
|
public class SerialTest {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
class Stack {
|
class Stack {
|
||||||
java.util.Stack<StackEntry> stack = new java.util.Stack<StackEntry>();
|
java.util.Stack<StackEntry> stack = new java.util.Stack<StackEntry>();
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
class StackEntry {
|
class StackEntry {
|
||||||
int idx;
|
int idx;
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
enum StackOperation {
|
enum StackOperation {
|
||||||
PUSH,
|
PUSH,
|
|
@ -18,7 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -29,20 +29,20 @@ import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CompletionException;
|
import java.util.concurrent.CompletionException;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.Database;
|
import com.apple.foundationdb.Database;
|
||||||
import com.apple.cie.foundationdb.FDB;
|
import com.apple.foundationdb.FDB;
|
||||||
import com.apple.cie.foundationdb.FDBException;
|
import com.apple.foundationdb.FDBException;
|
||||||
import com.apple.cie.foundationdb.KeySelector;
|
import com.apple.foundationdb.KeySelector;
|
||||||
import com.apple.cie.foundationdb.KeyValue;
|
import com.apple.foundationdb.KeyValue;
|
||||||
import com.apple.cie.foundationdb.LocalityUtil;
|
import com.apple.foundationdb.LocalityUtil;
|
||||||
import com.apple.cie.foundationdb.MutationType;
|
import com.apple.foundationdb.MutationType;
|
||||||
import com.apple.cie.foundationdb.Range;
|
import com.apple.foundationdb.Range;
|
||||||
import com.apple.cie.foundationdb.ReadTransaction;
|
import com.apple.foundationdb.ReadTransaction;
|
||||||
import com.apple.cie.foundationdb.StreamingMode;
|
import com.apple.foundationdb.StreamingMode;
|
||||||
import com.apple.cie.foundationdb.Transaction;
|
import com.apple.foundationdb.Transaction;
|
||||||
import com.apple.cie.foundationdb.async.AsyncIterable;
|
import com.apple.foundationdb.async.AsyncIterable;
|
||||||
import com.apple.cie.foundationdb.tuple.ByteArrayUtil;
|
import com.apple.foundationdb.tuple.ByteArrayUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements a cross-binding test of the FoundationDB API.
|
* Implements a cross-binding test of the FoundationDB API.
|
|
@ -18,17 +18,17 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.apple.cie.foundationdb.test;
|
package com.apple.foundationdb.test;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CompletionException;
|
import java.util.concurrent.CompletionException;
|
||||||
|
|
||||||
import com.apple.cie.foundationdb.FDBException;
|
import com.apple.foundationdb.FDBException;
|
||||||
import com.apple.cie.foundationdb.KeySelector;
|
import com.apple.foundationdb.KeySelector;
|
||||||
import com.apple.cie.foundationdb.async.AsyncUtil;
|
import com.apple.foundationdb.async.AsyncUtil;
|
||||||
import com.apple.cie.foundationdb.tuple.Tuple;
|
import com.apple.foundationdb.tuple.Tuple;
|
||||||
|
|
||||||
public class StackUtils {
|
public class StackUtils {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue