Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
26e20e4
feat(import): add support for multiple hbase snapshot imports
tianlei2 Apr 28, 2026
58cb66e
fix(import): add fork to compiler plugin and optimize GCS search in E…
tianlei2 Apr 28, 2026
66659a8
fix(import): format non-complying files for Google Java Style compliance
tianlei2 Apr 28, 2026
a1f9b04
fix(import): exclude hbase-shaded-client from mapreduce to prevent dn…
tianlei2 Apr 28, 2026
49c3e28
test(import): switch to mockito-inline and fix unit tests in ImportJo…
tianlei2 Apr 28, 2026
5ec8dc1
test(import): fix test isolation and timestamp parsing in SnapshotUti…
tianlei2 Apr 29, 2026
f1125d8
comment and file cleanup
tianlei2 May 6, 2026
e85775c
Add sharding test for HBase snapshot import
tianlei2 May 7, 2026
d595262
Apply style fixes and resilience updates for HBase snapshot import
tianlei2 May 7, 2026
4c5446e
Expose hardcoded options in TemplateUtils
tianlei2 May 7, 2026
3fbf8aa
Add unit tests for RegionConfigCoder, HbaseRegionSplitTracker, and Li…
tianlei2 May 7, 2026
b7866da
Refactor ReadRegions.java into multiple files and add unit tests
tianlei2 May 7, 2026
4da7066
Stabilize HBase snapshot import and refactor tests
tianlei2 May 16, 2026
270c8ee
Harden ReadSnapshotRegion splitting and tracking logic
tianlei2 May 19, 2026
0a6f2a3
Harden CreateBigtableMutations against OOM and NPE
tianlei2 May 19, 2026
828a6aa
Harden sharding math in ReadRegions
tianlei2 May 19, 2026
0a48635
Isolate restore path in SnapshotUtils
tianlei2 May 19, 2026
f443819
Optimize configuration caching in ListRegions and SnapshotConfig
tianlei2 May 19, 2026
9b6d325
Harden HBaseRegionScanner by disabling background threads
tianlei2 May 19, 2026
a0f9a82
Add unit tests for Transforms
tianlei2 May 19, 2026
f133b04
Add utility and scanner tests
tianlei2 May 19, 2026
3fc6786
Harden cleanup orchestration in CleanupRestoredSnapshots
tianlei2 May 19, 2026
fa3b802
Restore snapshot idempotency in RestoreSnapshot and ImportJob
tianlei2 May 19, 2026
37d6d65
Merge remote-tracking branch 'origin/main' into dataflow-import
tianlei2 May 19, 2026
c1b3011
Improve documentation and comments in bigtable-beam-import
tianlei2 May 19, 2026
727e9f3
Update bigtable-dataflow-parent/bigtable-beam-import/src/main/java/co…
tianlei2 May 19, 2026
82465e8
Update bigtable-dataflow-parent/bigtable-beam-import/src/main/java/co…
tianlei2 May 19, 2026
4206cdd
Update bigtable-dataflow-parent/bigtable-beam-import/src/main/java/co…
tianlei2 May 19, 2026
afc4f3f
Apply Gemini Code Assist suggestions to ImportConfig and ImportJob
tianlei2 May 19, 2026
0ed8356
Use parameterized logging in HBaseSnapshotRestoreTool
tianlei2 May 19, 2026
c4ae5d8
Fix logging in HBaseSnapshotRestoreTool for Commons Logging compatibi…
tianlei2 May 19, 2026
5be9e32
Rename DoFn classes to follow Beam convention with Fn suffix
tianlei2 May 21, 2026
2346ddc
Refactor CreateBigtableMutationsFn to use idiomatic Java patterns bas…
tianlei2 May 26, 2026
27d60fb
Refactor pipeline to use lightweight SnapshotKey instead of SnapshotC…
tianlei2 May 26, 2026
ca63ba2
Apply cleanups and documentation updates to snapshot import
tianlei2 May 26, 2026
5017ba5
Swap order of cell and row size checks in CreateBigtableMutationsFn t…
tianlei2 May 27, 2026
2c99ab3
Decouple cell counters in CreateBigtableMutationsFn to fix edge case …
tianlei2 May 27, 2026
73dc1dd
Add boundary tests for filterWideRows in CreateBigtableMutationsFnTest
tianlei2 May 27, 2026
039692e
Add interaction tests for filters in CreateBigtableMutationsFnTest
tianlei2 May 27, 2026
5372b48
Add branch coverage test for loggedLargeCellForRow in CreateBigtableM…
tianlei2 May 27, 2026
6ccdc3c
Fix NullPointerException in SnapshotUtilsTest by setting both Id and …
tianlei2 May 27, 2026
c4b4314
Reformat files with google-java-format
tianlei2 May 27, 2026
35db769
Add reference to Beam source code in ReadSnapshotRegionFn and reformat
tianlei2 May 27, 2026
51d2b5b
Use region StartKey as key in computeRegionSize to avoid duplicate ke…
tianlei2 May 27, 2026
b1d84f1
Reformat ListRegions.java after StartKey fix
tianlei2 May 27, 2026
2f65002
Mock getStartKey in ListRegionsTest to fix NPE
tianlei2 May 27, 2026
03d3cff
Apply Gemini bot recommendations: fix null checks, make coder non-det…
tianlei2 May 28, 2026
2aa610d
Clean up imports and use short names in ReadRegionsTest
tianlei2 May 28, 2026
4b75b2f
Clean up imports and use short names in ReadSnapshotRegionFnTest
tianlei2 May 28, 2026
0b71307
Use estimatedSerializedSizeOf instead of heapSize in CreateBigtableMu…
tianlei2 May 28, 2026
11f7768
Commit SnapshotUtils fixes and formatted CreateBigtableMutationsFnTest
tianlei2 May 28, 2026
a2a5b93
Reformat CreateBigtableMutationsFn.java with google-java-format 1.35.0
tianlei2 May 28, 2026
e06e3f4
Update bigtable-dataflow-parent/bigtable-beam-import/src/main/java/co…
tianlei2 May 28, 2026
42592c3
Apply Gemini bot recommendations for null checks and resource leaks
tianlei2 May 28, 2026
a8e1db5
Add Javadocs to SnapshotConfig methods and update comment in CreateBi…
tianlei2 May 28, 2026
aa338e8
Mark SnapshotConfig and HBaseRegionScanner as InternalApi
tianlei2 May 28, 2026
7fc3131
Commit SnapshotKey annotation and detailed comment in CreateBigtableM…
tianlei2 May 28, 2026
228d196
Add detailed comments in CreateBigtableMutationsFn and reformat
tianlei2 May 28, 2026
f86d079
Mark HBaseSnapshotInputConfigBuilder as InternalApi
tianlei2 May 28, 2026
9f0fcc8
Simplify null checks in processElement and mark ImportConfig as Inter…
tianlei2 May 28, 2026
463c2c5
Apply user edits and reformat CreateBigtableMutationsFn.java
tianlei2 May 28, 2026
6fb4c65
Reformat HBaseSnapshotInputConfigBuilder and SnapshotConfig with work…
tianlei2 May 28, 2026
3001b61
Add comment explaining GC thrashing disable in ImportJob
tianlei2 May 28, 2026
221163e
Add validation logic for backoff settings in ImportConfig and introdu…
tianlei2 Jun 2, 2026
c5c47a4
Add Javadoc detailing deferred limit validation to Bigtable client/se…
tianlei2 Jun 2, 2026
8716a51
Centralize null checks for sourcepath and snapshotInfos inside Import…
tianlei2 Jun 3, 2026
dd8eb05
Fix order of validation and restore path setup to throw clean NullPoi…
tianlei2 Jun 3, 2026
fd7fee4
Refactor bulk mutation timeout null safety, support local file system…
tianlei2 Jun 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
53 changes: 46 additions & 7 deletions bigtable-dataflow-parent/bigtable-beam-import/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,33 @@ limitations under the License.
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Version alignment -->
<!-- Mark all annotations as provided. They don't affect the runtime of the pipeline so
there is no need to try to version align them -->
<dependency>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are they added in dependency management instead of dependencies?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are annotations only needed for compilation. Placing them here with provided scope ensures they don't get included in the final shaded JAR if other libraries pull them in.

