import SplitSnapshotProvider from 'snapshot-utils/lib/SplitSnapshotProvider.js'
SplitSnapshotProvider
An implementation of working directly with snapshot data, not meant for dev consumption. This implementation uses Synchronous file APIs
Static Method Summary
Static Public Methods | ||
public static |
fromDirectory(outdir: string, callback: function(err: *, provider: SplitSnapshotProvider)): undefined Convenience method for loading snapshot data from a directory |
|
public static |
fromStream(stream: Stream, callback: function(err: *, provider: SplitSnapshotProvider)): undefined Convenience method for loading snapshot data from a stream |
Constructor Summary
Public Constructor | ||
public |
constructor(snapshot_info: Object, node_buffer: Buffer, edge_buffer: Buffer, string_indices_buffer: Buffer, string_buffer: Buffer) |
Method Summary
Public Methods | ||
public |
Get total number of Edges |
|
public |
getEdgeBuffer(index: number): Buffer Get the buffer for an Edge at the specified index |
|
public |
|
|
public |
Get total number of Nodes |
|
public |
getNodeBuffer(index: number): Buffer Get the buffer for a Node at the specified index |
|
public |
Get total number of Samples |
|
public |
getSampleBuffer(index: number): string Gets a sample at the specified index. |
|
public |
Gets a string at the specified index. |
|
public |
writeToDirectory(outdir: string, callback: function(err: *)): undefined Convenience method for saving snapshot data in a faster loading format to a directory |
Static Public Methods
public static fromDirectory(outdir: string, callback: function(err: *, provider: SplitSnapshotProvider)): undefined source
Convenience method for loading snapshot data from a directory
Params:
Name | Type | Attribute | Description |
outdir | string | Path of the directory to load |
|
callback | function(err: *, provider: SplitSnapshotProvider) | Callback notified when there is an error or completion |
public static fromStream(stream: Stream, callback: function(err: *, provider: SplitSnapshotProvider)): undefined source
Convenience method for loading snapshot data from a stream
Params:
Name | Type | Attribute | Description |
stream | Stream | Path of the directory to load |
|
callback | function(err: *, provider: SplitSnapshotProvider) | Callback notified when there is an error or completion |
Public Constructors
public constructor(snapshot_info: Object, node_buffer: Buffer, edge_buffer: Buffer, string_indices_buffer: Buffer, string_buffer: Buffer) source
Params:
Name | Type | Attribute | Description |
snapshot_info | Object | Meta information required for understanding a snapshot |
|
node_buffer | Buffer | ||
edge_buffer | Buffer | ||
string_indices_buffer | Buffer | ||
string_buffer | Buffer |
Public Methods
public getEdgeBuffer(index: number): Buffer source
Get the buffer for an Edge at the specified index
Params:
Name | Type | Attribute | Description |
index | number |
Return:
Buffer |
public getNodeBuffer(index: number): Buffer source
Get the buffer for a Node at the specified index
Params:
Name | Type | Attribute | Description |
index | number |
Return:
Buffer |
public getSampleBuffer(index: number): string source
Gets a sample at the specified index.
Params:
Name | Type | Attribute | Description |
index | number | Index of the sample we wish to get. |
public getString(index: number): string source
Gets a string at the specified index.
Params:
Name | Type | Attribute | Description |
index | number | Index of the string we wish to get. |