Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
da25a00
HubSpot Edit: Add HubSpot build setup
bbeaudreault Jan 10, 2024
7825699
HubSpot Edit: HBASE-28365: ChaosMonkey batch suspend/resume action as…
bbeaudreault Feb 12, 2024
ccc2716
HubSpot Edit: Add retries to verify step of ITBLL
bbeaudreault Feb 17, 2024
032cbf8
HubSpot Edit: Add an hbase-site.xml to our bundles that configures ZS…
charlesconnell Feb 2, 2024
8c8d387
HubSpot Edit: Add hdfs stats for local and remote rack bytes read
bbeaudreault Apr 19, 2024
aa64fe8
HubSpot Edit: Basic healthcheck servlets
bbeaudreault Apr 18, 2024
55f505f
HubSpot Edit: More info when interrupted while waiting on actions
bbeaudreault Mar 7, 2024
2a9fd1c
HubSpot Backport: HBASE-28513 The StochasticLoadBalancer should suppo…
rmdmattingly Feb 28, 2025
fe22899
HubSpot Backport: HBASE-29074 Balancer conditionals should support me…
rmdmattingly Mar 6, 2025
902ef00
HubSpot Backport: HBASE-29075 Balancer conditionals should support sy…
rmdmattingly Mar 7, 2025
390407d
HubSpot Backport: HBASE-29186 RegionPlanConditionals can produce a nu…
rmdmattingly Mar 17, 2025
7b3d9d1
HubSpot Backport: HBASE-29202 Balancer conditionals make balancer act…
rmdmattingly Mar 21, 2025
ddb32ca
HubSpot Backport: HBASE-29203 There should be a StorefileSize equival…
rmdmattingly Mar 21, 2025
9743688
HubSpot Edit: I messed up 29202, 29203 backports with incompatibiliti…
rmdmattingly Mar 21, 2025
fd9346a
HubSpot Backport: HBASE-29262 StochasticLoadBalancer should use the C…
rmdmattingly Apr 15, 2025
f4016f3
HubSpot Edit: add CLAUDE.md
charlesconnell May 9, 2025
eb12b65
HubSpot Backport: HBASE-29372: Meta cache clear metrics and logs shou…
hgromer Jun 4, 2025
8295247
HubSpot Backport: HBASE-29391: QueryMetrics are missing for HTable Ch…
hgromer Jun 13, 2025
f222f77
HubSpot Backport: HBASE-29351 Quotas: adaptive wait intervals (drop i…
rmdmattingly Jun 30, 2025
1c71c45
HubSpot Backport: HBASE-29447: Fix WAL archives cause incremental bac…
hgromer Jul 21, 2025
e10523f
HubSpot Backport: Rack aware incremental backup (not yet proposed ups…
Jul 14, 2025
84ac5b3
HubSpot Edit: Use branched buildpack
ritika03494 Jul 30, 2025
34e78ef
HubSpot Backport: HBASE-29502: Skip meta cache in RegionReplicaReplic…
charlesconnell Aug 7, 2025
3e424f7
HubSpot Backport: HBASE-29469 Add metrics with more detail for RpcThr…
sidkhillon Aug 20, 2025
6100853
HubSpot Backport: HBASE-29479: QuotaCache should always return accura…
charlesconnell Sep 3, 2025
7075df1
HubSpot Backport: HBASE-29573: Fully load QuotaCache instead of readi…
charlesconnell Sep 12, 2025
62caea8
HBASE-28440: Add support for using mapreduce sort in HFileOutputForma…
hgromer Sep 15, 2025
1e4070c
HubSpot Backport: HBASE-29577: Fix NPE from RegionServerRpcQuotaManag…
junegunn Sep 15, 2025
07c632f
HubSpot Backport: Thread safety in QuotaRefresherChore (not yet start…
charlesconnell Sep 17, 2025
cd6a84b
HubSpot Edit: Exclude org.jspecify:jspecify (can remove when hbase-th…
charlesconnell Sep 19, 2025
2c50a4a
Incremental backups fail on archived bulkloaded HFiles (not yet upstr…
hgromer Sep 23, 2025
d738cf9
Incremental backups fail on archived bulkloaded HFiles FIX (not yet u…
hgromer Sep 23, 2025
0bc7428
use offstack buildpack for modules (#200)
jaredstehler Sep 30, 2025
6c171c3
SnapshotRegionLocator should filter out offline regions and split reg…
hgromer Sep 30, 2025
4feb443
Revert "use offstack buildpack for modules (#200)" (#205)
hgromer Sep 30, 2025
f0c5cb9
HubSpot Backport: HBASE-29448: Modern backup failures can cause backu…
krconv Oct 7, 2025
08cf765
HubSpot Backport HBASE-29629 Record the quota user name value on metr…
sidkhillon Oct 8, 2025
7ec74b5
HubSpot Backport: HBASE-29604 BackupHFileCleaner uses flawed time bas…
ndimiduk Oct 14, 2025
e6cb400
Operation interceptor (not yet merged upstream) (#207)
rmdmattingly Oct 14, 2025
4e9241b
Improved operation interceptor instantiation (not yet merged upstream…
rmdmattingly Oct 16, 2025
8618a3c
Sets PRE_RUN_BEFORE_STEPS: false (#211)
ritika03494 Oct 17, 2025
7fdaa7d
HBASE-29679: Suppress stack trace in RpcThrottlingException (will be …
charlesconnell Oct 28, 2025
bbd5f71
Try Blazar-Buildpack-Java-oss-fork again
charlesconnell Oct 28, 2025
f7a27d7
(DO NOT UPSTREAM) Update incremental backups to support skipping log …
krconv Oct 28, 2025
b4a0fe6
HubSpot Edit: Warn when RegionCoprocessorRpcChannelImpl detects regio…
charlesconnell Nov 3, 2025
3ac3d23
HubSpot Edit (not yet upstreamed): Preserve WAL edit order (#215)
hgromer Nov 7, 2025
031bc4f
HubSpot Backport: HBASE-29663 TimeBasedLimiters should support dynami…
rmdmattingly Nov 24, 2025
64a249f
Fix walplayer mapping (not yet upstream) (#218)
hgromer Nov 24, 2025
ad62e7f
HBASE-29716 Include sequence ID on incremental backup HFiles (#221)
krconv Nov 25, 2025
5c35dad
Dont fail on snapshot timeout (#222)
hgromer Dec 3, 2025
6d4f77f
Expose SnapshotManifest for HubSpot applications (#225)
hgromer Dec 11, 2025
e3fc7cd
Log filtering in IncrementalBackupManager can lead to data loss (#226)
hgromer Dec 12, 2025
1074010
(Not upstreamed yet) HBASE-29776: Log filtering in IncrementalBackupM…
hgromer Dec 12, 2025
2711ed6
HBASE-29744: Data loss scenario for WAL files belonging to RS added b…
hgromer Dec 15, 2025
82ee29e
Fix an issue with duplicated backups of decommissioned host WAL files…
krconv Dec 16, 2025
f851ba4
HubSpot Backport: HBASE-29729 Add per-region table descriptor hash to…
ajkh88 Dec 19, 2025
3cc8905
Incremental Backups Superfluously Write Region Info (#230)
hgromer Dec 29, 2025
b0c61be
HBASE-29776: Log filtering in IncrementalBackupManager can lead to da…
hgromer Jan 5, 2026
39274a8
HubSpot Backport: HBASE-29782 Expose public Admin API to reopen table…
rmdmattingly Jan 11, 2026
9b7d727
HBASE-29827: BackupTables should return BackupInfo (#233)
hgromer Jan 14, 2026
626b554
Fix for NPE in region replication
krconv Jan 16, 2026
440e576
HBASE-29796 [branch-2] Allow sleepForRetry replication config to be o…
sidkhillon Jan 6, 2026
6c46410
Stop using new version of junit
Jan 8, 2026
39d766a
HBASE-29808 Simplify backup history retrieval (#7595) (#238)
hgromer Feb 17, 2026
5d865a4
HBASE-29846 Fix backup history ordering (#239)
hgromer Feb 18, 2026
de66f5e
BackupBoundaries global coverage can allow premature WAL deletion whe…
hgromer Feb 23, 2026
29f83bb
Speed up backups HFile cleaner (#240)
krconv Mar 6, 2026
c66114e
(Not yet upstream) Reset to last successful cell on EOF with WAL Comp…
sidkhillon Mar 10, 2026
e8c168e
HubSpot Backport HBASE-29987 Replication position corruption when WAL…
sidkhillon Mar 19, 2026
81f90da
Inefficient HFile format check in incremental backup bulkload copy (#…
hgromer Apr 2, 2026
d4083d5
Deleting a FAILED backup cascades and deletes subsequent COMPLETE bac…
hgromer Apr 2, 2026
5d1b341
Package a bundle for the MiniCluster (#245)
krconv Apr 3, 2026
deb067e
Fix blazar build (#246)
krconv Apr 3, 2026
45b717b
[Do not upstream] Filter temporary attributes produced by internal co…
sidkhillon Apr 23, 2026
eaf422c
exclude reload4j (#249)
hgromer Jun 23, 2026
42c1eff
[Not yet upstream] Serial replication can get stuck on empty ranges (…
sidkhillon Jul 27, 2026
4fc2773
Add metrics for HDFS checksum and no-checksum bytes read
Jul 28, 2026
d999265
Add methods to retrieve checksum and no-checksum bytes read metrics
Jul 28, 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
25 changes: 25 additions & 0 deletions .blazar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
buildpack:
name: Blazar-Buildpack-Java-oss-fork

env:
MAVEN_PHASE: "package assembly:single deploy"
HADOOP_DEP_VERSION: "3.3.6-hubspot-SNAPSHOT"
MAVEN_BUILD_ARGS: "-Phadoop-3.0 -Dhadoop.profile=3.0 -Dhadoop-three.version=$HADOOP_DEP_VERSION -Dgpg.skip=true -DskipTests -DdeployAtEnd -pl hbase-assembly -am -T1C"

# Below variables are generated in prepare_environment.sh.
# The build environment requires environment variables to be explicitly defined before they may
# be modified by the `write-build-env-var` utilty script to persist changes to an environment variable
# throughout a build
REPO_NAME: ""
SET_VERSION: ""
HBASE_VERSION: ""
PKG_RELEASE: ""
FULL_BUILD_VERSION: ""

before:
- description: "Prepare build environment"
commands:
- $WORKSPACE/build-scripts/prepare_environment.sh

provides:
- hbase
Empty file added .build-jdk17
Empty file.
5 changes: 5 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
When in the hubspot-2.6 branch, or sub-branches of that branch, use mvn11 instead of mvn, and use the hadoop-3.0 maven profile

When in the master branch, or sub-branches of that branch, use mvn17 instead of mvn, and do not use the hadoop-3.0 maven profile.

Always run the spotless:apply maven target after making changes.
97 changes: 97 additions & 0 deletions build-scripts/prepare_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#
# Generates the appropriate environment vars so that we:
# - build against the right version of hadoop, and properly set up maven
# - generate the correct maven version based on the branches
# - upload RPMs with the correct release based on the branch, and to the right yum repo
#
# Since we need to distribute .blazar.yaml to all sub-modules of the project, we define our constants once
# in this script which can be re-used by every .blazar.yaml.
#
set -ex
printenv

# We base the expected main branch and resulting maven version for clients on the hbase minor version
# The reason for this is hbase re-branches for each minor release (2.4, 2.5, 2.6, etc). At each re-branch
# the histories diverge. So we'll need to create our own fork of each new minor release branch.
# The convention is a fork named "hubspot-$minorVersion", and the maven coordinates "$minorVersion-hubspot-SNAPSHOT"
MINOR_VERSION="2.6"
MAIN_BRANCH="hubspot-${MINOR_VERSION}"

#
# Validate inputs from blazar
#

if [ -z "$WORKSPACE" ]; then
echo "Missing env var \$WORKSPACE"
exit 1
fi
if [ -z "$GIT_BRANCH" ]; then
echo "Missing env var \$GIT_BRANCH"
exit 1
fi
if [ -z "$BUILD_COMMAND_RC_FILE" ]; then
echo "Missing env var \$BUILD_COMMAND_RC_FILE"
exit 1
fi

#
# Extract current hbase version from root pom.xml
#

# the pom.xml has an invalid xml namespace, so just remove that so xmllint can parse it.
cat $WORKSPACE/pom.xml | sed '2 s/xmlns=".*"//g' > pom.xml.tmp
HBASE_VERSION=$(echo "cat /project/properties/revision/text()" | xmllint --nocdata --shell pom.xml.tmp | sed '1d;$d')
rm pom.xml.tmp

# sanity check that we've got some that looks right. it wouldn't be the end of the world if we got it wrong, but
# will help avoid confusion.
if [[ ! "$HBASE_VERSION" =~ 2\.[0-9]+\.[0-9]+ ]]; then
echo "Unexpected HBASE_Version extracted from pom.xml. Got $HBASE_VERSION but expected a string like '2.4.3', with 3 numbers separated by decimals, the first number being 2."
exit 1
fi

#
# Generate branch-specific env vars
# We are going to generate the maven version and the RPM release here:
# - For the maven version, we need to special case our main branch
# - For RPM, we want our final version to be:
# main branch: {hbase_version}-hs.{build_number}.el6
# other branches: {hbase_version}-hs~{branch_name}.{build_number}.el6, where branch_name substitutes underscore for non-alpha-numeric characters
#

echo "Git branch $GIT_BRANCH. Detecting appropriate version override and RPM release."

RELEASE="hs"

if [[ "$GIT_BRANCH" = "$MAIN_BRANCH" ]]; then
SET_VERSION="${MINOR_VERSION}-hubspot-SNAPSHOT"
REPO_NAME="AnyLinuxVersion_hs-hbase"
elif [[ "$GIT_BRANCH" != "hubspot" ]]; then
SET_VERSION="${MINOR_VERSION}-${GIT_BRANCH}-SNAPSHOT"
RELEASE="${RELEASE}~${GIT_BRANCH//[^[:alnum:]]/_}"
REPO_NAME="AnyLinuxVersion_hs-hbase-develop"
else
echo "Invalid git branch $GIT_BRANCH"
exit 1
fi

RELEASE="${RELEASE}.${BUILD_NUMBER}"
FULL_BUILD_VERSION="${HBASE_VERSION}-${RELEASE}"

# SET_VERSION is not the most intuitive name, but it's required for set-maven-versions script
write-build-env-var SET_VERSION "$SET_VERSION"
write-build-env-var HBASE_VERSION "$HBASE_VERSION"
write-build-env-var PKG_RELEASE "$RELEASE"
write-build-env-var FULL_BUILD_VERSION "$FULL_BUILD_VERSION"
write-build-env-var REPO_NAME "$REPO_NAME"
# Adding this value as versioninfo.version ensures we have the same value as would normally
# show up in a non-hubspot hbase build. Otherwise due to set-maven-versions we'd end up
# with 2.6-hubspot-SNAPSHOT which is not very useful as a point of reference.
# Another option would be to pass in our FULL_BUILD_VERSION but that might cause some funniness
# with the expectations in VersionInfo.compareVersion().
write-build-env-var MAVEN_BUILD_ARGS "$MAVEN_BUILD_ARGS -Dversioninfo.version=$HBASE_VERSION"

echo "Building HBase version $HBASE_VERSION"
echo "Will deploy to nexus with version $SET_VERSION"
echo "Will create rpm with version $FULL_BUILD_VERSION"
echo "Will run maven with extra args $MAVEN_BUILD_ARGS"
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public interface BackupAdmin extends Closeable {
* Backup given list of tables fully. This is a synchronous operation. It returns backup id on
* success or throw exception on failure.
* @param userRequest BackupRequest instance
* @return the backup Id
* @return backup info
*/

String backupTables(final BackupRequest userRequest) throws IOException;
BackupInfo backupTables(final BackupRequest userRequest) throws IOException;

/**
* Restore backup
Expand Down Expand Up @@ -77,18 +77,10 @@ public interface BackupAdmin extends Closeable {
void mergeBackups(String[] backupIds) throws IOException;

/**
* Show backup history command
* @param n last n backup sessions
* @return list of backup info objects
* @throws IOException exception
*/
List<BackupInfo> getHistory(int n) throws IOException;

/**
* Show backup history command with filters
* @param n last n backup sessions
* @param f list of filters
* @return list of backup info objects
* Retrieve info about the most recent backups.
* @param n number of backup infos desired
* @param f optional filters, only entries passing the filters will be returned
* @return a list of at most n entries, ordered from newest (most recent) to oldest (least recent)
* @throws IOException exception
*/
List<BackupInfo> getHistory(int n, BackupInfo.Filter... f) throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_BANDWIDTH_DESC;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_DEBUG;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_DEBUG_DESC;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_HFILE_LOCATION_RESOLVER;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_HFILE_LOCATION_RESOLVER_DESC;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_IGNORECHECKSUM;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_IGNORECHECKSUM_DESC;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_KEEP;
Expand All @@ -35,6 +37,8 @@
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_SET_DESC;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_TABLE;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_TABLE_DESC;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_WAL_LOCATION_RESOLVER;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_WAL_LOCATION_RESOLVER_DESC;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_WORKERS;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_WORKERS_DESC;
import static org.apache.hadoop.hbase.backup.BackupRestoreConstants.OPTION_YARN_QUEUE_NAME;
Expand Down Expand Up @@ -159,6 +163,8 @@ protected void addOptions() {
addOptWithArg(OPTION_PATH, OPTION_PATH_DESC);
addOptWithArg(OPTION_KEEP, OPTION_KEEP_DESC);
addOptWithArg(OPTION_YARN_QUEUE_NAME, OPTION_YARN_QUEUE_NAME_DESC);
addOptWithArg(OPTION_WAL_LOCATION_RESOLVER, OPTION_WAL_LOCATION_RESOLVER_DESC);
addOptWithArg(OPTION_HFILE_LOCATION_RESOLVER, OPTION_HFILE_LOCATION_RESOLVER_DESC);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.Set;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.Abortable;
import org.apache.hadoop.hbase.HBaseInterfaceAudience;
import org.apache.hadoop.hbase.TableName;
Expand Down Expand Up @@ -52,45 +51,57 @@ public class BackupHFileCleaner extends BaseHFileCleanerDelegate implements Abor
private boolean stopped = false;
private boolean aborted = false;
private Connection connection;
// timestamp of most recent read from backup system table
private long prevReadFromBackupTbl = 0;
// timestamp of 2nd most recent read from backup system table
private long secondPrevReadFromBackupTbl = 0;
private volatile long previousCleaningCompletionTimestamp = 0;
private volatile Set<String> bulkLoadedHFilesNeedingBackup = null;

@Override
public Iterable<FileStatus> getDeletableFiles(Iterable<FileStatus> files) {
public void preClean() {
if (stopped) {
return Collections.emptyList();
return;
}

// We use filenames because the HFile will have been moved to the archive since it
// was registered.
final Set<String> hfileFilenames = new HashSet<>();
try (BackupSystemTable tbl = new BackupSystemTable(connection)) {
Set<TableName> tablesIncludedInBackups = fetchFullyBackedUpTables(tbl);
Set<String> hfileFilenames = new HashSet<>();
for (BulkLoad bulkLoad : tbl.readBulkloadRows(tablesIncludedInBackups)) {
hfileFilenames.add(new Path(bulkLoad.getHfilePath()).getName());
String path = bulkLoad.getHfilePath();
hfileFilenames.add(path.substring(path.lastIndexOf('/') + 1));
}
LOG.debug("Found {} unique HFile filenames registered as bulk loads.", hfileFilenames.size());
bulkLoadedHFilesNeedingBackup = hfileFilenames;
LOG.debug("Cached {} unique HFile filenames registered as bulk loads.",
hfileFilenames.size());
} catch (IOException ioe) {
LOG.error(
"Failed to read registered bulk load references from backup system table, marking all files as non-deletable.",
ioe);
LOG.error("Failed to read registered bulk load references from backup system table, "
+ "marking all files as non-deletable.", ioe);
bulkLoadedHFilesNeedingBackup = null;
}
}

@Override
public void postClean() {
previousCleaningCompletionTimestamp = EnvironmentEdgeManager.currentTime();
bulkLoadedHFilesNeedingBackup = null;
}

@Override
public Iterable<FileStatus> getDeletableFiles(Iterable<FileStatus> files) {
if (stopped) {
return Collections.emptyList();
}

final Set<String> hfilesNeedingBackup = bulkLoadedHFilesNeedingBackup;
if (hfilesNeedingBackup == null) {
return Collections.emptyList();
}

secondPrevReadFromBackupTbl = prevReadFromBackupTbl;
prevReadFromBackupTbl = EnvironmentEdgeManager.currentTime();
final long recentFileThreshold = previousCleaningCompletionTimestamp;

return Iterables.filter(files, file -> {
// If the file is recent, be conservative and wait for one more scan of the bulk loads
if (file.getModificationTime() > secondPrevReadFromBackupTbl) {
if (file.getModificationTime() > recentFileThreshold) {
LOG.debug("Preventing deletion due to timestamp: {}", file.getPath().toString());
return false;
}
// A file can be deleted if it is not registered as a backup bulk load.
String hfile = file.getPath().getName();
if (hfileFilenames.contains(hfile)) {
if (hfilesNeedingBackup.contains(hfile)) {
LOG.debug("Preventing deletion due to bulk load registration in backup system table: {}",
file.getPath().toString());
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.function.Predicate;
import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.backup.util.BackupUtils;
Expand All @@ -46,13 +47,22 @@ public class BackupInfo implements Comparable<BackupInfo> {
private static final Logger LOG = LoggerFactory.getLogger(BackupInfo.class);
private static final int MAX_FAILED_MESSAGE_LENGTH = 1024;

public interface Filter {
/**
* Filter interface
* @param info backup info
* @return true if info passes filter, false otherwise
*/
boolean apply(BackupInfo info);
public interface Filter extends Predicate<BackupInfo> {
/** Returns true if the BackupInfo passes the filter, false otherwise */
@Override
boolean test(BackupInfo backupInfo);
}

public static Filter withRoot(String backupRoot) {
return info -> info.getBackupRootDir().equals(backupRoot);
}

public static Filter withType(BackupType type) {
return info -> info.getType() == type;
}

public static Filter withState(BackupState state) {
return info -> info.getState() == state;
}

/**
Expand All @@ -61,8 +71,7 @@ public interface Filter {
public enum BackupState {
RUNNING,
COMPLETE,
FAILED,
ANY
FAILED
}

/**
Expand Down Expand Up @@ -170,6 +179,8 @@ public enum BackupPhase {
*/
private boolean noChecksumVerify;

private boolean usePreviousLogRoll = false;

public BackupInfo() {
backupTableInfoMap = new HashMap<>();
}
Expand Down Expand Up @@ -211,6 +222,14 @@ public boolean getNoChecksumVerify() {
return noChecksumVerify;
}

public void setUsePreviousLogRoll(boolean usePreviousLogRoll) {
this.usePreviousLogRoll = usePreviousLogRoll;
}

public boolean getUsePreviousLogRoll() {
return usePreviousLogRoll;
}

public void setBackupTableInfoMap(Map<TableName, BackupTableInfo> backupTableInfoMap) {
this.backupTableInfoMap = backupTableInfoMap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public Builder withYarnPoolName(String name) {
return this;
}

public Builder withUsePreviousLogRoll(boolean usePreviousLogRoll) {
request.setUsePreviousLogRoll(usePreviousLogRoll);
return this;
}

public BackupRequest build() {
return request;
}
Expand All @@ -89,6 +94,7 @@ public BackupRequest build() {
private boolean noChecksumVerify = false;
private String backupSetName;
private String yarnPoolName;
private boolean usePreviousLogRoll = false;

private BackupRequest() {
}
Expand Down Expand Up @@ -163,4 +169,12 @@ public String getYarnPoolName() {
public void setYarnPoolName(String yarnPoolName) {
this.yarnPoolName = yarnPoolName;
}

private void setUsePreviousLogRoll(boolean usePreviousLogRoll) {
this.usePreviousLogRoll = usePreviousLogRoll;
}

public boolean getUsePreviousLogRoll() {
return this.usePreviousLogRoll;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ public interface BackupRestoreConstants {
String OPTION_YARN_QUEUE_NAME_DESC = "Yarn queue name to run backup create command on";
String OPTION_YARN_QUEUE_NAME_RESTORE_DESC = "Yarn queue name to run backup restore command on";

String OPTION_WAL_LOCATION_RESOLVER = "wal-location-resolver";
String OPTION_WAL_LOCATION_RESOLVER_DESC =
"WAL file location resolver class for rack-aware incremental backup";

String OPTION_HFILE_LOCATION_RESOLVER = "hfile-location-resolver";
String OPTION_HFILE_LOCATION_RESOLVER_DESC =
"HFile location resolver class for rack-aware bulk loading during incremental backup";

String JOB_NAME_CONF_KEY = "mapreduce.job.name";

String BACKUP_CONFIG_STRING = BackupRestoreConstants.BACKUP_ENABLE_KEY + "=true\n"
Expand Down
Loading