aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMarco Boss <bossm8@bfh.ch>2022-04-02 09:28:25 +0200
committerMarco Boss <bossm8@bfh.ch>2022-04-02 09:28:25 +0200
commit1b76ba5e9a976d431eae4cdc464c698122f5fbf0 (patch)
tree0e58e114a86ab517a659bd42c86ca400acf463c8 /src/include
parent6c66f6f5cffa6b33ecd41cfc0ed92ab76185bf06 (diff)
parent0ba219fe5b02d8b22be72e6320c5d7e31c894995 (diff)
Include sharding sql logic
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_exchangedb_plugin.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
index 488ffd519..7383913a3 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -2255,6 +2255,17 @@ struct TALER_EXCHANGEDB_Plugin
(*create_tables)(void *cls);
/**
+ * Initialize the database of a shard node
+ *
+ * @param cls the @e cls of this struct with the plugin-specific state
+ * @param idx the current shard index, will be appended to tables as suffix
+ * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
+ */
+ enum GNUNET_GenericReturnValue
+ (*create_shard_tables)(void *cls,
+ uint32_t idx);
+
+ /**
* Change already present tables of the database to num partitions
* Only has an effect if there are default partitions only
*
@@ -2264,7 +2275,23 @@ struct TALER_EXCHANGEDB_Plugin
*/
enum GNUNET_GenericReturnValue
(*setup_partitions)(void *cls,
- const uint32_t num);
+ uint32_t num);
+
+ /**
+ * Change already present tables of the database to num foreign tables on
+ * num foreign servers (shards).
+ * Only has an effect if there are default partitions only
+ *
+ * @param cls the @e cls of this struct with the plugin-specific state
+ * @param num the number of shard servers to create. The shard servers
+ * must follow the numbering of 1-N, have the same user as
+ * the master and have tables named <table>_n where n is the same
+ * as the servers index of N.
+ * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
+ */
+ enum GNUNET_GenericReturnValue
+ (*setup_foreign_servers)(void *cls,
+ uint32_t num);
/**
* Start a transaction.