Subversion
svn_cache_config.h
Go to the documentation of this file.
00001 /**
00002  * @copyright
00003  * ====================================================================
00004  *    Licensed to the Apache Software Foundation (ASF) under one
00005  *    or more contributor license agreements.  See the NOTICE file
00006  *    distributed with this work for additional information
00007  *    regarding copyright ownership.  The ASF licenses this file
00008  *    to you under the Apache License, Version 2.0 (the
00009  *    "License"); you may not use this file except in compliance
00010  *    with the License.  You may obtain a copy of the License at
00011  *
00012  *      http://www.apache.org/licenses/LICENSE-2.0
00013  *
00014  *    Unless required by applicable law or agreed to in writing,
00015  *    software distributed under the License is distributed on an
00016  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00017  *    KIND, either express or implied.  See the License for the
00018  *    specific language governing permissions and limitations
00019  *    under the License.
00020  * ====================================================================
00021  * @endcopyright
00022  *
00023  * @file svn_cache_config.h
00024  * @brief Configuration interface to internal Subversion caches.
00025  */
00026 
00027 #ifndef SVN_CACHE_CONFIG_H
00028 #define SVN_CACHE_CONFIG_H
00029 
00030 #include <apr.h>
00031 #include "svn_types.h"
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif /* __cplusplus */
00036 
00037 /** @defgroup svn_fs_cache_config caching configuration
00038  * @{
00039  * @since New in 1.7. */
00040 
00041 /** Cache resource settings. It controls what caches, in what size and
00042    how they will be created. The settings apply for the whole process.
00043 
00044    @since New in 1.7.
00045  */
00046 typedef struct svn_cache_config_t
00047 {
00048   /** total cache size in bytes. Please note that this is only soft limit
00049      to the total application memory usage and will be exceeded due to
00050      temporary objects and other program state.
00051      May be 0, resulting in default caching code being used. */
00052   apr_uint64_t cache_size;
00053 
00054   /** maximum number of files kept open */
00055   apr_size_t file_handle_count;
00056 
00057   /** is this application guaranteed to be single-threaded? */
00058   svn_boolean_t single_threaded;
00059 } svn_cache_config_t;
00060 
00061 /** Get the current cache configuration. If it has not been set,
00062    this function will return the default settings.
00063 
00064    @since New in 1.7.
00065  */
00066 const svn_cache_config_t *
00067 svn_cache_config_get(void);
00068 
00069 /** Set the cache configuration. Please note that it may not change
00070    the actual configuration *in use*. Therefore, call it before reading
00071    data from any repo and call it only once.
00072 
00073    This function is not thread-safe. Therefore, it should be called
00074    from the processes' initialization code only.
00075 
00076    @since New in 1.7.
00077  */
00078 void
00079 svn_cache_config_set(const svn_cache_config_t *settings);
00080 
00081 /** @} */
00082 
00083 /** @} */
00084 
00085 
00086 #ifdef __cplusplus
00087 }
00088 #endif /* __cplusplus */
00089 
00090 #endif /* SVN_CACHE_CONFIG_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines