35
35
36
36
#include " array_read_state.h"
37
37
#include " array_schema.h"
38
+ #include " book_keeping.h"
38
39
#include " constants.h"
39
40
#include " fragment.h"
40
41
@@ -140,10 +141,17 @@ class Array {
140
141
141
142
/* *
142
143
* Consolidates all fragments into a new single one, on a per-attribute basis.
144
+ * Returns the new fragment (which has to be finalized outside this functions),
145
+ * along with the names of the old (consolidated) fragments (which also have
146
+ * to be deleted outside this function).
143
147
*
148
+ * @param new_fragment The new fragment to be returned.
149
+ * @param old_fragment_names The names of the old fragments to be returned.
144
150
* @return TILEDB_AR_OK for success and TILEDB_AR_ERR for error.
145
151
*/
146
- int consolidate ();
152
+ int consolidate (
153
+ Fragment*& new_fragment,
154
+ std::vector<std::string>& old_fragment_names);
147
155
148
156
/* *
149
157
* Consolidates all fragment into a new single one, focusing on a specific
@@ -167,6 +175,9 @@ class Array {
167
175
* Initializes a TileDB array object.
168
176
*
169
177
* @param array_schema The array schema.
178
+ * @param fragment_names The names of the fragments of the array.
179
+ * @param book_keeping The book-keeping structures of the fragments
180
+ * of the array.
170
181
* @param mode The mode of the array. It must be one of the following:
171
182
* - TILEDB_ARRAY_WRITE
172
183
* - TILEDB_ARRAY_WRITE_UNSORTED
@@ -184,6 +195,8 @@ class Array {
184
195
*/
185
196
int init (
186
197
const ArraySchema* array_schema,
198
+ const std::vector<std::string>& fragment_names,
199
+ const std::vector<BookKeeping*>& book_keeping,
187
200
int mode,
188
201
const char ** attributes,
189
202
int attribute_num,
@@ -299,21 +312,21 @@ class Array {
299
312
* After the new fragmemt is finalized, the array will change its name
300
313
* by removing the leading '.' character.
301
314
*
302
- * @return A new special fragment name.
315
+ * @return A new special fragment name on success, or "" (empty string) on
316
+ * error.
303
317
*/
304
318
std::string new_fragment_name () const ;
305
319
306
320
/* *
307
321
* Opens the existing fragments in TILEDB_ARRAY_READ_MODE.
308
322
*
323
+ * @param fragment_names The vector with the fragment names.
324
+ * @param book_keeping The book-keeping of the array fragments.
309
325
* @return TILEDB_AR_OK for success and TILEDB_AR_ERR for error.
310
326
*/
311
- int open_fragments ();
312
-
313
- /* *
314
- * Appropriately sorts the fragment names based on their name timestamps.
315
- */
316
- void sort_fragment_names (std::vector<std::string>& fragment_names) const ;
327
+ int open_fragments (
328
+ const std::vector<std::string>& fragment_names,
329
+ const std::vector<BookKeeping*>& book_keeping);
317
330
};
318
331
319
332
#endif
0 commit comments