Turi Create  4.0
fileio_constants.hpp
1 /* Copyright © 2017 Apple Inc. All rights reserved.
2  *
3  * Use of this source code is governed by a BSD-3-clause license that can
4  * be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
5  */
6 #ifndef TURI_FILEIO_FILEIO_CONSTANTS_HPP
7 #define TURI_FILEIO_FILEIO_CONSTANTS_HPP
8 #include <string>
9 
10 namespace turi {
11 namespace fileio {
12 
13 /**
14  * \ingroup fileio
15  * Returns the system temporary directory
16  */
17 std::string get_system_temp_directory();
18 
19 /**
20  * \ingroup fileio
21  * The protocol prefix cache:// to identify a cached file.
22  */
23 std::string get_cache_prefix();
24 
25 /**
26  * \ingroup fileio
27  * The "directory" (cache://tmp/) which all cached files are located in
28  */
29 std::string get_temp_cache_prefix();
30 
31 /**
32  * \ingroup fileio
33  * Gets the physical directory (/var/tmp) which all cached files are located in .
34  * colon seperated.
35  */
36 std::string get_cache_file_locations();
37 
38 /**
39  * \ingroup fileio
40  * Sets the physical directory (/var/tmp) which all cached files are located in .
41  * colon seperated.
42  */
43 void set_cache_file_locations(std::string);
44 
45 /**
46  * \ingroup fileio
47  * Additional HDFS location for storing large temp files.
48  */
49 std::string get_cache_file_hdfs_location();
50 
51 /**
52  * \ingroup fileio
53  * The initial memory capacity assigned to caches
54  */
55 extern const size_t FILEIO_INITIAL_CAPACITY_PER_FILE;
56 
57 /**
58  * \ingroup fileio
59  * The maximum memory capacity assigned to a cached file until it has to
60  * be flushed.
61  */
63 
64 /**
65  * \ingroup fileio
66  * The maximum memory capacity used by all cached files be flushed.
67  */
68 extern size_t FILEIO_MAXIMUM_CACHE_CAPACITY;
69 
70 /**
71  * \ingroup fileio
72  * The default fileio reader buffer size
73  */
74 extern size_t FILEIO_READER_BUFFER_SIZE;
75 
76 /**
77  * \ingroup fileio
78  * The default fileio writer buffer size
79  */
80 extern size_t FILEIO_WRITER_BUFFER_SIZE;
81 
82 /**
83  * \ingroup fileio
84  * The S3 connection endpoint; if empty string, S3 is assumed.
85  */
86 extern std::string S3_ENDPOINT;
87 
88 /**
89  * \ingroup fileio
90  * The S3 connection region; if empty string, region will be guessed by:
91  * 1. TURI_S3_REGION environment variable
92  * 2. AWS_DEFAULT_REGION environment variable
93  * 3. known region to endpoint mappings
94  * if none of above works, empty region string will be set and AWS will
95  * guess bucket region from endpoint.
96  */
97 extern std::string S3_REGION;
98 
99 /**
100  * \ingroup fileio
101  * The number of GPUs.
102  */
103 extern int64_t NUM_GPUS;
104 
105 /**
106  * \ingroup fileio
107  * Gets the alternative ssl certificate file and directory.
108  */
109 const std::string& get_alternative_ssl_cert_dir();
110 /**
111  * \ingroup fileio
112  * Sets the alternative ssl certificate file and directory.
113  */
114 const std::string& get_alternative_ssl_cert_file();
115 /**
116  * \ingroup fileio
117  * If true, ssl certificate checks are disabled.
118  */
119 const bool insecure_ssl_cert_checks();
120 
121 }
122 }
123 #endif
const std::string & get_alternative_ssl_cert_dir()
std::string S3_ENDPOINT
void set_cache_file_locations(std::string)
size_t FILEIO_MAXIMUM_CACHE_CAPACITY_PER_FILE
const bool insecure_ssl_cert_checks()
size_t FILEIO_MAXIMUM_CACHE_CAPACITY
const size_t FILEIO_INITIAL_CAPACITY_PER_FILE
int64_t NUM_GPUS
std::string get_cache_file_locations()
std::string S3_REGION
std::string get_temp_cache_prefix()
std::string get_cache_prefix()
const std::string & get_alternative_ssl_cert_file()
size_t FILEIO_WRITER_BUFFER_SIZE
std::string get_system_temp_directory()
std::string get_cache_file_hdfs_location()
size_t FILEIO_READER_BUFFER_SIZE