Skip to content

Commit

Permalink
In-Progress Packaging / Documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jdduncan committed Oct 6, 2014
1 parent a537bea commit 710168d
Show file tree
Hide file tree
Showing 9 changed files with 281 additions and 96 deletions.
1 change: 1 addition & 0 deletions Adapter/adapter_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ global.api_dir = path.join(adapter_dir, "api");
global.spi_dir = path.join(adapter_dir, "impl");
global.spi_doc_dir = path.join(spi_dir, "SPI-documentation");
global.api_doc_dir = path.join(parent_dir, "API-documentation");
global.backend_doc_dir = path.join(parent_dir, "Backend-documentation");
global.converters_dir = path.join(parent_dir, "Converters");

global.spi_module = path.join(spi_dir, "SPI.js");
Expand Down
20 changes: 1 addition & 19 deletions Adapter/impl/mysql/mysql_service_provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,8 @@ exports.loadRequiredModules = function() {
};


var MysqlDefaultConnectionProperties = {
"implementation" : "mysql",
"database" : "test",

"mysql_host" : "localhost",
"mysql_port" : 3306,
"mysql_user" : "root",
"mysql_password" : "",
"mysql_charset" : "UTF8MB4",
"mysql_sql_mode" : "STRICT_ALL_TABLES",
"mysql_socket" : null,
"debug" : true,
"mysql_trace" : false,
"mysql_debug" : false,
"mysql_pool_size": 10
};


exports.getDefaultConnectionProperties = function() {
return MysqlDefaultConnectionProperties;
return require(path.join(backend_doc_dir,"mysql_properties.js"));
};


Expand Down
2 changes: 1 addition & 1 deletion Adapter/impl/ndb/ndb_service_provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ catch(e) {
var udebug = unified_debug.getLogger("ndb_service_provider.js");

var NdbDefaultConnectionProperties =
require(path.join(spi_doc_dir, "NDB_Properties"));
require(path.join(backend_doc_dir, "ndb_properties"));

exports.loadRequiredModules = function() {
var err, ldp, module, msg;
Expand Down
18 changes: 18 additions & 0 deletions Backend-documentation/mysql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```
var MysqlDefaultConnectionProperties = {
"implementation" : "mysql",
"database" : "test",
"mysql_host" : "localhost",
"mysql_port" : 3306,
"mysql_user" : "root",
"mysql_password" : "",
"mysql_charset" : "UTF8MB4",
"mysql_sql_mode" : "STRICT_ALL_TABLES",
"mysql_socket" : null,
"debug" : true,
"mysql_trace" : false,
"mysql_debug" : false,
"mysql_pool_size": 10
};
```
26 changes: 26 additions & 0 deletions Backend-documentation/mysql_properties.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
MySQL Connection Properties
*/

var MysqlDefaultConnectionProperties = {
"implementation" : "mysql",
"database" : "test",

"mysql_host" : "localhost",
"mysql_port" : 3306,
"mysql_user" : "root",
"mysql_password" : "",
"mysql_charset" : "UTF8MB4",
"mysql_sql_mode" : "STRICT_ALL_TABLES",
"mysql_socket" : null,
"debug" : true,
"mysql_trace" : false,
"mysql_debug" : false,
"mysql_pool_size": 10
};


/* This file is valid JavaScript
*/
module.exports = MysqlDefaultConnectionProperties;
41 changes: 41 additions & 0 deletions Backend-documentation/ndb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
```
var NdbDefaultConnectionProperties = {
"implementation" : "ndb", // This must always be "ndb".
"ndb_connectstring" : "localhost:1186", // MySQL Cluster Connect String
"database" : "test", // MySQL Database name
"mysql_user" : "root",
/* The next 3 properties control the behavior when opening a connection. */
"ndb_connect_retries" : 4, // if < 0, keep trying forever
"ndb_connect_delay" : 5, // full seconds between connection retries
"ndb_connect_verbose" : 0, // enable extra console output
"linger_on_close_msec": 500, /* When a client closes a DBConnectionPool,
the underlying connection is kept open
for this many milliseconds in case
another client tries to re-open it.
*/
"use_ndb_async_api" : false, /* If true, some operations will be
executed using asynchronous calls for
improved concurrency. If false, the
number of operations in transit will be
limited to one per uv worker thread.
*/
"ndb_session_pool_min" : 4,
"ndb_session_pool_max" : 100, /* Each NdbConnectionPool maintains a
pool of DBSessions (and their underlying
Ndb objects). These parameters set
guidelines for the size of that pool.
*/
"ndb_session_concurrency" : 4 /* The number of concurrent transactions
in an Ndb Session. Only one
transaction at a time is visible to the
user, but one may start before previous
ones have finished executing.
*/
};
```
50 changes: 50 additions & 0 deletions Backend-documentation/ndb_properties.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@


/*
NDB Connection Properties
*/

var NdbDefaultConnectionProperties = {
"implementation" : "ndb", // This must always be "ndb".

"ndb_connectstring" : "localhost:1186", // MySQL Cluster Connect String
"database" : "test", // MySQL Database name
"mysql_user" : "root",

/* The next 3 properties control the behavior when opening a connection. */
"ndb_connect_retries" : 4, // if < 0, keep trying forever
"ndb_connect_delay" : 5, // full seconds between connection retries
"ndb_connect_verbose" : 0, // enable extra console output

"linger_on_close_msec": 500, /* When a client closes a DBConnectionPool,
the underlying connection is kept open
for this many milliseconds in case
another client tries to re-open it.
*/

"use_ndb_async_api" : false, /* If true, some operations will be
executed using asynchronous calls for
improved concurrency. If false, the
number of operations in transit will be
limited to one per uv worker thread.
*/

"ndb_session_pool_min" : 4,
"ndb_session_pool_max" : 100, /* Each NdbConnectionPool maintains a
pool of DBSessions (and their underlying
Ndb objects). These parameters set
guidelines for the size of that pool.
*/

"ndb_session_concurrency" : 4 /* The number of concurrent transactions
in an Ndb Session. Only one
transaction at a time is visible to the
user, but one may start before previous
ones have finished executing.
*/
};

/* This file is valid JavaScript
*/
module.exports = NdbDefaultConnectionProperties;
Loading

0 comments on commit 710168d

Please sign in to comment.