Quasardb main abstraction layer. The following operations are allowed:
Usage example :
// First : create a configuration object.
QuasardbConfig config = new QuasardbConfig();
// Second : create a node object
QuasardbNode node = new QuasardbNode("127.0.0.1", 1234);
// Third : add new node to config
config.addNode(node);
// Fourth : create a related quasardb instance.
Quasardb qdb = new Quasardb(config);
// Or you can supply the configuration later :
// Quasardb qdb = new Quasardb();
// qdb.setConfig(config);
// Fifth : connect to quasardb cluster.
qdb.connect();
// Sixth : use the quasardb instance :
qdb.put("foo", new String("bar"));
System.out.println(" => key 'foo' contains : " + qdb.get("foo"));
// Seventh : disconnect from the quasardb cluster
// Notice that this step is optional
qdb.close();
Note about entries :
| Author: | © quasardb - 2014 |
|---|
Create a quasardb instance with the provided configuration. The configuration must have the following parameters :
Example :
// First : create a configuration.
QuasardbConfig config = new QuasardbConfig();
// Second : add a node to the configuration
QuasardbNode node = new QuasardbNode("127.0.0.1", 2836);
config.addNode(node);
// Optionnaly set a default expiry time in seconds on all next entries
config.setExpiryTimeInSeconds(2);
// Second : create a related quasardb instance.
Quasardb myQuasardbInstance = new Quasardb(config);
| Parameters: |
|
|---|---|
| Throws: |
|
Close the connection to the quasardb instance and frees resources.
| Throws: |
|
|---|
Atomically compare an existing alias with comparand, updates it to new if they match and return the original value. Please note that entries starting with “qdb” are reserved.
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | the original value associated to the key |
Atomically compare an existing alias with comparand, updates it to new if they match and return the original value. Please note that entries starting with “qdb” are reserved.
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | the original value associated to the key |
Initialize connection to the quasardb instance and setup serialization framework.
| Throws: |
|
|---|
Get the entry associated with the supplied unique key (alias). Please note that entries starting with “qdb” are reserved.
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | the object’s related to the alias |
Update an existing alias with data and return its previous value. Please note that entries starting with “qdb” are reserved.
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | the previous value associated to the key |
Update an existing alias with data and return its previous value. Please note that entries starting with “qdb” are reserved.
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | the previous value associated to the key |
Retrieve the build version of the current quasardb instance.
| Throws: |
|
|---|---|
| Returns: | build version of the current quasardb instance. |
Get the current instance configuration.
| Throws: |
|
|---|---|
| Returns: | current quasardb configuration |
See also: QuasardbConfig
Retrieve the configuration of the current quasardb instance in JSON. JSON response has the following format :
{
"global":{
"depot":{
"replication_factor":1,
"root":"db",
"sync":false,
"transient":false
},
"limiter":{
"max_bytes":12883636224,
"max_in_entries_count":100000
}
},
"local":{
"chord":{
"bootstrapping_peers":[],
"no_stabilization":false,
"node_id":"5309f39a3f176b9-179cd55bd9dc83e5-c09beea926e4bb75-a460c8c4e5487da9"
},
"logger":{
"dump_file":"qdb_error_dump.txt",
"flush_interval":3,
"log_files":[],
"log_level":2,
"log_to_console":true,
"log_to_syslog":false
},
"network":{
"client_timeout":60,
"idle_timeout":300,
"listen_on":"127.0.0.1:2836",
"partitions_count":5,
"server_sessions":2000
},
"user":{
"license_file":"qdb.lic"
}
}
}
| Throws: |
|
|---|---|
| Returns: | configuration of the current quasardb instance. |
Retrieve the status of the current quasardb instance in JSON format. JSON response has the following format :
{
"engine_build_date":"87f8d02 2014-01-15 16:12:30 +0100",
"engine_version":"master",
"entries":
{
"persisted":{"count":0,"size":0},
"resident":{"count":0,"size":0}
},
"hardware_concurrency":6,
"memory":
{
"physmem":{"total":25767272448,"used":5493329920},
"vm":{"total":8796092891136,"used":417980416}
},
"network":{
"listening_address":"127.0.0.1",
"listening_port":2836,
"partitions":
{
"available_sessions":[1999,1999,2000,2000,2000],
"count":5,
"max_sessions":2000
}
},
"node_id":"5309f39a3f176b9-179cd55bd9dc83e5-c09beea926e4bb75-a460c8c4e5487da9",
"operating_system":"Microsoft Windows 7 Ultimate Edition Service Pack 1 (build 7601), 64-bit",
"operations":
{
"compare_and_swap":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"find":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"find_remove":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"find_update":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"put":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"remove":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"purge_all":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"remove_if":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"update":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
}
},
"overall":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"startup":"2014-01-20T15:01:11",
"timestamp":"2014-01-20T15:09:40"
}
| Throws: |
|
|---|---|
| Returns: | status of the current quasardb instance in JSON |
Retrieve the topology of the current quasardb instance in JSON. JSON response has the following format :
{
"center":{
"endpoint":"127.0.0.1:2836",
"reference":"5309f39a3f176b9-179cd55bd9dc83e5-c09beea926e4bb75-a460c8c4e5487da9"
},
"predecessor":{
"endpoint":"127.0.0.1:2836",
"reference":"5309f39a3f176b9-179cd55bd9dc83e5-c09beea926e4bb75-a460c8c4e5487da9"
},
"successor":{
"endpoint":"127.0.0.1:2836",
"reference":"5309f39a3f176b9-179cd55bd9dc83e5-c09beea926e4bb75-a460c8c4e5487da9"
}
}
| Throws: |
|
|---|---|
| Returns: | topology of the current quasardb instance. |
Get the default expiry time in seconds for all new entries. Return the 0 value if entries are eternal
| Returns: | 0 if entries are eternal, a value in seconds instead. |
|---|
Retrieve the expiry time in date for a provided alias
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | the expiry date related to the provided alias. |
Retrieve the expiry time in seconds for a provided alias
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | the expiry time in second related to the provided alias. 0 means eternal duration. |
Retrieve the configuration of the specific quasardb instance in JSON. JSON response has the following format :
{
"global":{
"depot":{
"replication_factor":1,
"root":"db",
"sync":false,
"transient":false
},
"limiter":{
"max_bytes":12883636224,
"max_in_entries_count":100000
}
},
"local":{
"chord":{
"bootstrapping_peers":[],
"no_stabilization":false,
"node_id":"5309f39a3f176b9-179cd55bd9dc83e5-c09beea926e4bb75-a460c8c4e5487da9"
},
"logger":{
"dump_file":"qdb_error_dump.txt",
"flush_interval":3,
"log_files":[],
"log_level":2,
"log_to_console":true,
"log_to_syslog":false
},
"network":{
"client_timeout":60,
"idle_timeout":300,
"listen_on":"127.0.0.1:2836",
"partitions_count":5,
"server_sessions":2000
},
"user":{
"license_file":"qdb.lic"
}
}
}
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | configuration of the current quasardb instance. |
Retrieve the status of the current quasardb instance in JSON format. JSON response has the following format :
{
"engine_build_date":"87f8d02 2014-01-15 16:12:30 +0100",
"engine_version":"master",
"entries":
{
"persisted":{"count":0,"size":0},
"resident":{"count":0,"size":0}
},
"hardware_concurrency":6,
"memory":
{
"physmem":{"total":25767272448,"used":5493329920},
"vm":{"total":8796092891136,
"used":417980416}
},
"network":{
"listening_address":"127.0.0.1",
"listening_port":2836,
"partitions":
{
"available_sessions":[1999,1999,2000,2000,2000],
"count":5,
"max_sessions":2000
}
},
"node_id":"5309f39a3f176b9-179cd55bd9dc83e5-c09beea926e4bb75-a460c8c4e5487da9",
"operating_system":"Microsoft Windows 7 Ultimate Edition Service Pack 1 (build 7601), 64-bit",
"operations":
{
"compare_and_swap":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"find":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"find_remove":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"find_update":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"put":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"remove":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"purge_all":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"remove_if":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"update":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
}
},
"overall":{
"count":0,
"evictions":0,
"failures":0,
"in_bytes":0,
"out_bytes":0,
"pageins":0,
"successes":0
},
"startup":"2014-01-20T15:01:11",
"timestamp":"2014-01-20T15:09:40"
}
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | status of the current quasardb instance in JSON |
Retrieve the topology of the current quasardb instance. JSON response has the following format :
{
"center":{
"endpoint":"127.0.0.1:2836",
"reference":"5309f39a3f176b9-179cd55bd9dc83e5-c09beea926e4bb75-a460c8c4e5487da9"
},
"predecessor":{
"endpoint":"127.0.0.1:2836",
"reference":"5309f39a3f176b9-179cd55bd9dc83e5-c09beea926e4bb75-a460c8c4e5487da9"
},
"successor":{
"endpoint":"127.0.0.1:2836",
"reference":"5309f39a3f176b9-179cd55bd9dc83e5-c09beea926e4bb75-a460c8c4e5487da9"
}
}
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | topology of the current quasardb instance. |
Atomically get the entry associated with the supplied unique key (alias) and remove it. Please note that entries starting with “qdb” are reserved.
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | the object’s related to the alias |
Retrieve the version of the current quasardb instance.
| Throws: |
|
|---|---|
| Returns: | version of the current quasardb instance. |
Quasardb implements Iterable for QuasardbEntry, providing support for simplified iteration. However iteration should be used with caution. It is an O(n) operation.
See also: java.lang.Iterable.iterator()
Delete all the stored objects in the current quasardb instance. Use with caution
| Throws: |
|
|---|
Adds an entry (value) to the current qdb instance under the alias key.
| Parameters: |
|
|---|---|
| Throws: |
|
Adds an entry (value) to the current qdb instance under the alias key.
| Parameters: |
|
|---|---|
| Throws: |
|
Delete the object associated with the alias key. Please note that entries starting with “qdb” are reserved.
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | true if alias has been removed. |
Atomically delete the object associated whith the alias key if the object is equal to comparand. Please note that entries starting with “qdb” are reserved.
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | true if provided alias has been removed |
Submit a list of operation which can increase performance when it is necessary to run many small operations. Using properly the batch operations requires :
| Parameters: |
|
|---|---|
| Returns: | All results of submitted operations in batch mode. See Results |
Updates the configuration properties
| Parameters: |
|
|---|---|
| Throws: |
|
See also: QuasardbConfig
Set the default expiry time in seconds for all next entries.
| Parameters: |
|
|---|---|
| Throws: |
|
Change the expiry time for a provided alias at the provided date.
| Parameters: |
|
|---|---|
| Throws: |
|
Change the expiry time in seconds for a provided alias
| Parameters: |
|
|---|---|
| Throws: |
|
Perform a search prefix based operation on all quasardb entries. Pay attention that :
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | all entries matching specified prefix |
Stop a specific node with a given reason.
| Parameters: |
|
|---|
Update an existing entry or create a new one. Please note that entries starting with “qdb” are reserved.
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | true if entry was updated |
Update an existing entry or create a new one. Please note that entries starting with “qdb” are reserved.
| Parameters: |
|
|---|---|
| Throws: |
|
| Returns: | true if entry was updated |