[couchdb-glib] Add missing fields to CouchdbDatabaseInfo
- From: Rodrigo Moya <rodrigo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [couchdb-glib] Add missing fields to CouchdbDatabaseInfo
- Date: Mon, 14 Jun 2010 12:15:05 +0000 (UTC)
commit 316f3abce0569a2d0852dd25072575c202476d34
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Mon Jun 14 14:13:41 2010 +0200
Add missing fields to CouchdbDatabaseInfo
couchdb-glib/couchdb-database-info.c | 61 +++++++++++++++++++++++++++++++++-
couchdb-glib/couchdb-database-info.h | 12 +++++--
couchdb-glib/couchdb-session.c | 5 ++-
3 files changed, 73 insertions(+), 5 deletions(-)
---
diff --git a/couchdb-glib/couchdb-database-info.c b/couchdb-glib/couchdb-database-info.c
index e5d001a..0ea93ce 100644
--- a/couchdb-glib/couchdb-database-info.c
+++ b/couchdb-glib/couchdb-database-info.c
@@ -32,6 +32,9 @@ struct _CouchdbDatabaseInfo {
gint update_seq;
gboolean compact_running;
gint disk_size;
+ gint disk_format_version;
+ gint purge_seq;
+ gint instance_start_time;
};
/*
@@ -57,8 +60,11 @@ couchdb_database_info_get_type (void)
* @doc_count: Number of documents in the database
* @doc_del_count: Number of deleted documents in the database
* @update_seq: Last update sequence
+ * @purge_seq: Number of purge operations
* @compact_running: Whether compacting is in progress
* @disk_size: Size of database on disk
+ * @disk_format_version: Current version of the internal database format on disk
+ * @instance_start_time: Timestamp of CouchDBs start time
*
* Create a new @CouchdbDatabaseInfo object, which is used to store information
* (name, number of documents, etc) of a database in CouchDB.
@@ -70,8 +76,11 @@ couchdb_database_info_new (const char *dbname,
gint doc_count,
gint doc_del_count,
gint update_seq,
+ gint purge_seq,
gboolean compact_running,
- gint disk_size)
+ gint disk_size,
+ gint disk_format_version,
+ gint instance_start_time)
{
CouchdbDatabaseInfo *dbinfo;
@@ -83,6 +92,9 @@ couchdb_database_info_new (const char *dbname,
dbinfo->update_seq = update_seq;
dbinfo->compact_running = compact_running;
dbinfo->disk_size = disk_size;
+ dbinfo->disk_format_version = disk_format_version;
+ dbinfo->purge_seq = purge_seq;
+ dbinfo->instance_start_time;
return dbinfo;
}
@@ -228,3 +240,50 @@ couchdb_database_info_get_disk_size (CouchdbDatabaseInfo *dbinfo)
return dbinfo->disk_size;
}
+/**
+ * couchdb_database_info_get_disk_format_version:
+ * @dbinfo: A #CouchdbDatabaseInfo object
+ *
+ * Get the current version of the internal database format on disk.
+ *
+ * Return value: Current version of the internal database format on disk.
+ */
+gint
+couchdb_database_info_get_disk_format_version (CouchdbDatabaseInfo *dbinfo)
+{
+ g_return_val_if_fail (dbinfo != NULL, 0);
+
+ return dbinfo->disk_format_version;
+}
+
+/**
+ * couchdb_database_info_get_purge_sequence:
+ * @dbinfo: A #CouchdbDatabaseInfo object
+ *
+ * Get the number of purge operations.
+ *
+ * Return value: Number of purge operations.
+ */
+gint
+couchdb_database_info_get_purge_sequence (CouchdbDatabaseInfo *dbinfo)
+{
+ g_return_val_if_fail (dbinfo != NULL, 0);
+
+ return dbinfo->purge_seq;
+}
+
+/**
+ * couchdb_database_info_get_instance_start_time:
+ * @dbinfo: A #CouchdbDatabaseInfo object
+ *
+ * Get the timestamp of CouchDBs start time.
+ *
+ * Return value: Timestamp of CouchDBs start time.
+ */
+gint
+couchdb_database_info_get_instance_start_time (CouchdbDatabaseInfo *dbinfo)
+{
+ g_return_val_if_fail (dbinfo != NULL, 0);
+
+ return dbinfo->instance_start_time;
+}
diff --git a/couchdb-glib/couchdb-database-info.h b/couchdb-glib/couchdb-database-info.h
index 4573034..a3f66b9 100644
--- a/couchdb-glib/couchdb-database-info.h
+++ b/couchdb-glib/couchdb-database-info.h
@@ -41,18 +41,24 @@ CouchdbDatabaseInfo *couchdb_database_info_ref (CouchdbDatabaseInfo *dbinfo);
void couchdb_database_info_unref (CouchdbDatabaseInfo *dbinfo);
const char *couchdb_database_info_get_dbname (CouchdbDatabaseInfo *dbinfo);
-gint couchdb_database_info_get_documents_count (CouchdbDatabaseInfo *dbinfo);
gint couchdb_database_info_get_deleted_documents_count (CouchdbDatabaseInfo *dbinfo);
+gint couchdb_database_info_get_disk_format_version (CouchdbDatabaseInfo *dbinfo);
+gint couchdb_database_info_get_disk_size (CouchdbDatabaseInfo *dbinfo);
+gint couchdb_database_info_get_documents_count (CouchdbDatabaseInfo *dbinfo);
+gint couchdb_database_info_get_instance_start_time (CouchdbDatabaseInfo *dbinfo);
+gint couchdb_database_info_get_purge_sequence (CouchdbDatabaseInfo *dbinfo);
gint couchdb_database_info_get_update_sequence (CouchdbDatabaseInfo *dbinfo);
gboolean couchdb_database_info_is_compact_running (CouchdbDatabaseInfo *dbinfo);
-gint couchdb_database_info_get_disk_size (CouchdbDatabaseInfo *dbinfo);
CouchdbDatabaseInfo* couchdb_database_info_new (const char *dbname,
gint doc_count,
gint doc_del_count,
gint update_seq,
+ gint purse_seq,
gboolean compact_running,
- gint disk_size);
+ gint disk_size,
+ gint disk_format_version,
+ gint instance_start_time);
G_END_DECLS
diff --git a/couchdb-glib/couchdb-session.c b/couchdb-glib/couchdb-session.c
index 6f8d212..baa03bd 100644
--- a/couchdb-glib/couchdb-session.c
+++ b/couchdb-glib/couchdb-session.c
@@ -312,8 +312,11 @@ couchdb_session_get_database_info (CouchdbSession *session, const char *dbname,
json_object_get_int_member (object, "doc_count"),
json_object_get_int_member (object, "doc_del_count"),
json_object_get_int_member (object, "update_seq"),
+ json_object_get_int_member (object, "purge_seq"),
json_object_get_boolean_member (object, "compact_running"),
- json_object_get_int_member (object, "disk_size"));
+ json_object_get_int_member (object, "disk_size"),
+ json_object_get_int_member (object, "disk_format_version"),
+ json_object_get_int_member (object, "instance_start_time"));
}
}
g_object_unref (G_OBJECT (parser));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]