Copy link
Copy Markdown
Contributor

@mutianf mutianf May 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why are they added to <dependencyManagement> block instead of <dependencies> ?

Copy link
Copy Markdown
Author

@tianlei2 tianlei2 May 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't want to add those as dependencies, it's used to control the version and scope of transitive dependencies. Other libraries that use them will pull them in automatically as transitive dependencies.

From gemini:
<dependencies>: This block actually adds the dependency to your project. If you put a dependency here, Maven will download it and include it in your project's classpath.
<dependencyManagement>: This block does NOT add the dependency to your project. Instead, it acts as a version map or rule book. It tells Maven: "IF this project (or any of its child modules) uses this dependency, use THIS specific version and THIS scope."

<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>3.31.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.18.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-annotations</artifactId>
<version>1.22</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -118,6 +145,10 @@ limitations under the License.
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-shaded-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand All @@ -134,7 +165,11 @@ limitations under the License.
<artifactId>beam-runners-direct-java</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-emulator-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-shaded-testing-util</artifactId>
Expand All @@ -148,11 +183,6 @@ limitations under the License.
</exclusions>
</dependency>

<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-emulator-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.cloud.bigtable</groupId>
<artifactId>bigtable-internal-test-helper</artifactId>
Expand Down Expand Up @@ -186,7 +216,7 @@ limitations under the License.
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
Expand Down Expand Up @@ -221,6 +251,14 @@ limitations under the License.


