internal string GetJobError(IStorageAccess storageAccess) { var output = HDInsightJobClient.GetJobError(JobId, storageAccess); var outputStr = Convert(output); return(outputStr); }
public AlgorithmFlowImageGeneration( IStorageAccess storageAccess, IIsometricBitmapRenderer isometricBitmapRenderer) { this.m_StorageAccess = storageAccess; this.m_IsometricBitmapRenderer = isometricBitmapRenderer; }
/// <summary> /// open from the storage interface /// </summary> /// <param name="storage"></param> private void OpenStorage(IStorageAccess storage) { //open file dialog string PathName; string FileName; if (!storage.OpenFileDialog(out PathName, out FileName)) { return; } //read the file string data; if (!storage.ReadFile(PathName, FileName, out data)) { MessageBox.Show("There was an error reading the file."); return; } //create the compute node and window IComputeNode compute_node = new ComputeNode().DeserializeComputeNode(data); ComputeNodeConfig dlg = new ComputeNodeConfig(compute_node); dlg.Show(); Close(); }
public ImportService(IStorageAccess storageAccess, IQueueService queueService, ITransformationFileService transformationFileService, IOptions <TransformationSettings> transformationSettings) { _storageAccess = storageAccess; _queueService = queueService; _transformationFileService = transformationFileService; _transformationSettings = transformationSettings.Value; }
public override void ExecuteCmdlet() { if (ResourceGroupName == null) { ResourceGroupName = GetResourceGroupByAccountName(ClusterName); } storageAccess = GetDefaultStorageAccess(ResourceGroupName, _clusterName); _clusterName = GetClusterConnection(ResourceGroupName, ClusterName); string output; switch (DisplayOutputType) { case JobDisplayOutputType.StandardError: output = GetJobError(this.storageAccess); break; default: output = GetJobOutput(this.storageAccess); break; } WriteObject(output); }
/// <summary> /// If an application wishes to access data in some storage, e.g. a file system, it must register this interface. /// </summary> /// <param name="storageAccess">The storage access interface.</param> /// <returns><c>true</c> if initialization was successful, <c>false</c> if an instance of the <see cref="IStorageAccess"/> type has already been registered.</returns> /// <exception cref="System.ArgumentNullException">Thrown if <paramref name="storageAccess"/> is <c>null</c>.</exception> public static bool Initialize(IStorageAccess storageAccess) { if (storageAccess == null) { throw new ArgumentNullException(); } return(RegisteredStorageAccessProviders.Value.TryAdd(storageAccess.GetType(), storageAccess)); }
private static IStorageAccess GetStorageAccess(IStorageAccess specificStorageAccess) { IStorageAccess storageAccess = specificStorageAccess; if (specificStorageAccess == DefaultStorage) { storageAccess = DefaultStorageAccess; } return(storageAccess); }
public ProceduralStorageCommand( IConfigurationHelper configurationHelper, IStorageAccess storageAccess) { this.m_ConfigurationHelper = configurationHelper; this.m_StorageAccess = storageAccess; this.IsCommand("test-storage", "Test the world configuration storage"); this.m_ConfigurationHelper.Setup(this, x => this.m_ConfigurationName = x); }
public ImagesController( IStorageAccess storageAccess, IDataAccess dataAccess, IAadHelper aadHelper ) { _storageAccess = storageAccess; _dataAccess = dataAccess; _aadHelper = aadHelper; }
/// <summary> /// handle the click and open/save mode /// </summary> /// <param name="storage"></param> private void HandleClick(IStorageAccess storage) { if (OpenMode) { OpenStorage(storage); } else { SaveStorage(storage); } }
public GeneratePerformanceResultsHandler( ICurrentWorldSeedProvider currentWorldSeedProvider, IRenderingLocationProvider renderingLocationProvider, IStorageAccess storageAccess, IAlgorithmFlowImageGeneration algorithmFlowImageGeneration) { this.m_CurrentWorldSeedProvider = currentWorldSeedProvider; this.m_RenderingLocationProvider = renderingLocationProvider; this.m_StorageAccess = storageAccess; this.m_AlgorithmFlowImageGeneration = algorithmFlowImageGeneration; }
public void CompressedArchiveAccess_GetActualEntryLastWriteTimeUsingIStoragAccess_ReturnsNonMinimumValue() { var format = RegisterFakeFormatForTest(registerFormat: true); using (var archive = CompressedArchiveAccess.Open(Stream.Null, format, CompressedArchiveAccessMode.Read)) { var testArchive = (TestCompressedArchiveAccess)archive; var firstEntryName = testArchive.AddFakeEntries(5); IStorageAccess storageAccess = archive; Assert.NotEqual(DateTime.MinValue, storageAccess.LastWriteTimeUtc(firstEntryName)); } }
public static IActionResult Run( [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "{key}")] HttpRequest req, string key, [Inject] IStorageAccess storageAccess, ILogger logger) { logger.LogInformation($"Injected instance of {typeof(IStorageAccess)} is {storageAccess.GetType()}"); var value = storageAccess.RetrieveValue(key); return(new OkObjectResult($"Value for key '{key}' = '{value}'")); }
public void CompressedArchiveAccess_GetActualEntrySizeUsingIStoragAccess_ReturnsNonzeroValue() { var format = RegisterFakeFormatForTest(registerFormat: true); using (var archive = CompressedArchiveAccess.Open(Stream.Null, format, CompressedArchiveAccessMode.Read)) { var testArchive = (TestCompressedArchiveAccess)archive; var firstEntryName = testArchive.AddFakeEntries(2); IStorageAccess storageAccess = archive; Assert.NotEqual(0L, storageAccess.Size(firstEntryName)); } }
/// <summary> /// Gets the error logs from the execution of an individual jobDetails. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.HDInsight.Job.IJobOperations. /// </param> /// <param name="jobId"> /// Required. The id of the job. /// </param> /// <param name="storageAccess"> /// Required. The storage account object of type IStorageAccess. /// </param> /// <returns> /// The error logs of an individual jobDetails by jobId. /// </returns> public static Stream GetJobErrorLogs(this IJobOperations operations, string jobId, IStorageAccess storageAccess) { return(Task.Factory.StartNew( (object s) => ((IJobOperations)s).GetJobErrorLogsAsync(jobId, storageAccess), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default) .Unwrap() .GetAwaiter() .GetResult()); }
public StorageDictionary(string parentStorageCapsuleID, IStorageAccess storageAccess, Dictionary <string, SaveableValueSection> loadedValues, Dictionary <string, object> loadedRefs) : base(parentStorageCapsuleID, loadedValues) { _storageAccess = storageAccess; _keyToReferenceID = loadedRefs; SaveableValueSection keysToKeepSection = GetValueSection(REF_KEYS_TO_KEEP_KEY); if (keysToKeepSection.IsValid) { _keysToKeep = new List <string>(SaveableArray.To <string>((SaveableArray)keysToKeepSection.GetValue(typeof(SaveableArray)))); } }
public AnalyseForm( IStorageAccess storageAccess, FlowElement flowElement) { this.InitializeComponent(); this.m_Layer = storageAccess.ToRuntime(((AlgorithmFlowElement)flowElement).Layer); this.c_AnalysisAddOptionsMenu.Items.AddRange(( from assembly in AppDomain.CurrentDomain.GetAssemblies() from type in assembly.GetTypes() where typeof(AnalysisEngine).IsAssignableFrom(type) && !type.IsGenericType && !type.IsAbstract select new TypeWrapper(type)).ToArray()); }
public void CompressedArchiveAccess_OpenActualEntryUsingIStoragAccess_ReturnsValidStream() { var format = RegisterFakeFormatForTest(registerFormat: true); using (var archive = CompressedArchiveAccess.Open(Stream.Null, format, CompressedArchiveAccessMode.Read)) { var testArchive = (TestCompressedArchiveAccess)archive; var firstEntryName = testArchive.AddFakeEntries(4); IStorageAccess storageAccess = archive; Assert.NotNull(storageAccess.Open(firstEntryName)); Assert.Equal(format, testArchive.Format); Assert.Equal(format.GetPreferredCompressedArchiveImplementation(), testArchive.Implementation); } }
public ExportForm( IRenderingLocationProvider renderingLocationProvider, IStorageAccess storageAccess, FlowElement flowElement) { this.InitializeComponent(); this.m_StorageAccess = storageAccess; this.m_RenderingLocationProvider = renderingLocationProvider; this.m_Layer = this.m_StorageAccess.ToRuntime(((AlgorithmFlowElement)flowElement).Layer); this.m_Bitmap = new Bitmap(1024 + 32, 1024 + 256); this.c_RenderBox.Image = this.m_Bitmap; this.c_Timer.Start(); }
public FlowProcessingRequestHandler( ICurrentWorldSeedProvider currentWorldSeedProvider, IRenderingLocationProvider renderingLocationProvider, IAlgorithmFlowImageGeneration algorithmFlowImageGeneration, IStorageAccess storageAccess) { Console.WriteLine("Request handler created."); this.m_ProcessingThread = new Thread(this.Run); this.m_ProcessingThread.IsBackground = true; this.m_CurrentWorldSeedProvider = currentWorldSeedProvider; this.m_RenderingLocationProvider = renderingLocationProvider; this.m_AlgorithmFlowImageGeneration = algorithmFlowImageGeneration; this.m_StorageAccess = storageAccess; }
public TraceForm( IStorageAccess storageAccess, IAlgorithmTraceImageGeneration algorithmTraceImageGeneration, FlowElement flowElement, ICurrentWorldSeedProvider currentWorldSeedProvider) { this.m_AlgorithmTraceImageGeneration = algorithmTraceImageGeneration; this.InitializeComponent(); this.m_Layer = storageAccess.ToRuntime(((AlgorithmFlowElement)flowElement).Layer); this.m_Layer.SetSeed(currentWorldSeedProvider.Seed); this.c_FormZoomSize.Items.Add(new ZoomLevel { Level = 1 }); this.c_FormZoomSize.Items.Add(new ZoomLevel { Level = 2 }); this.c_FormZoomSize.SelectedIndex = 0; }
/// <summary> /// Attempt to remove the storage access. /// </summary> /// <param name="storageAccess">The <see cref="IStorageAccess"/> to remove.</param> /// <returns><c>true</c> if <paramref name="storageAccess"/> was successfully removed.</returns> /// <exception cref="System.ArgumentNullException">Thrown if <paramref name="storageAccess"/> is <c>null</c>.</exception> public static bool Remove(IStorageAccess storageAccess) { if (storageAccess == null) { throw new ArgumentNullException(); } var removed = false; IStorageAccess current; if (RegisteredStorageAccessProviders.Value.TryGetValue(storageAccess.GetType(), out current)) { if (object.ReferenceEquals(current, storageAccess)) { removed = RegisteredStorageAccessProviders.Value.TryRemove(storageAccess.GetType(), out current); } } return(removed); }
public FlowForm( IKernel kernel, IFormFactory formFactory, IStorageAccess storageAccess, Lazy<FlowProcessingPipeline> flowProcessingPipeline) { // TODO: Expose this in the UI. this.Seed = 0xDEADBEEF; this.InitializeComponent(); kernel.Rebind<IRenderingLocationProvider>().ToMethod(context => this); kernel.Rebind<ICurrentWorldSeedProvider>().ToMethod(context => this); this.m_FlowProcessingPipeline = flowProcessingPipeline.Value; this.m_FormFactory = formFactory; this.m_StorageAccess = storageAccess; if (this.m_FlowProcessingPipeline == null) throw new Exception("IFlowProcessingPipeline is not of type FlowProcessingPipeline."); this.m_FlowProcessingPipeline.FormConnect(this); this.CreateAnalysisActions(); this.UpdateStatusArea(); }
/// <summary> /// save to the storage interface /// </summary> /// <param name="storage"></param> private void SaveStorage(IStorageAccess storage) { //save file dialog string PathName; string FileName; if (!storage.SaveFileDialog(out PathName, out FileName)) { return; } //get the data to save string data = ComputeNode.SerializeComputeNode(); //save the data if (!storage.SaveFile(data, PathName, FileName)) { MessageBox.Show("There was an error saving the file."); return; } Close(); }
/// <summary> /// Verifies that a file exists at the given absolute path. /// </summary> /// <param name="filePath">The absolute path to the file.</param> /// <param name="storageAccess">The storage access to use; if <c>null</c> the default storage access is used.</param> /// <returns><c>true</c> if the file exists at the given path.</returns> /// <remarks>Requires a valid <see cref="IStorageAccess"/> to have been registered via <see cref="StreamUtilities.Initialize(IStorageAccess)"/> method.</remarks> public static bool FileExists(string filePath, IStorageAccess storageAccess = DefaultStorage) { return(GetStorageAccess(storageAccess).Exists(filePath)); }
/// <summary> /// Gets the error logs from the execution of an individual jobDetails. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.HDInsight.Job.IJobOperations. /// </param> /// <param name="jobId"> /// Required. The id of the job. /// </param> /// <param name="storageAccess"> /// Required. The storage account object of type IStorageAccess. /// </param> /// <returns> /// The error logs of an individual jobDetails by jobId. /// </returns> public static Stream GetJobErrorLogs(this IJobOperations operations, string jobId, IStorageAccess storageAccess) { return Task.Factory.StartNew( (object s) => ((IJobOperations)s).GetJobErrorLogsAsync(jobId, storageAccess), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default) .Unwrap() .GetAwaiter() .GetResult(); }
private void OnEnable() { _serializer = new JsonSerializer(); _storage = new FileStorageAccess(); }
internal string GetJobError(IStorageAccess storageAccess) { var output = HDInsightJobClient.GetJobError(JobId, storageAccess); var outputStr = Convert(output); return outputStr; }
public virtual Stream GetJobOutput(string jobid, IStorageAccess storageAccess) { var joboutput = HdInsightJobManagementClient.JobManagement.GetJobOutput(jobid, storageAccess); return(joboutput); }
protected FileMemo(IStorageAccess storageAccess) { StorageAccess = storageAccess; }
/// <summary> /// Opens a Stream using an absolute path. /// </summary> /// <param name="filePath">The absolute path to the file.</param> /// <param name="storageAccess">The storage access to use; if <c>null</c> the default storage access is used.</param> /// <returns>A Stream for accessing the contents of the file.</returns> /// <remarks>Requires a valid <see cref="IStorageAccess"/> to have been registered via <see cref="StreamUtilities.Initialize(IStorageAccess)"/> method.</remarks> public static Stream OpenFileStream(string filePath, IStorageAccess storageAccess = DefaultStorage) { return(GetStorageAccess(storageAccess).Open(filePath)); }
/// <summary> /// open from the storage interface /// </summary> /// <param name="storage"></param> private void OpenStorage(IStorageAccess storage) { //open file dialog string PathName; string FileName; if (!storage.OpenFileDialog(out PathName, out FileName)) return; //read the file string data; if (!storage.ReadFile(PathName, FileName, out data)) { MessageBox.Show("There was an error reading the file."); return; } //create the compute node and window IComputeNode compute_node = new ComputeNode().DeserializeComputeNode(data); ComputeNodeConfig dlg = new ComputeNodeConfig(compute_node); dlg.Show(); Close(); }
/// <summary> /// open amazon clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOpenAmazon_Click(object sender, RoutedEventArgs e) { IStorageAccess storage = StorageFactory.CreateStorageAccess(StorageFactory.StorageType.Amazon); HandleClick(storage); }
public DefaultGeneratorResolver(IStorageAccess storageAccess) { this.m_StorageAccess = storageAccess; this.EnsureLoaded(false); }
/// <summary> /// Gets the last modification time of the file at the given path. /// </summary> /// <param name="filePath">The absolute path to the file.</param> /// <param name="storageAccess">The storage access to use; if <c>null</c> the default storage access is used.</param> /// <returns>Last modification time of the file, in UTC.</returns> /// <remarks>Requires a valid <see cref="IStorageAccess"/> to have been registered via <see cref="StreamUtilities.Initialize(IStorageAccess)"/> method.</remarks> public static DateTime LastFileWriteTimeUtc(string filePath, IStorageAccess storageAccess = DefaultStorage) { return(GetStorageAccess(storageAccess).LastWriteTimeUtc(filePath)); }
public Stream GetJobError(string jobid, IStorageAccess storageAccess) { var joboutput = HdInsightJobManagementClient.JobManagement.GetJobErrorLogs(jobid, storageAccess); return joboutput; }
public Stream GetJobError(string jobid, IStorageAccess storageAccess) { var joboutput = HdInsightJobManagementClient.JobManagement.GetJobErrorLogs(jobid, storageAccess); return(joboutput); }
/// <summary> /// Gets the job error output content as memory stream. /// </summary> /// <param name='jobId'> /// Required. The id of the job. /// </param> /// <param name="storageAccess"> /// Required. The storage account object of type IStorageAccess. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> /// <returns> /// The job error output content as memory stream when job fails to run successfully. /// </returns> public async Task <Stream> GetJobErrorLogsAsync(string jobId, IStorageAccess storageAccess, CancellationToken cancellationToken) { var blobReferencePath = await GetJobStatusDirectory(jobId, "stderr"); return(storageAccess.GetFileContent(blobReferencePath)); }
/// <summary> /// Gets the job output content as memory stream. /// </summary> /// <param name='jobId'> /// Required. The id of the job. /// </param> /// <param name="storageAccess"> /// Required. The storage account object of type IStorageAccess. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> /// <returns> /// The job output content as memory stream. /// </returns> public async Task <Stream> GetJobOutputAsync(string jobId, IStorageAccess storageAccess, CancellationToken cancellationToken) { var blobReferencePath = await GetJobStatusDirectory(jobId, "stdout").ConfigureAwait(false); return(storageAccess.GetFileContent(blobReferencePath)); }
/// <summary> /// Gets the size, in bytes, of the file at the given absolute path. /// </summary> /// <param name="filePath">The absolute path to the file.</param> /// <param name="storageAccess">The storage access to use; if <c>null</c> the default storage access is used.</param> /// <returns>Length of the file, in bytes.</returns> /// <remarks>Requires a valid <see cref="IStorageAccess"/> to have been registered via <see cref="StreamUtilities.Initialize(IStorageAccess)"/> method.</remarks> public static long FileSize(string filePath, IStorageAccess storageAccess = DefaultStorage) { return(GetStorageAccess(storageAccess).Size(filePath)); }
/// <summary> /// save to the storage interface /// </summary> /// <param name="storage"></param> private void SaveStorage(IStorageAccess storage) { //save file dialog string PathName; string FileName; if (!storage.SaveFileDialog(out PathName, out FileName)) return; //get the data to save string data = ComputeNode.SerializeComputeNode(); //save the data if (!storage.SaveFile(data, PathName, FileName)) { MessageBox.Show("There was an error saving the file."); return; } Close(); }
/// <summary> /// Gets the error logs from the execution of an individual jobDetails. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.HDInsight.Job.IJobOperations. /// </param> /// <param name="jobId"> /// Required. The id of the job. /// </param> /// <param name="storageAccess"> /// Required. The storage account object of type IStorageAccess. /// </param> /// <returns> /// The error logs of an individual jobDetails by jobId. /// </returns> public static Task <Stream> GetJobErrorLogsAsync(this IJobOperations operations, string jobId, IStorageAccess storageAccess) { return(operations.GetJobErrorLogsAsync(jobId, storageAccess, CancellationToken.None)); }
/// <summary> /// Gets the error logs from the execution of an individual jobDetails. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.HDInsight.Job.IJobOperations. /// </param> /// <param name="jobId"> /// Required. The id of the job. /// </param> /// <param name="storageAccess"> /// Required. The storage account object of type IStorageAccess. /// </param> /// <returns> /// The error logs of an individual jobDetails by jobId. /// </returns> public static Task<Stream> GetJobErrorLogsAsync(this IJobOperations operations, string jobId, IStorageAccess storageAccess) { return operations.GetJobErrorLogsAsync(jobId, storageAccess, CancellationToken.None); }
public DataContainer(ISerializer serializer, IStorageAccess storageAccess) { _serializer = serializer; _storageAccess = storageAccess; }
/// <summary> /// handle the click and open/save mode /// </summary> /// <param name="storage"></param> private void HandleClick(IStorageAccess storage) { if (OpenMode) OpenStorage(storage); else SaveStorage(storage); }
public StorageDictionary(string parentStorageCapsuleID, IStorageAccess storageAccess) : base(parentStorageCapsuleID) { _storageAccess = storageAccess; _keyToReferenceID = new Dictionary <string, object>(); }