From deed215d0d135d30beac950a5f88050497ef9e39 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 26 Aug 2010 13:31:58 +0000 Subject: towards datacache --- src/datacache/Makefile.am | 47 +++++++++++++++++++++++-- src/datacache/perf_datacache_data_postgres.conf | 7 ++++ src/datacache/test_datacache_data_postgres.conf | 7 ++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 src/datacache/perf_datacache_data_postgres.conf create mode 100644 src/datacache/test_datacache_data_postgres.conf (limited to 'src/datacache') diff --git a/src/datacache/Makefile.am b/src/datacache/Makefile.am index 0598c2673..ea60d3500 100644 --- a/src/datacache/Makefile.am +++ b/src/datacache/Makefile.am @@ -17,6 +17,9 @@ endif if HAVE_MYSQL MYSQL_PLUGIN = libgnunet_plugin_datacache_mysql.la endif +if HAVE_POSTGRES + POSTGRES_PLUGIN = libgnunet_plugin_datacache_postgres.la +endif lib_LTLIBRARIES = \ libgnunetdatacache.la @@ -35,6 +38,7 @@ libgnunetdatacache_la_LDFLAGS = \ plugin_LTLIBRARIES = \ $(SQLITE_PLUGIN) \ $(MYSQL_PLUGIN) \ + $(POSTGRES_PLUGIN) \ libgnunet_plugin_datacache_template.la @@ -57,6 +61,17 @@ libgnunet_plugin_datacache_mysql_la_CPPFLAGS = \ libgnunet_plugin_datacache_mysql_la_LDFLAGS = \ $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient +libgnunet_plugin_datacache_postgres_la_SOURCES = \ + plugin_datacache_postgres.c +libgnunet_plugin_datacache_postgres_la_LIBADD = \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq +libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \ + $(POSTGRES_CPPFLAGS) +libgnunet_plugin_datacache_postgres_la_LDFLAGS = \ + $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq + libgnunet_plugin_datacache_template_la_SOURCES = \ plugin_datacache_template.c libgnunet_plugin_datacache_template_la_LIBADD = \ @@ -79,9 +94,17 @@ MYSQL_TESTS = \ perf_datacache_mysql endif +if HAVE_POSTGRES +POSTGRES_TESTS = \ + test_datacache_postgres \ + test_datacache_quota_postgres \ + perf_datacache_postgres +endif + check_PROGRAMS = \ $(SQLITE_TESTS) \ - $(MYSQL_TESTS) + $(MYSQL_TESTS) \ + $(POSTGRES_TESTS) if !DISABLE_TEST_RUN TESTS = $(check_PROGRAMS) @@ -123,8 +146,28 @@ perf_datacache_mysql_LDADD = \ $(top_builddir)/src/datacache/libgnunetdatacache.la \ $(top_builddir)/src/util/libgnunetutil.la +test_datacache_postgres_SOURCES = \ + test_datacache.c +test_datacache_postgres_LDADD = \ + $(top_builddir)/src/datacache/libgnunetdatacache.la \ + $(top_builddir)/src/util/libgnunetutil.la + +test_datacache_quota_postgres_SOURCES = \ + test_datacache_quota.c +test_datacache_quota_postgres_LDADD = \ + $(top_builddir)/src/datacache/libgnunetdatacache.la \ + $(top_builddir)/src/util/libgnunetutil.la + +perf_datacache_postgres_SOURCES = \ + perf_datacache.c +perf_datacache_postgres_LDADD = \ + $(top_builddir)/src/datacache/libgnunetdatacache.la \ + $(top_builddir)/src/util/libgnunetutil.la + EXTRA_DIST = \ test_datacache_data_sqlite.conf \ perf_datacache_data_sqlite.conf \ test_datacache_data_mysql.conf \ - perf_datacache_data_mysql.conf + perf_datacache_data_mysql.conf \ + test_datacache_data_postgres.conf \ + perf_datacache_data_postgres.conf diff --git a/src/datacache/perf_datacache_data_postgres.conf b/src/datacache/perf_datacache_data_postgres.conf new file mode 100644 index 000000000..931c44f1b --- /dev/null +++ b/src/datacache/perf_datacache_data_postgres.conf @@ -0,0 +1,7 @@ + +[perfcache] +QUOTA = 500000 +DATABASE = mysql + +[datacache-mysql] +CONFIG = dbname=gnunetcheck diff --git a/src/datacache/test_datacache_data_postgres.conf b/src/datacache/test_datacache_data_postgres.conf new file mode 100644 index 000000000..51d2dae64 --- /dev/null +++ b/src/datacache/test_datacache_data_postgres.conf @@ -0,0 +1,7 @@ + +[testcache] +QUOTA = 1000000 +DATABASE = postgrers + +[datacache-postgres] +CONFIG = dbname=gnunetcheck -- cgit v1.2.3