apurtell commented on a change in pull request #371: HBASE-22648 : Introducing
Snapshot TTL
URL: https://github.com/apache/hbase/pull/371#discussion_r304135678
##########
File path: hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
##########
@@ -1372,6 +1372,51 @@ default void snapshot(String snapshotName, TableName
tableName, SnapshotType typ
snapshot(new SnapshotDescription(snapshotName, tableName, type));
}
+ /**
+ * Create typed snapshot of the table. Snapshots are considered unique based
on <b>the name of the
+ * snapshot</b>. Snapshots are taken sequentially even when requested
concurrently, across
+ * all tables. 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[])}.
+ * Snapshot can live with ttl seconds.
+ *
+ * @param snapshotName name to give the snapshot on the filesystem. Must be
unique from all other
+ * snapshots stored on the cluster
+ * @param tableName name of the table to snapshot
+ * @param type type of snapshot to take
+ * @param ttl time to live in seconds. After expiry, the snapshot
should be deleted
+ * @throws IOException we fail to reach the master
+ * @throws SnapshotCreationException if snapshot creation failed
+ * @throws IllegalArgumentException if the snapshot request is formatted
incorrectly
+ */
+ default void snapshot(String snapshotName, TableName tableName, SnapshotType
type, Long ttl)
Review comment:
TTL may be the first of more than one snapshot attribute we'd want to pass
through this API. We can create a new method (and more backwards compat
methods) every time, or make only one change: instead of parameter 'ttl' of
type Long, introduce a parameter 'attributes' or 'properties' of type
Map<String,Object> or java.util.Properties?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services