scidbconnect: Connect to a SciDB database

Description Usage Arguments Value Note See Also Examples

View source: R/utility.R

Description

Connect to a SciDB database

Usage

1
2
3
4
scidbconnect(host = getOption("scidb.default_shim_host", "127.0.0.1"),
  port = getOption("scidb.default_shim_port", 8080L), username, password,
  auth_type = c("scidb", "digest"), protocol = c("http", "https"),
  int64 = FALSE, doc)

Arguments

host

optional host name or I.P. address of a SciDB shim service to connect to

port

optional port number of a SciDB shim service to connect to. For connecting to Shim when the Shim port is forwarded, use port= NULL (see detailed note below).

username

optional authentication username

password

optional authentication password

auth_type

optional SciDB authentication type

protocol

optional shim protocol type

int64

logical value, if TRUE then preserve signed 64-bit SciDB integers as R integer64 values from the bit64 package. Otherwise, 64-bit integers from SciDB are converted to R double values, possibly losing precision.

doc

optional AFL operator/macro documentation (see notes)

Value

A scidb connection object. Use $ to access AFL operators and macros, ls() on the returned object to list SciDB arrays, and names() on the returned object to list all available AFL operators and macros.

Note

Use the optional username and password arguments with auth_type set to "digest" to use HTTP digest authentication (see the shim documentation to configure this). Digest authentication may use either "http" or "https" selected by the protocol setting. Set auth_type = "scidb" to use SciDB authentication, which only works over "https".

Use the returned SciDB connection object (of class afl) with other package functions to interact with SciDB arrays. Apply R's ls function on the returned value to see a list of arrays. The returned value contains a list of available SciDB AFL language operators and macro names. Use the dollar-sign function to accesss those functions.

The optional doc argument may be a three-column data frame with character-valued columns name, signature, and help containing AFL operator names, function signatures, and help strings, respectively. See 'data("operators", package="scidb")' for an example.

Forwarded Shim port: Shim usually runs on a selected port e.g. 8080 or 8083 (for secure communication) and those ports need to be opened up to clients. In other situations, the admin might decide to not open the Shim port and instead forward the Shim port to a URL like https://hostname/shim/. In this case, we do not need to supply the port number during scidbconnect(); instead one should use port = NULL and host=HOSTNAME/FORWARDED-PATH/.

All arguments support partial matching.

See Also

scidb_prefix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
db <- scidbconnect()

# SciDB 15.12 authentication example (using shim's default HTTPS port 8083)
db <- scidbconnect(user="root", password="Paradigm4",
                   auth_type="scidb", port=8083, protocol="https")

# List available AFL operators
names(db)

# List arrays
ls(db)

# Explicitly upload an R matrix to SciDB:
x <- as.scidb(db, matrix(rnorm(20), 5))
# Implicitly do the same as part of an AFL expression
y <- db$join(x,  as.scidb(matrix(1:20, 5)))
print(y)

as.R(y)   # Download a SciDB array to R.

## End(Not run)

Paradigm4/SciDBR documentation built on Dec. 3, 2018, 9:14 p.m.