/// <summary> /// Indicates whether all streams in a store have been marked as "closed". /// </summary> /// <param name="name">The name of the store to check.</param> /// <param name="path">The path of the store to check.</param> /// <returns>Returns true if all streams in the store are marked as closed.</returns> public static bool IsClosed(string name, string path) { bool allStreamsClosed = false; using (var p = Pipeline.Create()) { var importer = Store.Open(p, name, path); allStreamsClosed = importer.AvailableStreams.All(meta => meta.IsClosed); } return(allStreamsClosed); }
/// <summary> /// Crops a store between the extents of a specified interval, generating a new store. /// </summary> /// <param name="inputName">The name of the store to crop.</param> /// <param name="inputPath">The path of the store to crop.</param> /// <param name="outputName">The name of the cropped store.</param> /// <param name="outputPath">The path of the cropped store.</param> /// <param name="cropInterval">The time interval to which to crop the store.</param> /// <param name="createSubdirectory"> /// Indicates whether to create a numbered subdirectory for each cropped store /// generated by multiple calls to this method. /// </param> public static void Crop(string inputName, string inputPath, string outputName, string outputPath, TimeInterval cropInterval, bool createSubdirectory = true) { using (var pipeline = Pipeline.Create("CropStore")) { Importer inputStore = Store.Open(pipeline, inputName, inputPath); Exporter outputStore = Store.Create(pipeline, outputName, outputPath, createSubdirectory, inputStore.Serializers); // copy all streams from inputStore to outputStore foreach (var streamInfo in inputStore.AvailableStreams) { inputStore.CopyStream(streamInfo.Name, outputStore); } // run the pipeline to copy over the specified cropInterval pipeline.Run(cropInterval, true, false); } }