mirror of
https://github.com/openstreetmap/mod_tile.git
synced 2025-08-08 08:24:25 +00:00

So far, (meta)tiles could only be stored and retrieved from a locally mounted posix filesystem. Although, the posix filesystem API is it self a plugable storage layer into which one can mount many different filsystems, from temporary filesystems to network filesystems, as mod_tile installations scale up to multi-server environments this might not be sufficient and one may want to use other storage layers. This patch therefore abstracts all storage calls out into a separate API that can be implemented by various storage backends to fit the needs of different installations. Three storage backends are included in this commit: - file backend: This is the equivalent of what existed before in mod_tile / renderd. This uses a posix filesystem to store (meta)tiles - memcached: This stores tiles in a memcached store - rados: This stores tiles in a rados / ceph cluster The memcached and rados backends should currently still be considered as experimental There are also other refactoring and cleanups in this commit
38 lines
968 B
C
38 lines
968 B
C
#ifndef DIR_UTILS_H
|
|
#define DIR_UTILS_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "render_config.h"
|
|
|
|
/* Build parent directories for the specified file name
|
|
* Note: the part following the trailing / is ignored
|
|
* e.g. mkdirp("/a/b/foo.png") == shell mkdir -p /a/b
|
|
*/
|
|
int mkdirp(const char *path);
|
|
|
|
/* File path hashing. Used by both mod_tile and render daemon
|
|
* The two must both agree on the file layout for meta-tiling
|
|
* to work
|
|
*/
|
|
void xyz_to_path(char *path, size_t len, const char *tile_dir, const char *xmlconfig, int x, int y, int z);
|
|
|
|
int path_to_xyz(const char *tilepath, const char *path, char *xmlconfig, int *px, int *py, int *pz);
|
|
|
|
#ifdef METATILE
|
|
/* New meta-tile storage functions */
|
|
/* Returns the path to the meta-tile and the offset within the meta-tile */
|
|
int xyz_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlconfig, int x, int y, int z);
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
|
|
#endif
|