From b70653275535512819d8e000e3c0043ab448363d Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Wed, 31 Oct 2018 14:50:52 -0400 Subject: [PATCH] HBASE-21415 Snapshot requests can be done concurrently and the master will simply run them sequentially. Co-authored-by: Josh Elser --- .../org/apache/hadoop/hbase/client/Admin.java | 28 ++++++++++--------- .../hadoop/hbase/client/AsyncAdmin.java | 15 +++++----- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java index 14abb6e230..b6ad2b37d8 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java @@ -1333,7 +1333,8 @@ public interface Admin extends Abortable, Closeable { /** * Take a snapshot for the given table. If the table is enabled, a FLUSH-type snapshot will be - * taken. If the table is disabled, an offline snapshot is taken. Snapshots are considered unique + * taken. If the table is disabled, an offline snapshot is taken. Snapshots are taken + * sequentially even when requested concurrently. Snapshots are considered unique * based on the name of the snapshot. Attempts to take a snapshot with the same name (even * a different type or with different parameters) will fail with a * {@link org.apache.hadoop.hbase.snapshot.SnapshotCreationException} indicating the duplicate @@ -1352,9 +1353,10 @@ public interface Admin extends Abortable, Closeable { /** * Create typed snapshot of the table. Snapshots are considered unique based on the name of the - * snapshot. Attempts to take a snapshot with the same name (even a different type or with - * different parameters) will fail with a {@link SnapshotCreationException} indicating the - * duplicate naming. Snapshot names follow the same naming constraints as tables in HBase. See + * snapshot. Snapshots are taken sequentially even when requested concurrently. Attempts to + * take a snapshot with the same name (even a different type or with different parameters) will + * fail with a {@link SnapshotCreationException} indicating the duplicate naming. Snapshot names + * follow the same naming constraints as tables in HBase. See * {@link org.apache.hadoop.hbase.TableName#isLegalFullyQualifiedTableName(byte[])}. * @param snapshotName name to give the snapshot on the filesystem. Must be unique from all other * snapshots stored on the cluster @@ -1370,13 +1372,12 @@ public interface Admin extends Abortable, Closeable { } /** - * Take a snapshot and wait for the server to complete that snapshot (blocking). Only a single - * snapshot should be taken at a time for an instance of HBase, or results may be undefined (you - * can tell multiple HBase clusters to snapshot at the same time, but only one at a time for a - * single cluster). Snapshots are considered unique based on the name of the snapshot. - * Attempts to take a snapshot with the same name (even a different type or with different - * parameters) will fail with a {@link SnapshotCreationException} indicating the duplicate naming. - * Snapshot names follow the same naming constraints as tables in HBase. See + * Take a snapshot and wait for the server to complete that snapshot (blocking). Snapshots are + * considered unique based on the name of the snapshot. Snapshots are taken sequentially + * even when requested concurrently. Attempts to take a snapshot with the same name (even a + * different type or with different parameters) will fail with a + * {@link SnapshotCreationException} indicating the duplicate naming. Snapshot names follow the + * same naming constraints as tables in HBase. See * {@link org.apache.hadoop.hbase.TableName#isLegalFullyQualifiedTableName(byte[])}. You should * probably use {@link #snapshot(String, org.apache.hadoop.hbase.TableName)} unless you are sure * about the type of snapshot that you want to take. @@ -1389,8 +1390,9 @@ public interface Admin extends Abortable, Closeable { throws IOException, SnapshotCreationException, IllegalArgumentException; /** - * Take a snapshot without waiting for the server to complete that snapshot (asynchronous) Only a - * single snapshot should be taken at a time, or results may be undefined. + * Take a snapshot without waiting for the server to complete that snapshot (asynchronous). + * Snapshots are considered unique based on the name of the snapshot. Snapshots are taken + * sequentially even when requested concurrently. * * @param snapshot snapshot to take * @throws IOException if the snapshot did not succeed or we lose contact with the master. diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncAdmin.java index 0f6697776b..4fb645081c 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncAdmin.java @@ -746,7 +746,8 @@ public interface AsyncAdmin { /** * Take a snapshot for the given table. If the table is enabled, a FLUSH-type snapshot will be - * taken. If the table is disabled, an offline snapshot is taken. Snapshots are considered unique + * taken. If the table is disabled, an offline snapshot is taken. Snapshots are taken + * sequentially even when requested concurrentlySnapshots are considered unique * based on the name of the snapshot. Attempts to take a snapshot with the same name (even * a different type or with different parameters) will fail with a * {@link org.apache.hadoop.hbase.snapshot.SnapshotCreationException} indicating the duplicate @@ -761,8 +762,9 @@ public interface AsyncAdmin { /** * Create typed snapshot of the table. Snapshots are considered unique based on the name of the - * snapshot. Attempts to take a snapshot with the same name (even a different type or with - * different parameters) will fail with a + * snapshot. Snapshots are taken sequentially even when requested concurrently. Attempts to + * take a snapshot with the same name (even a different type or with different parameters) will + * fail with a * {@link org.apache.hadoop.hbase.snapshot.SnapshotCreationException} indicating the duplicate * naming. Snapshot names follow the same naming constraints as tables in HBase. See * {@link org.apache.hadoop.hbase.TableName#isLegalFullyQualifiedTableName(byte[])}. @@ -777,10 +779,9 @@ public interface AsyncAdmin { } /** - * Take a snapshot and wait for the server to complete that snapshot asynchronously. Only a single - * snapshot should be taken at a time for an instance of HBase, or results may be undefined (you - * can tell multiple HBase clusters to snapshot at the same time, but only one at a time for a - * single cluster). Snapshots are considered unique based on the name of the snapshot. + * Take a snapshot and wait for the server to complete that snapshot asynchronously. Snapshots + * are taken sequentially even when requested concurrently. Snapshots are considered unique based + * on the name of the snapshot. * Attempts to take a snapshot with the same name (even a different type or with different * parameters) will fail with a {@link org.apache.hadoop.hbase.snapshot.SnapshotCreationException} * indicating the duplicate naming. Snapshot names follow the same naming constraints as tables in -- 2.18.0