-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpart-api.r
39 lines (26 loc) · 999 Bytes
/
part-api.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
library(uuid)
#' @title Create a global unique identifier (guid) for a new part.
#'
#' @param len the length of the guid
guid <- function() {
UUIDgenerate()
}
#####################
# Method definitions.
#####################
# The get_ prefix denotes we are getting something from the distributed
# part. This could be cached by the part object.
get_values <- function(part, i, ...) UseMethod("get_values", part)
get_attributes <- function(part, labels) UseMethod("get_attributes", part)
get_object_size <- function(part) UseMethod("get_object_size", part)
get_typeof <- function(part) UseMethod("get_typeof", part)
get_class <- function(part) UseMethod("get_class", part)
delete_part <- function(part) UseMethod("delete_part", part)
############################
# Chunk constructor function
############################
as_part <- function(x, part_constructor) {
if (missing(part_constructor))
part_constructor <- options()$default_part_constructor
part_constructor(x)
}