Classes
Class | Description | |
---|---|---|
VCOverride |
Class contains mock functions for testing higher level modules that depend on VcClient.
User can override these functions to throw exceptions, return expected values.
For more information see Override.
| |
VirtualJobManager |
Creates a memory container for managing jobs in a format compatible
with VCOverride.
This class is not thread-safe.
Examples
General usage:
CopyC# // Initialize jom manager // VirtualJobManager jobManager = new VirtualJobManager(); VC.Override.Attach(jobManager); try { // Run tested method here, like // JobInfo jobInfo = MyClass.SubmitReportJob(); // Manipulate job status // jobManager.StartJob(jobInfo.ID); // Run other tested method // MyClass.CancelReportJobs(new JobInfo[] { jobInfo }); ... } finally { VC.Override.Clear(); } | |
VirtualStreamManager |
This class helps unit testing of modules that depend on VcClient.VC stream related functions.
Instead of streams on remote server it creates files in local directory and overrides default
API to emulate Cosmos workflow.
This class is not thread-safe.
Examples
General usage:
CopyC# // Initialize stream manager (using is required to destroy cosmos local directory after test) // You can also consider to create this object once for test class. // using (VirtualStreamManager streamManager = new VirtualStreamManager()) { VC.Override.Attach(streamManager); try { // Run tested method here, like // MyClass.CreateReportSteams(); // Manipulate streams // streamManager.Delete("/my/stream"); // Run other tested method // MyClass.VerifyReportStreamsExist(); ... } finally { VC.Override.Clear(); } Assert.AreEqual(0, streamManager.OpenedStreams.Count); } | |
VirtualStreamManager..::..ReadOnlyStream |
Object represents a read only file stream that maps to original file part defined by offset and
length parameters.
Class was created to implement compartible Cosmos streams features.
|
Delegates
Delegate | Description | |
---|---|---|
Append |
This function appends the given data in byte array to the specified stream.
The append starts at the given streamFixedOffset in the destination stream. If the stream already contains data in the
streamFixedOffset position and it is different from the data that is being appended, then this operation will fail.
| |
AppendFile |
This function appends the given file to the specified stream. The data will be read from the local file starting
at offset and the number of bits appended will be equal to length.
The append starts at the given streamFixedOffset in the destination stream. If the stream already contains data in the
streamFixedOffset position and it is different from the data that is being appended, then this operation will fail.
| |
CancelJob |
This function deletes the job with a given job id.
| |
Concatenate |
This function concatenates two given streams.
| |
Create |
This fuction creates a stream on the virtual cluster. It will also assign the expiration time for the stream.
| |
Delete |
This function deletes the given stream.
| |
DeleteJob |
This function deletes the job with a given job id.
| |
Download |
This function downloads a stream on the virtual cluster to the local machine. The download will start at the specified
offset and copy "length" number of bits.
| |
Encode |
This function encodes the given username with the given password.
| |
FindJobs |
This function finds jobs based on a given set of finding parameters.
| |
FindJobsFile |
Find qualified jobs and write response to output file.
| |
GetDataUploadProgress |
Gets CDL v2 data upload progress metrics for a given day or hour.
| |
GetDirectoryInfo |
This function gets the StreamInfo for a given directory.
| |
GetJobInfo |
Gets the information about the job with a given job id.
| |
GetJobInfoByUrl |
Gets the information about the job with a given job id.
| |
GetJobInfoFile |
This function gets the information about the job with a given job id and writes it to the given file.
| |
GetJobsList |
This function gets the list of jobs and their status etc. for the given VC name.
It also filters the job list based on submittedBy, jobstate and submitDate.
| |
GetJobsListFile |
This function generates an XML file containing the list of jobs and their status etc. for the given VC name.
It also filters the job list based on submittedBy, jobstate and submitDate.
| |
GetJobStatistics |
This function returns the JobStatistics object that contains statistical information about each stage. The
object includes information about the number of vertices failed, succeeded, data read, etc.
| |
GetStreamInfo |
Gets the StreamInfo for a stream.
| |
GetStreamSetInfo |
This function gets the StreamInfo of each stream in the given streamset.
| |
GetVcList |
Get a list of VCs in this cluster
| |
LogAppend |
This appends the given data in the byte array to the log stream on the virtual cluster whose "key" and "value"
match the key and value. hmKeyValue contains keyvalue pairs and the append operation will be performed for each
keyvalue pair.
| |
LogAppendFile |
This appends the data in the given file to the log stream on the virtual cluster whose "key" and "value"
match the key and value. hmKeyValue contains keyvalue pairs and the append operation will be performed for each
keyvalue pair.
| |
LogAppendWithArrayOffset |
This appends the given data in the byte array to the log stream on the virtual cluster whose "key" and "value"
match the key and value. hmKeyValue contains keyvalue pairs and the append operation will be performed for each
keyvalue pair.
| |
NormalizeHttpPath |
Gets the normalized version of the given HTTP path.
| |
Purge |
This function purges the given stream.
| |
ReadStream |
This function reads a stream from the virtual cluster and returns a stream object. The stream will be read from
the specified offset for the given length.
| |
Rename |
This function renames the given stream.
| |
Rename2 |
This function renames the given stream.
| |
SealStream |
Seals the last extent in a Cosmos stream. Seal happens automatically when calling
AppendFile(), but if you are uploading using Append() you may want to call this when
you know there will be no more data to upload.
| |
SetDefaultCredentials |
This will use the logged in machine credential for all the authentication with virtual clusters. For example,
if the windows machine running this library is running under PHX\johndoe, that will be the credential used for
virtual cluster authentication. Using default credentials gives the advantage of not having to encode the user
credentials. Also, you can set the virtual cluster name and proxy using the corresponding parameters.
| |
SetStreamExpirationTime |
This function sets the expiration time for a given stream.
| |
SetStreamFlags |
This function set stream flags to the corresponding value.
| |
Setup |
Setup method allows the user to associate a VC name, proxy, and username with the VC and SCOPE static
class. The settings will be used for all the future references to Scope and VC, unless
it's modified. In case, only one of the parameters needs to be set, use null for other values. Also, note that
everytime Setup is used, the previous setup will be overwritten.
Examples
Here are some of the usages of this function. In the following example, the VC and proxy are set. Note that,
CopyC# VC.Setup("vc://cotest1/cosmosAdmin", null, "http://itgproxy"); CopyC# VC.Setup(null, "PHX\Johndoe", null); | |
StreamExists |
This function checks if a given stream exists or not.
| |
SubmitAlgebraJob | Obsolete.
Submitting a xmlAlgebra job
| |
SubmitCmdLineJob | Obsolete.
Submitting a command line job
| |
SubmitJob |
Submitting a job
| |
Upload |
This function uploads the given byte array data to the vc.
| |
UploadFile |
This function uploads the given file to the vc. The data will be read from the local file starting
at offset and the number of bits appended will be equal to length.
| |
YieldJobByID |
Yield job.
| |
YieldJobByUrl |
Yield job.
|