Documentation ¶
Overview ¶
package consoleprint contains the logic to update the console UI
Index ¶
- Constants
- func AddWarningToConsole(warning string)
- func Clear()
- func EnableStatusOutput()
- func ErrorPrint(msg string)
- func PrintState()
- func UpdateCollectionArgs(collectionArgs string)
- func UpdateCollectionMode(collectionMode string)
- func UpdateK8SContext(k8sContext string)
- func UpdateK8sFiles(fileName string)
- func UpdateNodeAutodetectDisabled(node string, enabled bool)
- func UpdateNodeState(nodeState NodeState)
- func UpdateResult(result string)
- func UpdateRuntime(ddcVersion, logFile, ddcYaml, collectionType string, enabled []string, ...)
- func UpdateTarballDir(tarballDir string)
- func WarningPrint(msg string)
- type CollectionStats
- type ErrorOut
- type NodeCaptureStats
- type NodeState
- type StatusUpdate
- type WarnOut
Constants ¶
const ( ResultPending = "PENDING" ResultFailure = "FAILURE" )
const ( Starting = "STARTING" CreatingRemoteDir = "CREATING_REMOTE_DIR" CopyDDCToHost = "COPY_DDC_TO_HOST" SettingDDCPermissions = "SETTING_DDC_PERMISSIONS" CopyDDCYaml = "COPY_DDC_YAML" Collecting = "COLLECTING" CollectingAwaitingTransfer = "COLLECTING_AWAITING_TRANSFER" TarballTransfer = "TARBALL_TRANSFER" Completed = "COMPLETED" DiskUsage = "DISK_USAGE" DremioConfig = "DREMIO_CONFIG" GcLog = "GC_LOG" Jfr = "JFR" Jstack = "JSTACK" JVMFlags = "JVM_FLAGS" MetadataLog = "METADATA_LOG" OSConfig = "OS_CONFIG" Queries = "QUERIES" ReflectionLog = "REFLECTION_LOG" ServerLog = "SERVER_LOG" Ttop = "TTOP" AccelerationLog = "ACCELERATION_LOG" AccessLog = "ACCESS_LOG" AuditLog = "AUDIT_LOG" JobProfiles = "JOB_PROFILES" KVStore = "KV_STORE" SystemTable = "SYSTEM_TABLE" Wlm = "WLM" HeapDump = "HEAP_DUMP" )
this is the list of different collection steps that are also communicated back to the Dremio UI, changing this involves a code change in Dremio as well.
Variables ¶
This section is empty.
Functions ¶
func AddWarningToConsole ¶ added in v3.2.2
func AddWarningToConsole(warning string)
AddWarningToConsole adds a trimed string to the list of warnings lines after the first line are also trimmed
func Clear ¶ added in v3.2.6
func Clear()
Clear resets the UI entirely, this is really only useful for debugging and testing
func EnableStatusOutput ¶
func EnableStatusOutput()
EnableStatusOutput enables the DDC json output that enables communication between DDC and the Dremio UI
func ErrorPrint ¶
func ErrorPrint(msg string)
ErrorPrint will either output either in json or pure text depending on if statusOut is enabled or not
func PrintState ¶
func PrintState()
PrintState clears the screen to prevent stale state, then prints out all of the current stats of the collection. Ideally this is executed quickly so we will want to avoid too many calculations in this method. This could be optimized for some future use case with a lot of executors and coordinators
func UpdateCollectionArgs ¶
func UpdateCollectionArgs(collectionArgs string)
func UpdateCollectionMode ¶
func UpdateCollectionMode(collectionMode string)
func UpdateK8SContext ¶ added in v3.2.3
func UpdateK8SContext(k8sContext string)
func UpdateK8sFiles ¶
func UpdateK8sFiles(fileName string)
func UpdateNodeAutodetectDisabled ¶
Update updates the CollectionStats fields in a thread-safe manner.
func UpdateNodeState ¶
func UpdateNodeState(nodeState NodeState)
Update updates the CollectionStats fields in a thread-safe manner.
func UpdateResult ¶
func UpdateResult(result string)
UpdateResult either outputs a json text for the Dremio UI indicating the result status has been updated or just stores the result and updates the end time for processing later
func UpdateRuntime ¶
func UpdateRuntime(ddcVersion, logFile, ddcYaml, collectionType string, enabled []string, disabled []string, patSet bool, transfersComplete, totalTransfers int)
Update updates the CollectionStats fields in a thread-safe manner.
func UpdateTarballDir ¶
func UpdateTarballDir(tarballDir string)
func WarningPrint ¶
func WarningPrint(msg string)
WarningPrint will either output either in json or pure text depending on if statusOut is enabled or not these should be interesting but not fatal
Types ¶
type CollectionStats ¶
type CollectionStats struct { TransfersComplete int // TransfersComplete shows the number of tarball transfers completed // contains filtered or unexported fields }
CollectionStats represents stats for a collection.
func (*CollectionStats) GetCollectionType ¶ added in v3.2.3
func (c *CollectionStats) GetCollectionType() string
GetCollectionType generates a friendly message useful for indicating what mechanism is used to transfer tarballs
type ErrorOut ¶
type ErrorOut struct {
Error string `json:"error"`
}
ErrorOut is for error messages so that the Dremio UI can display it.
type NodeCaptureStats ¶
type NodeCaptureStats struct {
// contains filtered or unexported fields
}
NodeCaptureStats represents stats for a node capture.
type StatusUpdate ¶
type StatusUpdate struct {
Result string `json:"result"` // Result shows the current result of the process, this can change over time
}
StatusUpdate struct for json communication with the Dremio UI, this is how the Dremio UI picks up status changes for the collection