new Btable(tablePath [, options])
Constructs series of Sbuckets composing a sharded table
Parameters:
| Name | Type | Argument | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tablePath |
String | The path to the directory to store the table | |||||||||||||||||
options |
Object |
<optional> |
Properties
|
- Source:
Methods
-
createReadStream(key, callback)
-
Creates a readable stream of the data at the given key
Parameters:
Name Type Description keyString The key for the data read callbackBtable~createReadStreamCallback - Source:
-
createWriteStream(key, callback)
-
Creates a writable stream to the given key
Parameters:
Name Type Description keyString The key to write the data to callbackBtable~createWriteStreamCallback - Source:
-
exists(key, callback)
-
Check if a file exists at the supplied key
Parameters:
Name Type Description keyString The key to check for existence callbackSbucket~existsCallback - Source:
-
flush(callback)
-
Performs a flush on each S-bucket in the table to free any dead space
Parameters:
Name Type Description callbackBtable~flushCallback - Source:
-
list(keyOrIndex, callback)
-
Lists the file keys in the given bucket
Parameters:
Name Type Description keyOrIndexNumber | String The bucket index of a file key callbackSbucket~listCallback - Source:
-
readFile(key, callback)
-
Reads the data at the supplied key into a buffer
Parameters:
Name Type Description keyString The key for the data to read callbackSbucket~readFileCallback - Source:
-
stat( [keyOrIndex], callback)
-
Lists the created Sbuckets and their sizes
Parameters:
Name Type Argument Description keyOrIndexString | Number <optional>
Optional bucket index or file key callbackBtable~statCallback - Source:
-
unlink(key, callback)
-
Unlinks the data for the given key
Parameters:
Name Type Description keyString The key to unlink data from callbackSbucket~unlinkCallback - Source:
-
writeFile(key, buffer, callback)
-
Writes the given buffer to the key
Parameters:
Name Type Description keyString The key to write the data to bufferBuffer The raw buffer to write to the key callbackSbucket~writeFileCallback - Source:
Type Definitions
-
createReadStreamCallback( [error], readStream)
-
Parameters:
Name Type Argument Description errorError <optional>
readStreamReadableStream - Source:
-
flushCallback(error)
-
Parameters:
Name Type Description errorError | null - Source:
-
statCallback( [error], sBuckets)
-
Parameters:
Name Type Argument Description errorError <optional>
sBucketsArray.<Object> sBuckets[].sBucketIndexString The index of the S-bucket sBuckets[].sBucketStatsObject Properties
Name Type Description usedNumber Space used in the bucket freeNumber Space free in the bucket - Source: