Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Cmd = &cobra.Command{ Use: "reorg", Short: "Functions for handling ICE's reorg files", SilenceUsage: true, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }, }
Cmd is the parent for other Reorg related commands.
var ImportCmd = &cobra.Command{ Use: "import <datadir> <icefilesdir>", Short: "Import corporate actions announcements ", Long: `This command is used for importing corporate action entries from ICE's rerog files <datadir> must point to Marketstore's data directory <icefilesdir> must contain ICE's reorg.* and sirs.*/sirs.refresh.* files Each successfully imported rerog file will be renamed to reorg.*.processed to avoid reimporting it later By default, without --reimport option it only imports unprocessed data files (those without .processed suffix) With --reimport specified, it reprocess every file reorg.* file found in <icefilesdir>. Be aware that due to the nature of how marketstore stores records, it will duplicate corporate action announcements if run on already existing import --fallback-to-cusip allows Marketstore to store corporate action records by their TargetCusipID if a matching symbol is not found. Default is false, so only records with matching symbols are stored `, SilenceUsage: false, RunE: func(cmd *cobra.Command, args []string) error { // usage: import <datadir> <icefilesdir> const argLen = 2 if len(args) != argLen { _ = cmd.Help() return nil } dataDir := args[0] reorgDir := args[1] // walfile is rotated every walRotateInterval * primaryDiskRefreshInterval(= default:5min) const walRotateInterval = 5 _, _, _, err := executor.NewInstanceSetup(dataDir, nil, nil, walRotateInterval, executor.WALBypass(true), ) if err != nil { return fmt.Errorf("failed to create new instance setup for Import: %w", err) } utils.InstanceConfig.DisableVariableCompression = disableVarComp err = reorg.Import(reorgDir, reimport, storeWithoutSymbols) if err != nil { return fmt.Errorf("failed to import: %w", err) } return nil }, }
ImportCmd provides a command line interface for importing corporate action entries from ICE's data files without --reimport option it only imports unprocessed data files (those without .processed suffix) with --reimport specified, it reprocess every file found in <icefilesdir>. Be aware that due to the nature of how marketstore stores records, it will duplicate corporate action announcements if run on an already populated data directory.
var ShowRecordsCmd = &cobra.Command{ Use: "show <datadir> <cusip/symbol>", Short: "Shows corporate action announcement", Long: `This command shows accouncements stored for a given symbol or cusip <datadir> must point to Marketstore's data directory <cusip/symbol> is euther a CUSIP id or a symbol name Mainly for debugging / verification purposes. `, SilenceUsage: false, RunE: func(cmd *cobra.Command, args []string) error { // usage: show <datadir> <cusip/symbol> const argLen = 2 if len(args) != argLen { _ = cmd.Help() return nil } cusip := args[1] dataDir := args[0] // walfile is rotated every walRotateInterval * primaryDiskRefreshInterval(= default:5min) const walRotateInterval = 5 metadata, _, _, err := executor.NewInstanceSetup(dataDir, nil, nil, walRotateInterval, executor.WALBypass(true)) if err != nil { return fmt.Errorf("failed to create new instance setup for Show command: %w", err) } showRecords(cusip, metadata.CatalogDir) return nil }, }
ShowRecordsCmd shows stored corporate action announcements in marketstore. Its main purpose is to provide a way of verification of the imported data.
Functions ¶
This section is empty.
Types ¶
This section is empty.