/** * Get only the completed (no-inflights) commit + deltacommit timeline */ public HoodieTimeline getCompletedCommitsTimeline() { return metaClient.getCommitsTimeline().filterCompletedInstants(); }
/** * Get only the inflights (no-completed) commit timeline */ public HoodieTimeline getInflightCommitTimeline() { return metaClient.getCommitsTimeline().filterInflightsExcludingCompaction(); }
/** * Get only the completed (no-inflights) commit timeline */ public HoodieTimeline getCompletedCommitTimeline() { return metaClient.getCommitTimeline().filterCompletedInstants(); }
private void refreshFsView(FileStatus[] statuses) { metaClient = new HoodieTableMetaClient(metaClient.getHadoopConf(), basePath, true); if (statuses != null) { fsView = new HoodieTableFileSystemView(metaClient, metaClient.getActiveTimeline().getCommitsAndCompactionTimeline().filterCompletedAndCompactionInstants(), statuses); } else { fsView = new HoodieTableFileSystemView(metaClient, metaClient.getActiveTimeline().getCommitsAndCompactionTimeline().filterCompletedAndCompactionInstants()); } roView = (TableFileSystemView.ReadOptimizedView) fsView; rtView = (TableFileSystemView.RealtimeView) fsView; }
@CliCommand(value = "commits refresh", help = "Refresh the commits") public String refreshCommits() throws IOException { HoodieTableMetaClient metadata = new HoodieTableMetaClient(HoodieCLI.conf, HoodieCLI.tableMetadata.getBasePath()); HoodieCLI.setTableMetadata(metadata); return "Metadata for table " + metadata.getTableConfig().getTableName() + " refreshed."; }
@CliAvailabilityIndicator({"savepoint rollback"}) public boolean isRollbackToSavepointAvailable() { return HoodieCLI.tableMetadata != null && !HoodieCLI.tableMetadata.getActiveTimeline().getSavePointTimeline() .filterCompletedInstants().empty(); }
@Test public void checkMetadata() { assertEquals("Table name should be raw_trips", HoodieTestUtils.RAW_TRIPS_TEST_NAME, metaClient.getTableConfig().getTableName()); assertEquals("Basepath should be the one assigned", basePath, metaClient.getBasePath()); assertEquals("Metapath should be ${basepath}/.hoodie", basePath + "/.hoodie", metaClient.getMetaPath()); }
public HoodieActiveTimeline getActiveTimeline() { return metaClient.getActiveTimeline(); }
/** * Get the real time view of the file system for this table */ public TableFileSystemView.RealtimeView getRTFileSystemView() { return new HoodieTableFileSystemView(metaClient, metaClient.getCommitsAndCompactionTimeline().filterCompletedAndCompactionInstants()); }
@Override public String getPrompt() { if (HoodieCLI.tableMetadata != null) { String tableName = HoodieCLI.tableMetadata.getTableConfig().getTableName(); switch (HoodieCLI.state) { case INIT: return "hoodie->"; case DATASET: return "hoodie:" + tableName + "->"; case SYNC: return "hoodie:" + tableName + " <==> " + HoodieCLI.syncTableMetadata.getTableConfig().getTableName() + "->"; default: return "hoodie:" + tableName + "->"; } } return "hoodie->"; }
public String getBasePath() { return metaClient.getBasePath(); }
public Configuration getHadoopConf() { return metaClient.getHadoopConf(); }
/** * @return path where archived timeline is stored */ public String getArchivePath() { String archiveFolder = tableConfig.getArchivelogFolder(); if (archiveFolder.equals(HoodieTableConfig.DEFAULT_ARCHIVELOG_FOLDER)) { return getMetaPath(); } else { return getMetaPath() + "/" + archiveFolder; } }
@CliCommand(value = "savepoints refresh", help = "Refresh the savepoints") public String refreshMetaClient() throws IOException { HoodieTableMetaClient metadata = new HoodieTableMetaClient(HoodieCLI.conf, HoodieCLI.tableMetadata.getBasePath()); HoodieCLI.setTableMetadata(metadata); return "Metadata for table " + metadata.getTableConfig().getTableName() + " refreshed."; }
/** * Get only the completed (no-inflights) commit timeline */ public HoodieTimeline getCompletedCommitTimeline() { return metaClient.getCommitsTimeline().filterCompletedInstants(); }
public HoodieActiveTimeline getActiveTimeline() { return metaClient.getActiveTimeline(); }
/** * Get the real time view of the file system for this table */ public TableFileSystemView.RealtimeView getRTFileSystemView() { return new HoodieTableFileSystemView(metaClient, metaClient.getCommitsAndCompactionTimeline().filterCompletedAndCompactionInstants()); }
public Configuration getHadoopConf() { return metaClient.getHadoopConf(); }
/** * Get only the inflights (no-completed) commit timeline */ public HoodieTimeline getInflightCommitTimeline() { return metaClient.getCommitsTimeline().filterInflightsExcludingCompaction(); }
@CliCommand(value = "cleans refresh", help = "Refresh the commits") public String refreshCleans() throws IOException { HoodieTableMetaClient metadata = new HoodieTableMetaClient(HoodieCLI.conf, HoodieCLI.tableMetadata.getBasePath()); HoodieCLI.setTableMetadata(metadata); return "Metadata for table " + metadata.getTableConfig().getTableName() + " refreshed."; }