Skip to contentSkip to conversation

Tabled: rename cells to groups

PATCH In review Pete Zaitcev 2 participants 4 messages Jan 28, 2010 – Jan 29, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Tabled: rename cells to groups

The term "cell" in context of tabled and chunkd conflicts with the idea of a CLD cell. So, rename it to "group".

Notice that we aren't introducing configuring of actual CLD paths yet. Coding that in the old CLD API is too hard, so it will come after ncld. Stay tuned.

---
 doc/etc.tabled.conf   |    6 ++--
 doc/setup.txt         |   11 ++++----
 server/cldu.c         |   54 ++++++++++++++++++++--------------------
 server/config.c       |    8 ++---
 server/server.c       |    2 -
 server/tabled.h       |    4 +-
 test/tabled-test.conf |    2 +
 7 files changed, 45 insertions(+), 42 deletions(-)

commit 2bfe3f6005ee9847095b0fc4401de3c0517efc00

Author: Master <[email protected]>
Date:   Thu Jan 28 12:54:37 2010 -0700

Rename Cell to Group.

doc/etc.tabled.conf +3 -3
index 6904eae..22d20a7 100644
@@ -12,12 +12,12 @@
 </Listen>
 
 <!--
-  One cell per DB, don't skimp on cells. Also, make sure the replication
-  ports do not conflict when you make hosts to host several cells.
+  One group per DB, don't skimp on groups. Also, make sure the replication
+  ports do not conflict when you make hosts to host several groups.
   Unfortunately, the diagnostics are not very good if they do.
   Most likely you'll see database corruption in such cases.
   -->
-<Cell>ultracart2</Cell>
+<Group>ultracart2</Group>
 <TDB>/path/tabled/tdb</TDB>
 <TDBRepPort>8083</TDBRepPort>
 
doc/setup.txt +6 -5
index 0fd32da..ac0dfb0 100644
@@ -41,15 +41,16 @@ emus3           IN      A       192.168.128.9
 *) Create/choose TDB data directory, where Berkeley DB stores
    data and metadata. Change this location with <TDB> tag.
 
-*) Assign the cell name:
+*) Assign the group name:
 
-	<Cell>ultracart3</Cell>
+	<Group>ultracart3</Group>
 
-   Currently, a tabled process scans its cell, finds all other tabled
+   Currently, a tabled process scans its group, finds all other tabled
    instances, and attempts to replicate its database to/from them.
-   In short, use one cell per business application.
+   In short, use one group per business application, and many groups
+   per one CLD cell.
 
-   Cell name defaults to "default", so you can leave this element unset,
+   Group name defaults to "default", so you can leave this element unset,
    but don't do it. Any name, even "qwerty", is better than the default.
 
 *) Select the port to listen, if desired. This is done using the <Listen>
server/cldu.c +27 -27

116 lines not on this page · raw message

server/config.c +4 -4
index 301be66..ff4d876 100644
@@ -361,14 +361,14 @@ static void cfg_elm_end (GMarkupParseContext *context,
 	}
 #endif
 
-	else if (!strcmp(element_name, "Cell")) {
+	else if (!strcmp(element_name, "Group")) {
 		if (!cc->text) {
-			applog(LOG_WARNING, "Cell element empty");
+			applog(LOG_WARNING, "Group element empty");
 			return;
 		}
 
-		free(tabled_srv.cell);
-		tabled_srv.cell = cc->text;
+		free(tabled_srv.group);
+		tabled_srv.group = cc->text;
 		cc->text = NULL;
 	}
 
server/server.c +1 -1
index 525e397..e5580c5 100644
@@ -1829,7 +1829,7 @@ int main (int argc, char *argv[])
 	if (rc)
 		goto err_out_net;
 
-	if (cld_begin(tabled_srv.ourhost, tabled_srv.cell) != 0) {
+	if (cld_begin(tabled_srv.ourhost, tabled_srv.group) != 0) {
 		rc = 1;
 		goto err_cld_session;
 	}
server/tabled.h +2 -2
index b81e615..a2ffd8b 100644
@@ -237,7 +237,7 @@ struct server {
 	char			*chunk_key;	/* key for stc_new */
 	unsigned short		rep_port;	/* db4 replication port */
 	char			*status_port;	/* status webserver */
-	char			*cell;		/* our cell (both T and Ch) */
+	char			*group;		/* our group (both T and Ch) */
 
 	char			*ourhost;	/* use this if DB master */
 	struct database		*db;		/* database handle */
@@ -287,7 +287,7 @@ extern void cli_in_end(struct client *cli);
 
 /* cldu.c */
 extern void cld_init(void);
-extern int cld_begin(const char *fqdn, const char *cell);
+extern int cld_begin(const char *fqdn, const char *group);
 extern void cldu_add_host(const char *host, unsigned int port);
 extern void cld_end(void);
 extern struct hail_log cldu_hail_log;
test/tabled-test.conf +2 -0
index 068ed00..f06ae2c 100644
@@ -16,3 +16,5 @@
 <ChunkUser>testuser</ChunkUser>
 <ChunkKey>testuser</ChunkKey>
 
+<!-- Setting "default" just to make sure tabled configures it correctly. -->
+<Group>default</Group>
#1 lore raw
Quoted 9 lines · Pete Zaitcev

The term "cell" in context of tabled and chunkd conflicts with the idea of a CLD cell. So, rename it to "group".

Notice that we aren't introducing configuring of actual CLD paths yet. Coding that in the old CLD API is too hard, so it will come after ncld. Stay tuned.

Quoted 9 lines
---
  doc/etc.tabled.conf   |    6 ++--
  doc/setup.txt         |   11 ++++----
  server/cldu.c         |   54 ++++++++++++++++++++--------------------
  server/config.c       |    8 ++---
  server/server.c       |    2 -
  server/tabled.h       |    4 +-
  test/tabled-test.conf |    2 +
  7 files changed, 45 insertions(+), 42 deletions(-)

May I presume this is really patch 2 of 2? Or are tabled and chunkd each missing a second patch?

Both patches 1/2's look good to me...

Jeff

#2 lore raw
Quoted 3 lines · On Thu, 28 Jan 2010 19:45:45 -0500 Jeff Garzik <[email protected]> wrote:
Quoted 1 line
  7 files changed, 45 insertions(+), 42 deletions(-)

May I presume this is really patch 2 of 2?

Sorry, yes, that's what I meant.

-- Pete

#3 lore raw
In reply to Pete Zaitcev
Quoted 9 lines · Pete Zaitcev

The term "cell" in context of tabled and chunkd conflicts with the idea of a CLD cell. So, rename it to "group".

Notice that we aren't introducing configuring of actual CLD paths yet. Coding that in the old CLD API is too hard, so it will come after ncld. Stay tuned.

Quoted 9 lines
---
  doc/etc.tabled.conf   |    6 ++--
  doc/setup.txt         |   11 ++++----
  server/cldu.c         |   54 ++++++++++++++++++++--------------------
  server/config.c       |    8 ++---
  server/server.c       |    2 -
  server/tabled.h       |    4 +-
  test/tabled-test.conf |    2 +
  7 files changed, 45 insertions(+), 42 deletions(-)

applied both patches