thrift.concourse.thrift Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of concourse Show documentation
Show all versions of concourse Show documentation
This is the api to interact with Concourse, a schemaless and distributed version control database with optimistic availability, serializable transactions and full-text search. Concourse provides a more intuitive approach to data management that is easy to deploy, access and scale with minimal tuning while also maintaining the referential integrity and ACID characteristics of traditional database systems.
# This file defines the RPC protocol for Concourse client/server interaction
# using Thrift. The services and resources that are defined in this file are
# not intended to be used by third parties, but they could be so they must meet
# high standards of quality.
#
# To generate java source code run:
# thrift -out ../../java -gen java concourse.thrift
#
# TODO IN ECLIPSE AFTER GENERATING (see THRIFT-2115)
# 0. Run "./gradlew clean eclipse" at Concourse root directory and refresh concourse directory
# 1. Replace Hash with LinkedHash
# 2. Replace shared.AccessToken with AccessToken
# 3. Add @SuppressWarnings({ "rawtypes", "serial", "unchecked", "unused" }) to class
# 4. shift + command + F to format
include "data.thrift"
include "shared.thrift"
namespace java org.cinchapi.concourse.thrift
/**
* The RPC protocol that forms the basis of cross-language client/server
* communication in Concourse. This is considered a public API; however
* it is intended to be wrapped in a more expressive APIs in the target
* implementation language.
*/
service ConcourseService {
/**
* Login to the service. A user must login to receive an {@link shared.AccessToken}
* which is required for all other method invocations.
*/
shared.AccessToken login(1: binary username, 2: binary password,
3: string environment) throws (1: shared.TSecurityException ex);
/**
* Logout of the service and deauthorize {@code token}.
*/
void logout(1: shared.AccessToken token, 2: string environment)
throws (1: shared.TSecurityException ex);
/**
* Turn on {@code staging} mode so that all subsequent changes are collected
* in a staging area before possibly being committed to the database. Staged
* operations are guaranteed to be reliable, all or nothing units of work that
* allow correct recovery from failures and provide isolation between clients
* so the database is always in a consistent state.
*
* After this method returns, all subsequent operations will be done in
* {@code staging} mode until either {@link #abort(shared.AccessToken)} or
* {@link #commit(shared.AccessToken)} is invoked.
*
*/
shared.TransactionToken stage(1: shared.AccessToken token, 2: string environment)
throws (1: shared.TSecurityException ex);
/**
* Abort and remove any changes that are currently sitting in the staging area.
*
* After this function returns, all subsequent operations will commit to the
* database immediately until {@link #stage(shared.AccessToken)} is invoked.
*
*/
void abort(1: shared.AccessToken creds, 2: shared.TransactionToken transaction,
3: string environment) throws (1: shared.TSecurityException ex);
/**
* Attempt to permanently commit all the changes that are currently sitting in
* the staging area to the database. This function only returns {@code true}
* if all the changes can be successfully applied to the database. Otherwise,
* this function returns {@code false} and all the changes are aborted.
*
* After this function returns, all subsequent operations will commit to the
* database immediately until {@link #stage(shared.AccessToken)} is invoked.
*
*/
bool commit(1: shared.AccessToken creds, 2: shared.TransactionToken transaction,
3: string environment) throws (1: shared.TSecurityException ex,
2: shared.TTransactionException ex2);
/**
* Add {@code key} as {@code value} to {@code record}. This method returns
* {@code true} if there is no mapping from {@code key} to {@code value}
* in {@code record} prior to invocation.
*/
bool add(1: string key, 2: data.TObject value, 3: i64 record, 4: shared.AccessToken creds,
5: shared.TransactionToken transaction, 6: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
/**
* Remove {@code key} as {@code value} from {@code record}. This method returns
* {@code true} if there is a mapping from {@code key} to {@code value} in
* {@code record} prior to invocation.
*/
bool remove(1: string key, 2: data.TObject value, 3: i64 record, 4: shared.AccessToken creds,
5: shared.TransactionToken transaction, 6: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
/**
* Audit {@code record} or {@code key} in {@code record}. This method returns a
* map from timestamp to a string describing the revision that occurred.
*/
map audit(1: i64 record, 2: string key, 3: shared.AccessToken creds,
4: shared.TransactionToken transaction, 5: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
/**
* Chronologize non-empty sets of values in {@code key} from {@code record}.
* This method returns a chronological mapping from each timestamp to the set
* of values that were contained for the key in record.
*/
map> chronologize(1: i64 record, 2: string key,
3: shared.AccessToken creds, 4: shared.TransactionToken transaction,
5: string environment) throws (1: shared.TSecurityException ex,
2: shared.TTransactionException ex2);
/**
* Describe {@code record} at {@code timestamp}. This method returns keys for
* fields in {@code record} that contain at least one value at {@code timestamp}.
*/
set describe(1: i64 record, 2: i64 timestamp, 3: shared.AccessToken creds,
4: shared.TransactionToken transaction, 5: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
/**
* Fetch {@code key} from {@code record} at {@code timestamp}. This method returns
* the values that exist in the field mapped from {@code key} at {@code timestamp}.
*/
set fetch(1: string key, 2: i64 record, 3: i64 timestamp,
4: shared.AccessToken creds, 5: shared.TransactionToken transaction,
6: string environment) throws (1: shared.TSecurityException ex,
2: shared.TTransactionException ex2);
/**
* Find {@code key} {@code operator} {@code values} at {@code timestamp}. This
* method returns the records that match the criteria at {@code timestamp}.
*/
set find(1: string key, 2: shared.Operator operator, 3: list values,
4: i64 timestamp, 5: shared.AccessToken creds, 6: shared.TransactionToken transaction,
7: string environment) throws (1: shared.TSecurityException ex,
2: shared.TTransactionException ex2);
/**
* Find the records that match the {@code criteria}.
*/
set find1(1: data.TCriteria criteria, 2: shared.AccessToken creds,
3: shared.TransactionToken transaction, 4: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
/**
* Ping {@code record}. This method returns {@code true} if {@code record} has at
* least one populated field.
*/
bool ping(1: i64 record, 2: shared.AccessToken creds, 3: shared.TransactionToken transaction,
4: string environment) throws (1: shared.TSecurityException ex,
2: shared.TTransactionException ex2);
/**
* Search {@code key} for {@code query}. This method returns the records that have
* a value matching {@code query} in the field mapped from {@code key}.
*/
set search(1: string key, 2: string query, 3: shared.AccessToken creds,
4: shared.TransactionToken transaction, 5: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
/**
* Verify {@code key} as {@code value} in {@code record} at {@code timestamp}. This
* method returns {@code true} if the field contains {@code value} at
* {@code timestamp}.
*/
bool verify(1: string key, 2: data.TObject value, 3: i64 record, 4: i64 timestamp,
5: shared.AccessToken creds, 6: shared.TransactionToken transaction,
7: string environment) throws (1: shared.TSecurityException ex,
2: shared.TTransactionException ex2);
/**
* Atomically revert {@code key} in {@code record} to {@code timestamp}.
*/
void revert(1: string key, 2: i64 record, 3: i64 timestamp, 4: shared.AccessToken creds,
5: shared.TransactionToken token, 6: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
/**
* Atomically clear {@code key} in {@code record} by removing every value that
* currently exists.
*/
void clear(1: string key, 2: i64 record, 3: shared.AccessToken creds,
4: shared.TransactionToken token, 5: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
/**
* Atomically set {@code key} as {@code value} in {@code record} by removing any
* values that currently exist and adding {@code value}.
*/
void set0(1: string key, 2: data.TObject value, 3: i64 record, 4: shared.AccessToken creds,
5: shared.TransactionToken token, 6: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
/**
* Atomically verify {@code key} as {@code expected} in {@code record} and swap
* with {@code replacement} if it exists.
*/
bool verifyAndSwap(1: string key, 2: data.TObject expected, 3: i64 record,
4: data.TObject replacement, 5: shared.AccessToken creds,
6: shared.TransactionToken token, 7: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
/**
* Return the release version of the server.
*/
string getServerVersion() throws (1: shared.TSecurityException ex,
2: shared.TTransactionException ex2);
/**
* Atomically add the key-value mappings defined in the {@code json} formatted
* string to {@code record}.
*/
bool insert(1: string json, 2: i64 record, 3: shared.AccessToken creds,
4: shared.TransactionToken token, 5: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
/**
* Return all the data that is presently contained in {@code record}.
*/
map> browse0(1: i64 record, 2: i64 timestamp,
3: shared.AccessToken creds, 4: shared.TransactionToken token,
5: string environment) throws (1: shared.TSecurityException ex,
2: shared.TTransactionException ex2);
/**
* Return an ordered mapping from each value associated with {@code key} to the
* set of records which contain the value.
*/
map> browse1(1: string key, 2: i64 timestamp,
3: shared.AccessToken creds, 4: shared.TransactionToken token,
5: string environment) throws (1: shared.TSecurityException ex,
2: shared.TTransactionException ex2);
/**
* Atomically clear all the keys in {@code record} by removing every value that
* currently exists for each key.
*/
void clear1(1: i64 record, 2: shared.AccessToken creds, 3: shared.TransactionToken token,
4: string environment) throws (1: shared.TSecurityException ex,
2: shared.TTransactionException ex2);
/**
* Return the environment of the server to client is using.
*/
string getServerEnvironment(1: shared.AccessToken creds, 2: shared.TransactionToken token,
3: string environment) throws (1: shared.TSecurityException ex,
2: shared.TTransactionException ex2);
/**
* Atomically add the key-value mappings defined in the {@code json} formatted
* string to a new record.
*/
i64 insert1(1: string json, 2: shared.AccessToken creds,
3: shared.TransactionToken token, 4: string environment)
throws (1: shared.TSecurityException ex, 2: shared.TTransactionException ex2);
}