@ShellComponent public class CompactionCommand extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPACTION_EXE_SUCCESSFUL |
static String |
COMPACTION_SCH_EXE_SUCCESSFUL |
static String |
COMPACTION_SCH_SUCCESSFUL |
| Constructor and Description |
|---|
CompactionCommand() |
| Modifier and Type | Method and Description |
|---|---|
String |
compact(String parallelism,
String schemaFilePath,
String master,
String sparkMemory,
String retry,
String propsFilePath,
String[] configs) |
String |
compact(String parallelism,
String schemaFilePath,
String master,
String sparkMemory,
String retry,
String compactionInstantTime,
String propsFilePath,
String[] configs) |
String |
compactionsAll(boolean includeExtraMetadata,
Integer limit,
String sortByField,
boolean descending,
boolean headerOnly) |
String |
compactionShow(String compactionInstantTime,
Integer limit,
String sortByField,
boolean descending,
boolean headerOnly,
String partition) |
String |
compactionShowArchived(String compactionInstantTime,
Integer limit,
String sortByField,
boolean descending,
boolean headerOnly,
String partition) |
String |
compactionsShowArchived(boolean includeExtraMetadata,
String startTs,
String endTs,
Integer limit,
String sortByField,
boolean descending,
boolean headerOnly) |
protected static String |
printCompaction(org.apache.hudi.avro.model.HoodieCompactionPlan compactionPlan,
String sortByField,
boolean descending,
int limit,
boolean headerOnly,
String partition) |
String |
repairCompaction(String compactionInstant,
String parallelism,
String master,
String sparkMemory,
boolean dryRun,
Integer limit,
String sortByField,
boolean descending,
boolean headerOnly) |
String |
scheduleCompact(String sparkMemory,
String propsFilePath,
String[] configs,
String master) |
String |
unscheduleCompactFile(String fileId,
String partitionPath,
String master,
String sparkMemory,
boolean skipV,
boolean dryRun,
Integer limit,
String sortByField,
boolean descending,
boolean headerOnly) |
String |
unscheduleCompaction(String compactionInstant,
String parallelism,
String master,
String sparkMemory,
boolean skipV,
boolean dryRun,
Integer limit,
String sortByField,
boolean descending,
boolean headerOnly) |
String |
validateCompaction(String compactionInstant,
String parallelism,
String master,
String sparkMemory,
Integer limit,
String sortByField,
boolean descending,
boolean headerOnly) |
public static final String COMPACTION_SCH_SUCCESSFUL
public static final String COMPACTION_EXE_SUCCESSFUL
public static final String COMPACTION_SCH_EXE_SUCCESSFUL
@ShellMethod(key="compactions show all",
value="Shows all compactions that are in active timeline")
public String compactionsAll(@ShellOption(value="--includeExtraMetadata",help="Include extra metadata",defaultValue="false")
boolean includeExtraMetadata,
@ShellOption(value="--limit",help="Limit commits",defaultValue="-1")
Integer limit,
@ShellOption(value="--sortBy",help="Sorting Field",defaultValue="")
String sortByField,
@ShellOption(value="--desc",help="Ordering",defaultValue="false")
boolean descending,
@ShellOption(value="--headeronly",help="Print Header Only",defaultValue="false")
boolean headerOnly)
@ShellMethod(key="compaction show",
value="Shows compaction details for a specific compaction instant")
public String compactionShow(@ShellOption(value="--instant",help="Base path for the target hoodie table")
String compactionInstantTime,
@ShellOption(value="--limit",help="Limit commits",defaultValue="-1")
Integer limit,
@ShellOption(value="--sortBy",help="Sorting Field",defaultValue="")
String sortByField,
@ShellOption(value="--desc",help="Ordering",defaultValue="false")
boolean descending,
@ShellOption(value="--headeronly",help="Print Header Only",defaultValue="false")
boolean headerOnly,
@ShellOption(value="--partition",help="Partition value",defaultValue="__NULL__")
String partition)
throws Exception
Exception@ShellMethod(key="compactions showarchived",
value="Shows compaction details for specified time window")
public String compactionsShowArchived(@ShellOption(value="--includeExtraMetadata",help="Include extra metadata",defaultValue="false")
boolean includeExtraMetadata,
@ShellOption(value="--startTs",defaultValue="__NULL__",help="start time for compactions, default: now - 10 days")
String startTs,
@ShellOption(value="--endTs",defaultValue="__NULL__",help="end time for compactions, default: now - 1 day")
String endTs,
@ShellOption(value="--limit",help="Limit compactions",defaultValue="-1")
Integer limit,
@ShellOption(value="--sortBy",help="Sorting Field",defaultValue="")
String sortByField,
@ShellOption(value="--desc",help="Ordering",defaultValue="false")
boolean descending,
@ShellOption(value="--headeronly",help="Print Header Only",defaultValue="false")
boolean headerOnly)
@ShellMethod(key="compaction showarchived",
value="Shows compaction details for a specific compaction instant")
public String compactionShowArchived(@ShellOption(value="--instant",help="instant time")
String compactionInstantTime,
@ShellOption(value="--limit",help="Limit commits",defaultValue="-1")
Integer limit,
@ShellOption(value="--sortBy",help="Sorting Field",defaultValue="")
String sortByField,
@ShellOption(value="--desc",help="Ordering",defaultValue="false")
boolean descending,
@ShellOption(value="--headeronly",help="Print Header Only",defaultValue="false")
boolean headerOnly,
@ShellOption(value="--partition",help="Partition value",defaultValue="__NULL__")
String partition)
throws Exception
Exception@ShellMethod(key="compaction schedule",
value="Schedule Compaction")
public String scheduleCompact(@ShellOption(value="--sparkMemory",defaultValue="1G",help="Spark executor memory")
String sparkMemory,
@ShellOption(value="--propsFilePath",help="path to properties file on localfs or dfs with configurations for hoodie client for compacting",defaultValue="")
String propsFilePath,
@ShellOption(value="--hoodieConfigs",help="Any configuration that can be set in the properties file can be passed here in the form of an array",defaultValue="")
String[] configs,
@ShellOption(value="--sparkMaster",defaultValue="local",help="Spark Master")
String master)
throws Exception
Exception@ShellMethod(key="compaction run",
value="Run Compaction for given instant time")
public String compact(@ShellOption(value="--parallelism",defaultValue="3",help="Parallelism for hoodie compaction")
String parallelism,
@ShellOption(value="--schemaFilePath",help="Path for Avro schema file",defaultValue="")
String schemaFilePath,
@ShellOption(value="--sparkMaster",defaultValue="local",help="Spark Master")
String master,
@ShellOption(value="--sparkMemory",defaultValue="4G",help="Spark executor memory")
String sparkMemory,
@ShellOption(value="--retry",defaultValue="1",help="Number of retries")
String retry,
@ShellOption(value="--compactionInstant",help="Instant of compaction.request",defaultValue="__NULL__")
String compactionInstantTime,
@ShellOption(value="--propsFilePath",help="path to properties file on localfs or dfs with configurations for hoodie client for compacting",defaultValue="")
String propsFilePath,
@ShellOption(value="--hoodieConfigs",help="Any configuration that can be set in the properties file can be passed here in the form of an array",defaultValue="")
String[] configs)
throws Exception
Exception@ShellMethod(key="compaction scheduleAndExecute",
value="Schedule compaction plan and execute this plan")
public String compact(@ShellOption(value="--parallelism",defaultValue="3",help="Parallelism for hoodie compaction")
String parallelism,
@ShellOption(value="--schemaFilePath",help="Path for Avro schema file",defaultValue="__NULL__")
String schemaFilePath,
@ShellOption(value="--sparkMaster",defaultValue="local",help="Spark Master")
String master,
@ShellOption(value="--sparkMemory",defaultValue="4G",help="Spark executor memory")
String sparkMemory,
@ShellOption(value="--retry",defaultValue="1",help="Number of retries")
String retry,
@ShellOption(value="--propsFilePath",help="path to properties file on localfs or dfs with configurations for hoodie client for compacting",defaultValue="")
String propsFilePath,
@ShellOption(value="--hoodieConfigs",help="Any configuration that can be set in the properties file can be passed here in the form of an array",defaultValue="")
String[] configs)
throws Exception
Exceptionprotected static String printCompaction(org.apache.hudi.avro.model.HoodieCompactionPlan compactionPlan, String sortByField, boolean descending, int limit, boolean headerOnly, String partition)
@ShellMethod(key="compaction validate",
value="Validate Compaction")
public String validateCompaction(@ShellOption(value="--instant",help="Compaction Instant")
String compactionInstant,
@ShellOption(value="--parallelism",defaultValue="3",help="Parallelism")
String parallelism,
@ShellOption(value="--sparkMaster",defaultValue="local",help="Spark Master")
String master,
@ShellOption(value="--sparkMemory",defaultValue="2G",help="executor memory")
String sparkMemory,
@ShellOption(value="--limit",help="Limit commits",defaultValue="-1")
Integer limit,
@ShellOption(value="--sortBy",help="Sorting Field",defaultValue="")
String sortByField,
@ShellOption(value="--desc",help="Ordering",defaultValue="false")
boolean descending,
@ShellOption(value="--headeronly",help="Print Header Only",defaultValue="false")
boolean headerOnly)
throws Exception
Exception@ShellMethod(key="compaction unschedule",
value="Unschedule Compaction")
public String unscheduleCompaction(@ShellOption(value="--instant",help="Compaction Instant")
String compactionInstant,
@ShellOption(value="--parallelism",defaultValue="3",help="Parallelism")
String parallelism,
@ShellOption(value="--sparkMaster",defaultValue="local",help="Spark Master")
String master,
@ShellOption(value="--sparkMemory",defaultValue="2G",help="executor memory")
String sparkMemory,
@ShellOption(value="--skipValidation",help="skip validation",defaultValue="false")
boolean skipV,
@ShellOption(value="--dryRun",help="Dry Run Mode",defaultValue="false")
boolean dryRun,
@ShellOption(value="--limit",help="Limit commits",defaultValue="-1")
Integer limit,
@ShellOption(value="--sortBy",help="Sorting Field",defaultValue="")
String sortByField,
@ShellOption(value="--desc",help="Ordering",defaultValue="false")
boolean descending,
@ShellOption(value="--headeronly",help="Print Header Only",defaultValue="false")
boolean headerOnly)
throws Exception
Exception@ShellMethod(key="compaction unscheduleFileId",
value="UnSchedule Compaction for a fileId")
public String unscheduleCompactFile(@ShellOption(value="--fileId",help="File Id")
String fileId,
@ShellOption(value="--partitionPath",defaultValue="",help="partition path")
String partitionPath,
@ShellOption(value="--sparkMaster",defaultValue="local",help="Spark Master")
String master,
@ShellOption(value="--sparkMemory",defaultValue="2G",help="executor memory")
String sparkMemory,
@ShellOption(value="--skipValidation",help="skip validation",defaultValue="false")
boolean skipV,
@ShellOption(value="--dryRun",help="Dry Run Mode",defaultValue="false")
boolean dryRun,
@ShellOption(value="--limit",help="Limit commits",defaultValue="-1")
Integer limit,
@ShellOption(value="--sortBy",help="Sorting Field",defaultValue="")
String sortByField,
@ShellOption(value="--desc",help="Ordering",defaultValue="false")
boolean descending,
@ShellOption(value="--headeronly",help="Header Only",defaultValue="false")
boolean headerOnly)
throws Exception
Exception@ShellMethod(key="compaction repair",
value="Renames the files to make them consistent with the timeline as dictated by Hoodie metadata. Use when compaction unschedule fails partially.")
public String repairCompaction(@ShellOption(value="--instant",help="Compaction Instant")
String compactionInstant,
@ShellOption(value="--parallelism",defaultValue="3",help="Parallelism")
String parallelism,
@ShellOption(value="--sparkMaster",defaultValue="local",help="Spark Master")
String master,
@ShellOption(value="--sparkMemory",defaultValue="2G",help="executor memory")
String sparkMemory,
@ShellOption(value="--dryRun",help="Dry Run Mode",defaultValue="false")
boolean dryRun,
@ShellOption(value="--limit",help="Limit commits",defaultValue="-1")
Integer limit,
@ShellOption(value="--sortBy",help="Sorting Field",defaultValue="")
String sortByField,
@ShellOption(value="--desc",help="Ordering",defaultValue="false")
boolean descending,
@ShellOption(value="--headeronly",help="Print Header Only",defaultValue="false")
boolean headerOnly)
throws Exception
ExceptionCopyright © 2025 The Apache Software Foundation. All rights reserved.