<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
Expand Down Expand Up @@ -287,6 +325,7 @@ limitations under the License.
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/services/java.net.spi.InetAddressResolverProvider</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.google.bigtable.repackaged.com.google.api.core.InternalApi;
import com.google.bigtable.repackaged.com.google.api.core.InternalExtensionOnly;
import com.google.cloud.bigtable.beam.hbasesnapshots.HBaseSnapshotRestoreTool;
import com.google.cloud.bigtable.beam.hbasesnapshots.ImportJobFromHbaseSnapshot;
import com.google.cloud.bigtable.beam.sequencefiles.CreateTableHelper;
import com.google.cloud.bigtable.beam.sequencefiles.ExportJob;
Expand Down Expand Up @@ -51,6 +52,9 @@ public static void main(String[] args) throws Exception {
case "importsnapshot":
ImportJobFromHbaseSnapshot.main(subArgs);
break;
case "restoresnapshot":
HBaseSnapshotRestoreTool.main(subArgs);
break;
case "create-table":
CreateTableHelper.main(subArgs);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import com.google.cloud.bigtable.beam.sequencefiles.ImportJob.ImportOptions;
import com.google.cloud.bigtable.beam.validation.SyncTableJob.SyncTableOptions;
import com.google.cloud.bigtable.hbase.BigtableOptionsFactory;
import com.google.cloud.bigtable.hbase.wrappers.BigtableHBaseSettings;
import java.util.concurrent.TimeUnit;
import org.apache.beam.sdk.options.ValueProvider;

/**
Expand All @@ -44,7 +46,16 @@ public static CloudBigtableTableConfiguration buildImportConfig(
.withProjectId(opts.getBigtableProject())
.withInstanceId(opts.getBigtableInstanceId())
.withTableId(opts.getBigtableTableId())
.withConfiguration(BigtableOptionsFactory.CUSTOM_USER_AGENT_KEY, customUserAgent);
.withConfiguration(BigtableOptionsFactory.CUSTOM_USER_AGENT_KEY, customUserAgent)
.withConfiguration(
BigtableOptionsFactory.MAX_INFLIGHT_RPCS_KEY,
ValueProvider.NestedValueProvider.of(opts.getMaxInflightRpcs(), String::valueOf))
.withConfiguration(
BigtableHBaseSettings.BULK_MUTATION_CLOSE_TIMEOUT_MILLISECONDS,
ValueProvider.NestedValueProvider.of(
opts.getBulkMutationCloseTimeoutMinutes(),
(Integer minutes) ->
String.valueOf(TimeUnit.MINUTES.toMillis(minutes == null ? 30 : minutes))));
if (opts.getBigtableAppProfileId() != null) {
builder.withAppProfileId(opts.getBigtableAppProfileId());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.bigtable.beam.hbasesnapshots;

import com.google.api.core.InternalExtensionOnly;
import com.google.cloud.bigtable.beam.hbasesnapshots.conf.ImportConfig;
import com.google.cloud.bigtable.beam.hbasesnapshots.conf.SnapshotConfig;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import org.apache.beam.sdk.extensions.gcp.options.GcsOptions;
import org.apache.beam.sdk.options.PipelineOptionsFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.snapshot.RestoreSnapshotHelper;

/**
* Tool to restore HBase snapshots in GCS for scanning. This tool runs locally (without Dataflow)
* and copies snapshot files to a restore path, resolving HLinks and References so that they can be
* read by a scanner.
*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be a bit more descriptive, see

/**
* Beam job to export a Bigtable table to a set of SequenceFiles. Afterwards, the files can be
* either imported into another Bigtable or HBase table. You can limit the rows and columns exported
* using the options in {@link ExportOptions}. Please note that the rows in SequenceFiles will not
* be sorted.
*
* <p>Furthermore, you can export a subset of the data using a combination of --bigtableStartRow,
* --bigtableStopRow and --bigtableFilter.
*
* <p>Execute the following command to run the job directly:
*
* <pre>
* {@code mvn compile exec:java \
* -Dexec.mainClass=com.google.cloud.bigtable.beam.sequencefiles.ExportJob \
* -Dexec.args="--runner=dataflow \
* --project=[PROJECT_ID] \
* --tempLocation=gs://[BUCKET]/[TEMP_PATH] \
* --bigtableInstanceId=[INSTANCE] \
* --bigtableTableId=[TABLE] \
* --destination=gs://[BUCKET]/[EXPORT_PATH] \
* --maxNumWorkers=[nodes * 10]"
* }
* </pre>
*
* <p>Execute the following command to create the Dataflow template:
*
* <pre>
* mvn compile exec:java \
* -DmainClass=com.google.cloud.bigtable.beam.sequencefiles.ExportJob \
* -Dexec.args="--runner=DataflowRunner \
* --project=[PROJECT_ID] \
* --stagingLocation=gs://[STAGING_PATH] \
* --templateLocation=gs://[TEMPLATE_PATH] \
* --wait=false"
* </pre>
*
* <p>There are a few ways to run the pipeline using the template. See Dataflow doc for details:
* https://cloud.google.com/dataflow/docs/templates/executing-templates. Optionally, you can upload
* a metadata file that contains information about the runtime parameters that can be used for
* parameter validation purpose and more. A sample metadata file can be found at
* "src/main/resources/ExportJob_metadata".
*
* <p>An example using gcloud command line:
*
* <pre>
* gcloud beta dataflow jobs run [JOB_NAME] \
* --gcs-location gs://[TEMPLATE_PATH] \
* --parameters bigtableProject=[PROJECT_ID],bigtableInstanceId=[INSTANCE],bigtableTableId=[TABLE],destinationPath=gs://[DESTINATION_PATH],filenamePrefix=[FILENAME_PREFIX]
* </pre>
*/
for an example.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* <p>Execute the following command to run the tool directly using system properties:
*
* <pre>
* {@code mvn compile exec:java \
* -Dexec.mainClass=com.google.cloud.bigtable.beam.hbasesnapshots.HBaseSnapshotRestoreTool \
* -Dproject=[PROJECT_ID] \
* -DhbaseSnapshotSourceDir=gs://[BUCKET]/[HBASE_EXPORT_ROOT_PATH]/data \
* -Dsnapshots=[SNAPSHOT_NAMES] \
* -DrestorePath=gs://[BUCKET]/[HBASE_EXPORT_ROOT_PATH]/restore
* }
* </pre>
*
* <p>Alternatively, you can provide a path to a JSON configuration file:
*
* <pre>
* {@code mvn compile exec:java \
* -Dexec.mainClass=com.google.cloud.bigtable.beam.hbasesnapshots.HBaseSnapshotRestoreTool \
* -Dproject=[PROJECT_ID] \
* -DimportConfigFilePath=[PATH_TO_JSON_CONFIG]
* }
* </pre>
*
* <p>The JSON configuration file should have the following format:
*
* <pre>
* {
* "sourcepath": "gs://[BUCKET]/[HBASE_EXPORT_ROOT_PATH]/data",
* "restorepath": "gs://[BUCKET]/[HBASE_EXPORT_ROOT_PATH]/restore",
* "snapshots": {
* "snapshot1": "table1",
* "snapshot2": "table2"
* }
* }
* </pre>
*/
@InternalExtensionOnly
public class HBaseSnapshotRestoreTool {
private static final Log LOG = LogFactory.getLog(HBaseSnapshotRestoreTool.class);

private static final String PROJECT_PROPERTY = "project";
private static final String IMPORT_CONFIG_FILE_PATH_PROPERTY = "importConfigFilePath";
private static final String HBASE_SNAPSHOT_SOURCE_DIR_PROPERTY = "hbaseSnapshotSourceDir";
private static final String SNAPSHOTS_PROPERTY = "snapshots";
private static final String RESTORE_PATH_PROPERTY = "restorePath";

public static void main(String[] args) throws Exception {
GcsOptions options = PipelineOptionsFactory.create().as(GcsOptions.class);
String project = System.getProperty(PROJECT_PROPERTY);
if (project != null) {
options.setProject(project);
}

ImportConfig importConfig =
System.getProperty(IMPORT_CONFIG_FILE_PATH_PROPERTY) != null
? buildImportConfigFromConfigFile(System.getProperty(IMPORT_CONFIG_FILE_PATH_PROPERTY))
: buildImportConfigFromArgs(options);

LOG.info(
String.format(
"SourcePath:%s, RestorePath:%s",
importConfig.getSourcepath(), importConfig.getRestorepath()));

Map<String, String> configurations =
SnapshotUtils.getConfiguration(
null, // invoke from a DirectRunner without using dataflow
options.getProject(),
importConfig.getSourcepath(),
importConfig.getHbaseConfiguration());

List<SnapshotConfig> snapshotConfigs =
SnapshotUtils.buildSnapshotConfigs(
importConfig.getSnapshots(),
configurations,
options.getProject(),
importConfig.getSourcepath(),
importConfig.getRestorepath());

for (SnapshotConfig config : snapshotConfigs) {
restoreSnapshot(config);
}
}

@VisibleForTesting
static ImportConfig buildImportConfigFromArgs(GcsOptions gcsOptions) throws IOException {
String sourceDir = System.getProperty(HBASE_SNAPSHOT_SOURCE_DIR_PROPERTY);
String snapshotsProperty = System.getProperty(SNAPSHOTS_PROPERTY);
Map<String, String> snapshots = null;
if (snapshotsProperty != null) {
snapshots =
(sourceDir != null && SnapshotUtils.isRegex(snapshotsProperty))
? SnapshotUtils.getSnapshotsFromSnapshotPath(
sourceDir, gcsOptions.getGcsUtil(), snapshotsProperty)
: SnapshotUtils.getSnapshotsFromString(snapshotsProperty);
}

ImportConfig importConfig = new ImportConfig();
importConfig.setSourcepath(sourceDir);
if (snapshots != null) {
importConfig.setSnapshotsFromMap(snapshots);
}
importConfig.validate();
SnapshotUtils.setRestorePath(System.getProperty(RESTORE_PATH_PROPERTY), importConfig);

return importConfig;
}

@VisibleForTesting
static ImportConfig buildImportConfigFromConfigFile(String configFilePath) throws Exception {
Gson gson = new GsonBuilder().create();
ImportConfig importConfig =
gson.fromJson(SnapshotUtils.readFileContents(configFilePath), ImportConfig.class);
Preconditions.checkNotNull(importConfig, "ImportConfig parsed from file cannot be null.");
importConfig.validate();
SnapshotUtils.setRestorePath(importConfig.getRestorepath(), importConfig);
return importConfig;
}

@VisibleForTesting
/**
* Creates a copy of Snasphsot from the source path into restore path.
*
* @param snapshotConfig - Snapshot Configuration
* @throws IOException
*/
static void restoreSnapshot(SnapshotConfig snapshotConfig) throws IOException {
Path sourcePath = snapshotConfig.getSourcePath();
Path restorePath = snapshotConfig.getRestorePath();
Configuration configuration = snapshotConfig.getConfiguration();
LOG.info(
String.format("RestoreSnapshot - sourcePath:%s restorePath: %s", sourcePath, restorePath));
FileSystem fileSystem = sourcePath.getFileSystem(configuration);
if (fileSystem.exists(restorePath)) {
LOG.info(
String.format(
"Restore path %s already exists, deleting it for idempotency", restorePath));
fileSystem.delete(restorePath, true);
}
RestoreSnapshotHelper.copySnapshotForScanner(
configuration, fileSystem, sourcePath, restorePath, snapshotConfig.getSnapshotName());
Comment thread
tianlei2 marked this conversation as resolved.
}
}
Loading
Loading