Turi Create  4.0
sframe_saving.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_SFRAME_SAVING_HPP
7 #define TURI_SFRAME_SAVING_HPP
8 namespace turi {
9 class sframe;
10 
11 
12 /**
13  * \ingroup sframe_physical
14  * \addtogroup sframe_main Main SFrame Objects
15  * \{
16  */
17 
18 
19 /**
20  * Saves an SFrame to another index file location using the most naive method:
21  * decode rows, and write them
22  */
23 void sframe_save_naive(const sframe& sf,
24  std::string index_file);
25 
26 /**
27  * Saves an SFrame to another index file location using a more efficient method,
28  * block by block.
29  */
30 void sframe_save_blockwise(const sframe& sf,
31  std::string index_file);
32 
33 /**
34  * Automatically determines the optimal strategy to save an sframe
35  */
36 void sframe_save(const sframe& sf,
37  std::string index_file);
38 
39 /**
40  * Performs an "incomplete save" to a target index file location.
41  * All this ensures is that the sframe's contents are located on the
42  * same "file-system" (protocol) as the index file. Essentially the reference
43  * save is guaranteed to be valid for only as long as no other SFrame files are
44  * deleted.
45  *
46  * Essentially this can be used to build a "delta" SFrame.
47  * - You already have an SFrame on disk somewhere. Say... /data/a
48  * - You open it and add a column
49  * - Calling sframe_save_weak_reference to save it to /data/b
50  * - The saved SFrame in /data/b will include just the new column, but reference
51  * /data/a for the remaining columns.
52  *
53  * \param sf The SFrame to save
54  * \param index_file The output file location
55  *
56  */
57 void sframe_save_weak_reference(const sframe& sf,
58  std::string index_file);
59 
60 
61 /// \}
62 }; // naemspace turicreate
63 
64 #endif
void sframe_save_naive(const sframe &sf, std::string index_file)
void sframe_save_weak_reference(const sframe &sf, std::string index_file)
void sframe_save(const sframe &sf, std::string index_file)
void sframe_save_blockwise(const sframe &sf, std::string index_file)