From 72ea3666c08c037ac3e24e435b1a76eeb01c797f Mon Sep 17 00:00:00 2001 From: Viraj Jasani Date: Fri, 13 Sep 2019 10:38:10 +0530 Subject: [PATCH] HBASE-22760 : Pause/Resume/Query Snapshot Auto Cleanup Activity (#619) --- .../org/apache/hadoop/hbase/client/Admin.java | 24 + .../hbase/client/ConnectionManager.java | 14 + .../hadoop/hbase/client/HBaseAdmin.java | 36 + .../hbase/protobuf/RequestConverter.java | 30 + .../hbase/zookeeper/ZooKeeperWatcher.java | 5 + .../org/apache/hadoop/hbase/HConstants.java | 2 - hbase-protocol/pom.xml | 1 + .../protobuf/generated/MasterProtos.java | 2263 +++++++++++++++-- .../generated/SnapshotCleanupProtos.java | 494 ++++ hbase-protocol/src/main/protobuf/Master.proto | 31 + .../src/main/protobuf/SnapshotCleanup.proto | 31 + .../apache/hadoop/hbase/master/HMaster.java | 50 +- .../hbase/master/MasterRpcServices.java | 53 + .../zookeeper/SnapshotCleanupTracker.java | 112 + .../hadoop/hbase/client/TestAdmin2.java | 27 + .../cleaner/TestSnapshotCleanerChore.java | 1 - .../cleaner/TestSnapshotFromMaster.java | 100 + .../hbase/snapshot/SnapshotTestingUtils.java | 23 + hbase-shell/src/main/ruby/hbase/admin.rb | 16 + hbase-shell/src/main/ruby/shell.rb | 2 + .../commands/snapshot_cleanup_enabled.rb | 39 + .../shell/commands/snapshot_cleanup_switch.rb | 43 + src/main/asciidoc/_chapters/ops_mgt.adoc | 40 +- 23 files changed, 3278 insertions(+), 159 deletions(-) create mode 100644 hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/SnapshotCleanupProtos.java create mode 100644 hbase-protocol/src/main/protobuf/SnapshotCleanup.proto create mode 100644 hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/SnapshotCleanupTracker.java create mode 100644 hbase-shell/src/main/ruby/shell/commands/snapshot_cleanup_enabled.rb create mode 100644 hbase-shell/src/main/ruby/shell/commands/snapshot_cleanup_switch.rb 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 07db5b7dfbc..4896df93982 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 @@ -1658,4 +1658,28 @@ public interface Admin extends Abortable, Closeable { * @return List of servers that not cleared */ List clearDeadServers(final List servers) throws IOException; + + + /** + * Turn on or off the auto snapshot cleanup based on TTL. + * + * @param on Set to true to enable, false to disable. + * @param synchronous If true, it waits until current snapshot cleanup is completed, + * if outstanding. + * @return Previous auto snapshot cleanup value + * @throws IOException if a remote or network exception occurs + */ + boolean snapshotCleanupSwitch(final boolean on, final boolean synchronous) + throws IOException; + + /** + * Query the current state of the auto snapshot cleanup based on TTL. + * + * @return true if the auto snapshot cleanup is enabled, + * false otherwise. + * @throws IOException if a remote or network exception occurs + */ + boolean isSnapshotCleanupEnabled() throws IOException; + + } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionManager.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionManager.java index 6634a89fa23..7d9af647feb 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionManager.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionManager.java @@ -2132,6 +2132,20 @@ class ConnectionManager { return stub.listNamespaces(controller, request); } + @Override + public MasterProtos.SetSnapshotCleanupResponse switchSnapshotCleanup( + RpcController controller, MasterProtos.SetSnapshotCleanupRequest request) + throws ServiceException { + return stub.switchSnapshotCleanup(controller, request); + } + + @Override + public MasterProtos.IsSnapshotCleanupEnabledResponse isSnapshotCleanupEnabled( + RpcController controller, MasterProtos.IsSnapshotCleanupEnabledRequest request) + throws ServiceException { + return stub.isSnapshotCleanupEnabled(controller, request); + } + @Override public ListNamespaceDescriptorsResponse listNamespaceDescriptors(RpcController controller, ListNamespaceDescriptorsRequest request) throws ServiceException { diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 1b237f33d4d..d8ebcc9e238 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -136,6 +136,7 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsProcedureDoneRe import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsProcedureDoneResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsRestoreSnapshotDoneRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsRestoreSnapshotDoneResponse; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotDoneRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotDoneResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespaceDescriptorsRequest; @@ -154,6 +155,7 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.RestoreSnapshotRe import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SecurityCapabilitiesRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetBalancerRunningRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetNormalizerRunningRequest; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ShutdownRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SnapshotRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SnapshotResponse; @@ -5053,4 +5055,38 @@ public class HBaseAdmin implements Admin { private RpcControllerFactory getRpcControllerFactory() { return rpcControllerFactory; } + + @Override + public boolean snapshotCleanupSwitch(final boolean on, final boolean synchronous) + throws IOException { + return executeCallable(new MasterCallable(getConnection()) { + + @Override + public Boolean call(int callTimeout) throws Exception { + HBaseRpcController controller = rpcControllerFactory.newController(); + controller.setCallTimeout(callTimeout); + SetSnapshotCleanupRequest req = + RequestConverter.buildSetSnapshotCleanupRequest(on, synchronous); + return master.switchSnapshotCleanup(controller, req).getPrevSnapshotCleanup(); + } + }); + + } + + @Override + public boolean isSnapshotCleanupEnabled() throws IOException { + return executeCallable(new MasterCallable(getConnection()) { + + @Override + public Boolean call(int callTimeout) throws Exception { + HBaseRpcController controller = rpcControllerFactory.newController(); + controller.setCallTimeout(callTimeout); + IsSnapshotCleanupEnabledRequest req = + RequestConverter.buildIsSnapshotCleanupEnabledRequest(); + return master.isSnapshotCleanupEnabled(controller, req).getEnabled(); + } + }); + + } + } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java index 79cbb01b6ec..9c6fea7483d 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java @@ -100,6 +100,8 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsCatalogJanitorE import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsCleanerChoreEnabledRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsMasterRunningRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsNormalizerEnabledRequest; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos + .IsSnapshotCleanupEnabledRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSplitOrMergeEnabledRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ModifyColumnRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ModifyTableRequest; @@ -110,6 +112,7 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.RunCatalogScanReq import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.RunCleanerChoreRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetBalancerRunningRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetNormalizerRunningRequest; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSplitOrMergeEnabledRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.TruncateTableRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.UnassignRegionRequest; @@ -1830,4 +1833,31 @@ public final class RequestConverter { } throw new UnsupportedOperationException("Unsupport switch type:" + switchType); } + + + /** + * Creates SetSnapshotCleanupRequest for turning on/off auto snapshot cleanup + * + * @param enabled Set to true to enable, + * false to disable. + * @param synchronous If true, it waits until current snapshot cleanup is completed, + * if outstanding. + * @return a SetSnapshotCleanupRequest + */ + public static SetSnapshotCleanupRequest buildSetSnapshotCleanupRequest( + final boolean enabled, final boolean synchronous) { + return SetSnapshotCleanupRequest.newBuilder().setEnabled(enabled).setSynchronous(synchronous) + .build(); + } + + /** + * Creates IsSnapshotCleanupEnabledRequest to determine if auto snapshot cleanup + * based on TTL expiration is turned on + * + * @return IsSnapshotCleanupEnabledRequest + */ + public static IsSnapshotCleanupEnabledRequest buildIsSnapshotCleanupEnabledRequest() { + return IsSnapshotCleanupEnabledRequest.newBuilder().build(); + } + } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java index e9e38c861e4..0b4e84872d7 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java @@ -122,6 +122,8 @@ public class ZooKeeperWatcher implements Watcher, Abortable, Closeable { private String switchZNode; // znode containing the lock for the tables public String tableLockZNode; + // znode containing the state of the snapshot auto-cleanup + String snapshotCleanupZNode; // znode containing the state of recovering regions public String recoveringRegionsZNode; // znode containing namespace descriptors @@ -137,6 +139,7 @@ public class ZooKeeperWatcher implements Watcher, Abortable, Closeable { }}; public final static String META_ZNODE_PREFIX = "meta-region-server"; + private static final String DEFAULT_SNAPSHOT_CLEANUP_ZNODE = "snapshot-cleanup"; private final Configuration conf; @@ -456,6 +459,8 @@ public class ZooKeeperWatcher implements Watcher, Abortable, Closeable { switchZNode = ZKUtil.joinZNode(baseZNode, conf.get("zookeeper.znode.switch", "switch")); tableLockZNode = ZKUtil.joinZNode(baseZNode, conf.get("zookeeper.znode.tableLock", "table-lock")); + snapshotCleanupZNode = ZKUtil.joinZNode(baseZNode, + conf.get("zookeeper.znode.snapshot.cleanup", DEFAULT_SNAPSHOT_CLEANUP_ZNODE)); recoveringRegionsZNode = ZKUtil.joinZNode(baseZNode, conf.get("zookeeper.znode.recovering.regions", "recovering-regions")); namespaceZNode = ZKUtil.joinZNode(baseZNode, diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java index 723d70b1b03..b0322b3a35f 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java @@ -1338,8 +1338,6 @@ public final class HConstants { // User defined Default TTL config key public static final String DEFAULT_SNAPSHOT_TTL_CONFIG_KEY = "hbase.master.snapshot.ttl"; - public static final String SNAPSHOT_CLEANER_DISABLE = "hbase.master.cleaner.snapshot.disable"; - /** * Configurations for master executor services. */ diff --git a/hbase-protocol/pom.xml b/hbase-protocol/pom.xml index 0c1cd633ab0..85c1ac56a48 100644 --- a/hbase-protocol/pom.xml +++ b/hbase-protocol/pom.xml @@ -199,6 +199,7 @@ RSGroupAdmin.proto SecureBulkLoad.proto Snapshot.proto + SnapshotCleanup.proto Table.proto Tracing.proto VisibilityLabels.proto diff --git a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/MasterProtos.java b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/MasterProtos.java index 6d078e546ca..d6eeb558b22 100644 --- a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/MasterProtos.java +++ b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/MasterProtos.java @@ -62943,6 +62943,1760 @@ public final class MasterProtos { // @@protoc_insertion_point(class_scope:hbase.pb.ClearDeadServersResponse) } + public interface SetSnapshotCleanupRequestOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required bool enabled = 1; + /** + * required bool enabled = 1; + */ + boolean hasEnabled(); + /** + * required bool enabled = 1; + */ + boolean getEnabled(); + + // optional bool synchronous = 2; + /** + * optional bool synchronous = 2; + */ + boolean hasSynchronous(); + /** + * optional bool synchronous = 2; + */ + boolean getSynchronous(); + } + /** + * Protobuf type {@code hbase.pb.SetSnapshotCleanupRequest} + */ + public static final class SetSnapshotCleanupRequest extends + com.google.protobuf.GeneratedMessage + implements SetSnapshotCleanupRequestOrBuilder { + // Use SetSnapshotCleanupRequest.newBuilder() to construct. + private SetSnapshotCleanupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private SetSnapshotCleanupRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final SetSnapshotCleanupRequest defaultInstance; + public static SetSnapshotCleanupRequest getDefaultInstance() { + return defaultInstance; + } + + public SetSnapshotCleanupRequest getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SetSnapshotCleanupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + enabled_ = input.readBool(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + synchronous_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_SetSnapshotCleanupRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_SetSnapshotCleanupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public SetSnapshotCleanupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetSnapshotCleanupRequest(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required bool enabled = 1; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_; + /** + * required bool enabled = 1; + */ + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool enabled = 1; + */ + public boolean getEnabled() { + return enabled_; + } + + // optional bool synchronous = 2; + public static final int SYNCHRONOUS_FIELD_NUMBER = 2; + private boolean synchronous_; + /** + * optional bool synchronous = 2; + */ + public boolean hasSynchronous() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional bool synchronous = 2; + */ + public boolean getSynchronous() { + return synchronous_; + } + + private void initFields() { + enabled_ = false; + synchronous_ = false; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasEnabled()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBool(1, enabled_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBool(2, synchronous_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, enabled_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, synchronous_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest other = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest) obj; + + boolean result = true; + result = result && (hasEnabled() == other.hasEnabled()); + if (hasEnabled()) { + result = result && (getEnabled() + == other.getEnabled()); + } + result = result && (hasSynchronous() == other.hasSynchronous()); + if (hasSynchronous()) { + result = result && (getSynchronous() + == other.getSynchronous()); + } + result = result && + getUnknownFields().equals(other.getUnknownFields()); + return result; + } + + private int memoizedHashCode = 0; + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + hashBoolean(getEnabled()); + } + if (hasSynchronous()) { + hash = (37 * hash) + SYNCHRONOUS_FIELD_NUMBER; + hash = (53 * hash) + hashBoolean(getSynchronous()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code hbase.pb.SetSnapshotCleanupRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_SetSnapshotCleanupRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_SetSnapshotCleanupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + enabled_ = false; + bitField0_ = (bitField0_ & ~0x00000001); + synchronous_ = false; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_SetSnapshotCleanupRequest_descriptor; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest getDefaultInstanceForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest build() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest buildPartial() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest result = new org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.enabled_ = enabled_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.synchronous_ = synchronous_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest) { + return mergeFrom((org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest other) { + if (other == org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest.getDefaultInstance()) return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.hasSynchronous()) { + setSynchronous(other.getSynchronous()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasEnabled()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required bool enabled = 1; + private boolean enabled_ ; + /** + * required bool enabled = 1; + */ + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool enabled = 1; + */ + public boolean getEnabled() { + return enabled_; + } + /** + * required bool enabled = 1; + */ + public Builder setEnabled(boolean value) { + bitField0_ |= 0x00000001; + enabled_ = value; + onChanged(); + return this; + } + /** + * required bool enabled = 1; + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + // optional bool synchronous = 2; + private boolean synchronous_ ; + /** + * optional bool synchronous = 2; + */ + public boolean hasSynchronous() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional bool synchronous = 2; + */ + public boolean getSynchronous() { + return synchronous_; + } + /** + * optional bool synchronous = 2; + */ + public Builder setSynchronous(boolean value) { + bitField0_ |= 0x00000002; + synchronous_ = value; + onChanged(); + return this; + } + /** + * optional bool synchronous = 2; + */ + public Builder clearSynchronous() { + bitField0_ = (bitField0_ & ~0x00000002); + synchronous_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:hbase.pb.SetSnapshotCleanupRequest) + } + + static { + defaultInstance = new SetSnapshotCleanupRequest(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:hbase.pb.SetSnapshotCleanupRequest) + } + + public interface SetSnapshotCleanupResponseOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required bool prev_snapshot_cleanup = 1; + /** + * required bool prev_snapshot_cleanup = 1; + */ + boolean hasPrevSnapshotCleanup(); + /** + * required bool prev_snapshot_cleanup = 1; + */ + boolean getPrevSnapshotCleanup(); + } + /** + * Protobuf type {@code hbase.pb.SetSnapshotCleanupResponse} + */ + public static final class SetSnapshotCleanupResponse extends + com.google.protobuf.GeneratedMessage + implements SetSnapshotCleanupResponseOrBuilder { + // Use SetSnapshotCleanupResponse.newBuilder() to construct. + private SetSnapshotCleanupResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private SetSnapshotCleanupResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final SetSnapshotCleanupResponse defaultInstance; + public static SetSnapshotCleanupResponse getDefaultInstance() { + return defaultInstance; + } + + public SetSnapshotCleanupResponse getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SetSnapshotCleanupResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + prevSnapshotCleanup_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_SetSnapshotCleanupResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_SetSnapshotCleanupResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public SetSnapshotCleanupResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetSnapshotCleanupResponse(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required bool prev_snapshot_cleanup = 1; + public static final int PREV_SNAPSHOT_CLEANUP_FIELD_NUMBER = 1; + private boolean prevSnapshotCleanup_; + /** + * required bool prev_snapshot_cleanup = 1; + */ + public boolean hasPrevSnapshotCleanup() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool prev_snapshot_cleanup = 1; + */ + public boolean getPrevSnapshotCleanup() { + return prevSnapshotCleanup_; + } + + private void initFields() { + prevSnapshotCleanup_ = false; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasPrevSnapshotCleanup()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBool(1, prevSnapshotCleanup_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, prevSnapshotCleanup_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse other = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse) obj; + + boolean result = true; + result = result && (hasPrevSnapshotCleanup() == other.hasPrevSnapshotCleanup()); + if (hasPrevSnapshotCleanup()) { + result = result && (getPrevSnapshotCleanup() + == other.getPrevSnapshotCleanup()); + } + result = result && + getUnknownFields().equals(other.getUnknownFields()); + return result; + } + + private int memoizedHashCode = 0; + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasPrevSnapshotCleanup()) { + hash = (37 * hash) + PREV_SNAPSHOT_CLEANUP_FIELD_NUMBER; + hash = (53 * hash) + hashBoolean(getPrevSnapshotCleanup()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code hbase.pb.SetSnapshotCleanupResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_SetSnapshotCleanupResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_SetSnapshotCleanupResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + prevSnapshotCleanup_ = false; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_SetSnapshotCleanupResponse_descriptor; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse getDefaultInstanceForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse build() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse buildPartial() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse result = new org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.prevSnapshotCleanup_ = prevSnapshotCleanup_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse) { + return mergeFrom((org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse other) { + if (other == org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.getDefaultInstance()) return this; + if (other.hasPrevSnapshotCleanup()) { + setPrevSnapshotCleanup(other.getPrevSnapshotCleanup()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasPrevSnapshotCleanup()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required bool prev_snapshot_cleanup = 1; + private boolean prevSnapshotCleanup_ ; + /** + * required bool prev_snapshot_cleanup = 1; + */ + public boolean hasPrevSnapshotCleanup() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool prev_snapshot_cleanup = 1; + */ + public boolean getPrevSnapshotCleanup() { + return prevSnapshotCleanup_; + } + /** + * required bool prev_snapshot_cleanup = 1; + */ + public Builder setPrevSnapshotCleanup(boolean value) { + bitField0_ |= 0x00000001; + prevSnapshotCleanup_ = value; + onChanged(); + return this; + } + /** + * required bool prev_snapshot_cleanup = 1; + */ + public Builder clearPrevSnapshotCleanup() { + bitField0_ = (bitField0_ & ~0x00000001); + prevSnapshotCleanup_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:hbase.pb.SetSnapshotCleanupResponse) + } + + static { + defaultInstance = new SetSnapshotCleanupResponse(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:hbase.pb.SetSnapshotCleanupResponse) + } + + public interface IsSnapshotCleanupEnabledRequestOrBuilder + extends com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code hbase.pb.IsSnapshotCleanupEnabledRequest} + */ + public static final class IsSnapshotCleanupEnabledRequest extends + com.google.protobuf.GeneratedMessage + implements IsSnapshotCleanupEnabledRequestOrBuilder { + // Use IsSnapshotCleanupEnabledRequest.newBuilder() to construct. + private IsSnapshotCleanupEnabledRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private IsSnapshotCleanupEnabledRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final IsSnapshotCleanupEnabledRequest defaultInstance; + public static IsSnapshotCleanupEnabledRequest getDefaultInstance() { + return defaultInstance; + } + + public IsSnapshotCleanupEnabledRequest getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private IsSnapshotCleanupEnabledRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_IsSnapshotCleanupEnabledRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_IsSnapshotCleanupEnabledRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public IsSnapshotCleanupEnabledRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IsSnapshotCleanupEnabledRequest(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private void initFields() { + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest other = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest) obj; + + boolean result = true; + result = result && + getUnknownFields().equals(other.getUnknownFields()); + return result; + } + + private int memoizedHashCode = 0; + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code hbase.pb.IsSnapshotCleanupEnabledRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_IsSnapshotCleanupEnabledRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_IsSnapshotCleanupEnabledRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_IsSnapshotCleanupEnabledRequest_descriptor; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest getDefaultInstanceForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest build() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest buildPartial() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest result = new org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest(this); + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest) { + return mergeFrom((org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest other) { + if (other == org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + // @@protoc_insertion_point(builder_scope:hbase.pb.IsSnapshotCleanupEnabledRequest) + } + + static { + defaultInstance = new IsSnapshotCleanupEnabledRequest(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:hbase.pb.IsSnapshotCleanupEnabledRequest) + } + + public interface IsSnapshotCleanupEnabledResponseOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required bool enabled = 1; + /** + * required bool enabled = 1; + */ + boolean hasEnabled(); + /** + * required bool enabled = 1; + */ + boolean getEnabled(); + } + /** + * Protobuf type {@code hbase.pb.IsSnapshotCleanupEnabledResponse} + */ + public static final class IsSnapshotCleanupEnabledResponse extends + com.google.protobuf.GeneratedMessage + implements IsSnapshotCleanupEnabledResponseOrBuilder { + // Use IsSnapshotCleanupEnabledResponse.newBuilder() to construct. + private IsSnapshotCleanupEnabledResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private IsSnapshotCleanupEnabledResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final IsSnapshotCleanupEnabledResponse defaultInstance; + public static IsSnapshotCleanupEnabledResponse getDefaultInstance() { + return defaultInstance; + } + + public IsSnapshotCleanupEnabledResponse getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private IsSnapshotCleanupEnabledResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + enabled_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_IsSnapshotCleanupEnabledResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_IsSnapshotCleanupEnabledResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public IsSnapshotCleanupEnabledResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IsSnapshotCleanupEnabledResponse(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required bool enabled = 1; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_; + /** + * required bool enabled = 1; + */ + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool enabled = 1; + */ + public boolean getEnabled() { + return enabled_; + } + + private void initFields() { + enabled_ = false; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasEnabled()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBool(1, enabled_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, enabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse other = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse) obj; + + boolean result = true; + result = result && (hasEnabled() == other.hasEnabled()); + if (hasEnabled()) { + result = result && (getEnabled() + == other.getEnabled()); + } + result = result && + getUnknownFields().equals(other.getUnknownFields()); + return result; + } + + private int memoizedHashCode = 0; + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + hashBoolean(getEnabled()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code hbase.pb.IsSnapshotCleanupEnabledResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_IsSnapshotCleanupEnabledResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_IsSnapshotCleanupEnabledResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + enabled_ = false; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_IsSnapshotCleanupEnabledResponse_descriptor; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse getDefaultInstanceForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse build() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse buildPartial() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse result = new org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.enabled_ = enabled_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse) { + return mergeFrom((org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse other) { + if (other == org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.getDefaultInstance()) return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasEnabled()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required bool enabled = 1; + private boolean enabled_ ; + /** + * required bool enabled = 1; + */ + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool enabled = 1; + */ + public boolean getEnabled() { + return enabled_; + } + /** + * required bool enabled = 1; + */ + public Builder setEnabled(boolean value) { + bitField0_ |= 0x00000001; + enabled_ = value; + onChanged(); + return this; + } + /** + * required bool enabled = 1; + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:hbase.pb.IsSnapshotCleanupEnabledResponse) + } + + static { + defaultInstance = new IsSnapshotCleanupEnabledResponse(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:hbase.pb.IsSnapshotCleanupEnabledResponse) + } + /** * Protobuf service {@code hbase.pb.MasterService} */ @@ -63727,6 +65481,32 @@ public final class MasterProtos { org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesRequest request, com.google.protobuf.RpcCallback done); + /** + * rpc SwitchSnapshotCleanup(.hbase.pb.SetSnapshotCleanupRequest) returns (.hbase.pb.SetSnapshotCleanupResponse); + * + *
+       **
+       * Turn on/off snapshot auto-cleanup based on TTL expiration
+       * 
+ */ + public abstract void switchSnapshotCleanup( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest request, + com.google.protobuf.RpcCallback done); + + /** + * rpc IsSnapshotCleanupEnabled(.hbase.pb.IsSnapshotCleanupEnabledRequest) returns (.hbase.pb.IsSnapshotCleanupEnabledResponse); + * + *
+       **
+       * Determine if snapshot auto-cleanup based on TTL expiration is turned on
+       * 
+ */ + public abstract void isSnapshotCleanupEnabled( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest request, + com.google.protobuf.RpcCallback done); + } public static com.google.protobuf.Service newReflectiveService( @@ -64228,6 +66008,22 @@ public final class MasterProtos { impl.listNamespaces(controller, request, done); } + @java.lang.Override + public void switchSnapshotCleanup( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest request, + com.google.protobuf.RpcCallback done) { + impl.switchSnapshotCleanup(controller, request, done); + } + + @java.lang.Override + public void isSnapshotCleanupEnabled( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest request, + com.google.protobuf.RpcCallback done) { + impl.isSnapshotCleanupEnabled(controller, request, done); + } + }; } @@ -64374,6 +66170,10 @@ public final class MasterProtos { return impl.clearDeadServers(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ClearDeadServersRequest)request); case 61: return impl.listNamespaces(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesRequest)request); + case 62: + return impl.switchSnapshotCleanup(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest)request); + case 63: + return impl.isSnapshotCleanupEnabled(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest)request); default: throw new java.lang.AssertionError("Can't get here."); } @@ -64512,6 +66312,10 @@ public final class MasterProtos { return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ClearDeadServersRequest.getDefaultInstance(); case 61: return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesRequest.getDefaultInstance(); + case 62: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest.getDefaultInstance(); + case 63: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -64650,6 +66454,10 @@ public final class MasterProtos { return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ClearDeadServersResponse.getDefaultInstance(); case 61: return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesResponse.getDefaultInstance(); + case 62: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.getDefaultInstance(); + case 63: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -65434,6 +67242,32 @@ public final class MasterProtos { org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesRequest request, com.google.protobuf.RpcCallback done); + /** + * rpc SwitchSnapshotCleanup(.hbase.pb.SetSnapshotCleanupRequest) returns (.hbase.pb.SetSnapshotCleanupResponse); + * + *
+     **
+     * Turn on/off snapshot auto-cleanup based on TTL expiration
+     * 
+ */ + public abstract void switchSnapshotCleanup( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest request, + com.google.protobuf.RpcCallback done); + + /** + * rpc IsSnapshotCleanupEnabled(.hbase.pb.IsSnapshotCleanupEnabledRequest) returns (.hbase.pb.IsSnapshotCleanupEnabledResponse); + * + *
+     **
+     * Determine if snapshot auto-cleanup based on TTL expiration is turned on
+     * 
+ */ + public abstract void isSnapshotCleanupEnabled( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest request, + com.google.protobuf.RpcCallback done); + public static final com.google.protobuf.Descriptors.ServiceDescriptor getDescriptor() { @@ -65766,6 +67600,16 @@ public final class MasterProtos { com.google.protobuf.RpcUtil.specializeCallback( done)); return; + case 62: + this.switchSnapshotCleanup(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest)request, + com.google.protobuf.RpcUtil.specializeCallback( + done)); + return; + case 63: + this.isSnapshotCleanupEnabled(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest)request, + com.google.protobuf.RpcUtil.specializeCallback( + done)); + return; default: throw new java.lang.AssertionError("Can't get here."); } @@ -65904,6 +67748,10 @@ public final class MasterProtos { return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ClearDeadServersRequest.getDefaultInstance(); case 61: return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesRequest.getDefaultInstance(); + case 62: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest.getDefaultInstance(); + case 63: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -66042,6 +67890,10 @@ public final class MasterProtos { return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ClearDeadServersResponse.getDefaultInstance(); case 61: return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesResponse.getDefaultInstance(); + case 62: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.getDefaultInstance(); + case 63: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -66992,6 +68844,36 @@ public final class MasterProtos { org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesResponse.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesResponse.getDefaultInstance())); } + + public void switchSnapshotCleanup( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest request, + com.google.protobuf.RpcCallback done) { + channel.callMethod( + getDescriptor().getMethods().get(62), + controller, + request, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.getDefaultInstance(), + com.google.protobuf.RpcUtil.generalizeCallback( + done, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.class, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.getDefaultInstance())); + } + + public void isSnapshotCleanupEnabled( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest request, + com.google.protobuf.RpcCallback done) { + channel.callMethod( + getDescriptor().getMethods().get(63), + controller, + request, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.getDefaultInstance(), + com.google.protobuf.RpcUtil.generalizeCallback( + done, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.class, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.getDefaultInstance())); + } } public static BlockingInterface newBlockingStub( @@ -67309,6 +69191,16 @@ public final class MasterProtos { com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesRequest request) throws com.google.protobuf.ServiceException; + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse switchSnapshotCleanup( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest request) + throws com.google.protobuf.ServiceException; + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse isSnapshotCleanupEnabled( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest request) + throws com.google.protobuf.ServiceException; } private static final class BlockingStub implements BlockingInterface { @@ -68061,6 +69953,30 @@ public final class MasterProtos { org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesResponse.getDefaultInstance()); } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse switchSnapshotCleanup( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest request) + throws com.google.protobuf.ServiceException { + return (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse) channel.callBlockingMethod( + getDescriptor().getMethods().get(62), + controller, + request, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse.getDefaultInstance()); + } + + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse isSnapshotCleanupEnabled( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest request) + throws com.google.protobuf.ServiceException { + return (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse) channel.callBlockingMethod( + getDescriptor().getMethods().get(63), + controller, + request, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse.getDefaultInstance()); + } + } // @@protoc_insertion_point(class_scope:hbase.pb.MasterService) @@ -68661,6 +70577,26 @@ public final class MasterProtos { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_hbase_pb_ClearDeadServersResponse_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_hbase_pb_SetSnapshotCleanupRequest_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_hbase_pb_SetSnapshotCleanupRequest_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_hbase_pb_SetSnapshotCleanupResponse_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_hbase_pb_SetSnapshotCleanupResponse_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_hbase_pb_IsSnapshotCleanupEnabledRequest_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_hbase_pb_IsSnapshotCleanupEnabledRequest_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_hbase_pb_IsSnapshotCleanupEnabledResponse_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_hbase_pb_IsSnapshotCleanupEnabledResponse_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -68870,152 +70806,163 @@ public final class MasterProtos { "sRequest\022)\n\013server_name\030\001 \003(\0132\024.hbase.pb" + ".ServerName\"E\n\030ClearDeadServersResponse\022" + ")\n\013server_name\030\001 \003(\0132\024.hbase.pb.ServerNa", - "me*(\n\020MasterSwitchType\022\t\n\005SPLIT\020\000\022\t\n\005MER" + - "GE\020\0012\312,\n\rMasterService\022e\n\024GetSchemaAlter" + - "Status\022%.hbase.pb.GetSchemaAlterStatusRe" + - "quest\032&.hbase.pb.GetSchemaAlterStatusRes" + - "ponse\022b\n\023GetTableDescriptors\022$.hbase.pb." + - "GetTableDescriptorsRequest\032%.hbase.pb.Ge" + - "tTableDescriptorsResponse\022P\n\rGetTableNam" + - "es\022\036.hbase.pb.GetTableNamesRequest\032\037.hba" + - "se.pb.GetTableNamesResponse\022Y\n\020GetCluste" + - "rStatus\022!.hbase.pb.GetClusterStatusReque", - "st\032\".hbase.pb.GetClusterStatusResponse\022V" + - "\n\017IsMasterRunning\022 .hbase.pb.IsMasterRun" + - "ningRequest\032!.hbase.pb.IsMasterRunningRe" + - "sponse\022D\n\tAddColumn\022\032.hbase.pb.AddColumn" + - "Request\032\033.hbase.pb.AddColumnResponse\022M\n\014" + - "DeleteColumn\022\035.hbase.pb.DeleteColumnRequ" + - "est\032\036.hbase.pb.DeleteColumnResponse\022M\n\014M" + - "odifyColumn\022\035.hbase.pb.ModifyColumnReque" + - "st\032\036.hbase.pb.ModifyColumnResponse\022G\n\nMo" + - "veRegion\022\033.hbase.pb.MoveRegionRequest\032\034.", - "hbase.pb.MoveRegionResponse\022k\n\026DispatchM" + - "ergingRegions\022\'.hbase.pb.DispatchMerging" + - "RegionsRequest\032(.hbase.pb.DispatchMergin" + - "gRegionsResponse\022M\n\014AssignRegion\022\035.hbase" + - ".pb.AssignRegionRequest\032\036.hbase.pb.Assig" + - "nRegionResponse\022S\n\016UnassignRegion\022\037.hbas" + - "e.pb.UnassignRegionRequest\032 .hbase.pb.Un" + - "assignRegionResponse\022P\n\rOfflineRegion\022\036." + - "hbase.pb.OfflineRegionRequest\032\037.hbase.pb" + - ".OfflineRegionResponse\022J\n\013DeleteTable\022\034.", - "hbase.pb.DeleteTableRequest\032\035.hbase.pb.D" + - "eleteTableResponse\022P\n\rtruncateTable\022\036.hb" + - "ase.pb.TruncateTableRequest\032\037.hbase.pb.T" + - "runcateTableResponse\022J\n\013EnableTable\022\034.hb" + - "ase.pb.EnableTableRequest\032\035.hbase.pb.Ena" + - "bleTableResponse\022M\n\014DisableTable\022\035.hbase" + - ".pb.DisableTableRequest\032\036.hbase.pb.Disab" + - "leTableResponse\022J\n\013ModifyTable\022\034.hbase.p" + - "b.ModifyTableRequest\032\035.hbase.pb.ModifyTa" + - "bleResponse\022J\n\013CreateTable\022\034.hbase.pb.Cr", - "eateTableRequest\032\035.hbase.pb.CreateTableR" + - "esponse\022A\n\010Shutdown\022\031.hbase.pb.ShutdownR" + - "equest\032\032.hbase.pb.ShutdownResponse\022G\n\nSt" + - "opMaster\022\033.hbase.pb.StopMasterRequest\032\034." + - "hbase.pb.StopMasterResponse\022h\n\031IsMasterI" + - "nMaintenanceMode\022$.hbase.pb.IsInMaintena" + - "nceModeRequest\032%.hbase.pb.IsInMaintenanc" + - "eModeResponse\022>\n\007Balance\022\030.hbase.pb.Bala" + - "nceRequest\032\031.hbase.pb.BalanceResponse\022_\n" + - "\022SetBalancerRunning\022#.hbase.pb.SetBalanc", - "erRunningRequest\032$.hbase.pb.SetBalancerR" + - "unningResponse\022\\\n\021IsBalancerEnabled\022\".hb" + - "ase.pb.IsBalancerEnabledRequest\032#.hbase." + - "pb.IsBalancerEnabledResponse\022k\n\026SetSplit" + - "OrMergeEnabled\022\'.hbase.pb.SetSplitOrMerg" + - "eEnabledRequest\032(.hbase.pb.SetSplitOrMer" + - "geEnabledResponse\022h\n\025IsSplitOrMergeEnabl" + - "ed\022&.hbase.pb.IsSplitOrMergeEnabledReque" + - "st\032\'.hbase.pb.IsSplitOrMergeEnabledRespo" + - "nse\022D\n\tNormalize\022\032.hbase.pb.NormalizeReq", - "uest\032\033.hbase.pb.NormalizeResponse\022e\n\024Set" + - "NormalizerRunning\022%.hbase.pb.SetNormaliz" + - "erRunningRequest\032&.hbase.pb.SetNormalize" + - "rRunningResponse\022b\n\023IsNormalizerEnabled\022" + - "$.hbase.pb.IsNormalizerEnabledRequest\032%." + - "hbase.pb.IsNormalizerEnabledResponse\022S\n\016" + - "RunCatalogScan\022\037.hbase.pb.RunCatalogScan" + - "Request\032 .hbase.pb.RunCatalogScanRespons" + - "e\022e\n\024EnableCatalogJanitor\022%.hbase.pb.Ena" + - "bleCatalogJanitorRequest\032&.hbase.pb.Enab", - "leCatalogJanitorResponse\022n\n\027IsCatalogJan" + - "itorEnabled\022(.hbase.pb.IsCatalogJanitorE" + - "nabledRequest\032).hbase.pb.IsCatalogJanito" + - "rEnabledResponse\022V\n\017RunCleanerChore\022 .hb" + - "ase.pb.RunCleanerChoreRequest\032!.hbase.pb" + - ".RunCleanerChoreResponse\022k\n\026SetCleanerCh" + - "oreRunning\022\'.hbase.pb.SetCleanerChoreRun" + - "ningRequest\032(.hbase.pb.SetCleanerChoreRu" + - "nningResponse\022h\n\025IsCleanerChoreEnabled\022&" + - ".hbase.pb.IsCleanerChoreEnabledRequest\032\'", - ".hbase.pb.IsCleanerChoreEnabledResponse\022" + - "^\n\021ExecMasterService\022#.hbase.pb.Coproces" + - "sorServiceRequest\032$.hbase.pb.Coprocessor" + - "ServiceResponse\022A\n\010Snapshot\022\031.hbase.pb.S" + - "napshotRequest\032\032.hbase.pb.SnapshotRespon" + - "se\022h\n\025GetCompletedSnapshots\022&.hbase.pb.G" + - "etCompletedSnapshotsRequest\032\'.hbase.pb.G" + - "etCompletedSnapshotsResponse\022S\n\016DeleteSn" + - "apshot\022\037.hbase.pb.DeleteSnapshotRequest\032" + - " .hbase.pb.DeleteSnapshotResponse\022S\n\016IsS", - "napshotDone\022\037.hbase.pb.IsSnapshotDoneReq" + - "uest\032 .hbase.pb.IsSnapshotDoneResponse\022V" + - "\n\017RestoreSnapshot\022 .hbase.pb.RestoreSnap" + - "shotRequest\032!.hbase.pb.RestoreSnapshotRe" + - "sponse\022h\n\025IsRestoreSnapshotDone\022&.hbase." + - "pb.IsRestoreSnapshotDoneRequest\032\'.hbase." + - "pb.IsRestoreSnapshotDoneResponse\022P\n\rExec" + - "Procedure\022\036.hbase.pb.ExecProcedureReques" + - "t\032\037.hbase.pb.ExecProcedureResponse\022W\n\024Ex" + - "ecProcedureWithRet\022\036.hbase.pb.ExecProced", - "ureRequest\032\037.hbase.pb.ExecProcedureRespo" + - "nse\022V\n\017IsProcedureDone\022 .hbase.pb.IsProc" + - "edureDoneRequest\032!.hbase.pb.IsProcedureD" + - "oneResponse\022V\n\017ModifyNamespace\022 .hbase.p" + - "b.ModifyNamespaceRequest\032!.hbase.pb.Modi" + - "fyNamespaceResponse\022V\n\017CreateNamespace\022 " + - ".hbase.pb.CreateNamespaceRequest\032!.hbase" + - ".pb.CreateNamespaceResponse\022V\n\017DeleteNam" + - "espace\022 .hbase.pb.DeleteNamespaceRequest" + - "\032!.hbase.pb.DeleteNamespaceResponse\022k\n\026G", - "etNamespaceDescriptor\022\'.hbase.pb.GetName" + - "spaceDescriptorRequest\032(.hbase.pb.GetNam" + - "espaceDescriptorResponse\022q\n\030ListNamespac" + - "eDescriptors\022).hbase.pb.ListNamespaceDes" + - "criptorsRequest\032*.hbase.pb.ListNamespace" + - "DescriptorsResponse\022\206\001\n\037ListTableDescrip" + - "torsByNamespace\0220.hbase.pb.ListTableDesc" + - "riptorsByNamespaceRequest\0321.hbase.pb.Lis" + - "tTableDescriptorsByNamespaceResponse\022t\n\031" + - "ListTableNamesByNamespace\022*.hbase.pb.Lis", - "tTableNamesByNamespaceRequest\032+.hbase.pb" + - ".ListTableNamesByNamespaceResponse\022A\n\010Se" + - "tQuota\022\031.hbase.pb.SetQuotaRequest\032\032.hbas" + - "e.pb.SetQuotaResponse\022x\n\037getLastMajorCom" + - "pactionTimestamp\022).hbase.pb.MajorCompact" + - "ionTimestampRequest\032*.hbase.pb.MajorComp" + - "actionTimestampResponse\022\212\001\n(getLastMajor" + - "CompactionTimestampForRegion\0222.hbase.pb." + - "MajorCompactionTimestampForRegionRequest" + - "\032*.hbase.pb.MajorCompactionTimestampResp", - "onse\022_\n\022getProcedureResult\022#.hbase.pb.Ge" + - "tProcedureResultRequest\032$.hbase.pb.GetPr" + - "ocedureResultResponse\022h\n\027getSecurityCapa" + - "bilities\022%.hbase.pb.SecurityCapabilities" + - "Request\032&.hbase.pb.SecurityCapabilitiesR" + - "esponse\022S\n\016AbortProcedure\022\037.hbase.pb.Abo" + - "rtProcedureRequest\032 .hbase.pb.AbortProce" + - "dureResponse\022S\n\016ListProcedures\022\037.hbase.p" + - "b.ListProceduresRequest\032 .hbase.pb.ListP" + - "roceduresResponse\022Y\n\020ClearDeadServers\022!.", - "hbase.pb.ClearDeadServersRequest\032\".hbase" + - ".pb.ClearDeadServersResponse\022S\n\016ListName" + - "spaces\022\037.hbase.pb.ListNamespacesRequest\032" + - " .hbase.pb.ListNamespacesResponseBB\n*org" + - ".apache.hadoop.hbase.protobuf.generatedB" + - "\014MasterProtosH\001\210\001\001\240\001\001" + "me\"A\n\031SetSnapshotCleanupRequest\022\017\n\007enabl" + + "ed\030\001 \002(\010\022\023\n\013synchronous\030\002 \001(\010\";\n\032SetSnap" + + "shotCleanupResponse\022\035\n\025prev_snapshot_cle" + + "anup\030\001 \002(\010\"!\n\037IsSnapshotCleanupEnabledRe" + + "quest\"3\n IsSnapshotCleanupEnabledRespons" + + "e\022\017\n\007enabled\030\001 \002(\010*(\n\020MasterSwitchType\022\t" + + "\n\005SPLIT\020\000\022\t\n\005MERGE\020\0012\241.\n\rMasterService\022e" + + "\n\024GetSchemaAlterStatus\022%.hbase.pb.GetSch" + + "emaAlterStatusRequest\032&.hbase.pb.GetSche" + + "maAlterStatusResponse\022b\n\023GetTableDescrip", + "tors\022$.hbase.pb.GetTableDescriptorsReque" + + "st\032%.hbase.pb.GetTableDescriptorsRespons" + + "e\022P\n\rGetTableNames\022\036.hbase.pb.GetTableNa" + + "mesRequest\032\037.hbase.pb.GetTableNamesRespo" + + "nse\022Y\n\020GetClusterStatus\022!.hbase.pb.GetCl" + + "usterStatusRequest\032\".hbase.pb.GetCluster" + + "StatusResponse\022V\n\017IsMasterRunning\022 .hbas" + + "e.pb.IsMasterRunningRequest\032!.hbase.pb.I" + + "sMasterRunningResponse\022D\n\tAddColumn\022\032.hb" + + "ase.pb.AddColumnRequest\032\033.hbase.pb.AddCo", + "lumnResponse\022M\n\014DeleteColumn\022\035.hbase.pb." + + "DeleteColumnRequest\032\036.hbase.pb.DeleteCol" + + "umnResponse\022M\n\014ModifyColumn\022\035.hbase.pb.M" + + "odifyColumnRequest\032\036.hbase.pb.ModifyColu" + + "mnResponse\022G\n\nMoveRegion\022\033.hbase.pb.Move" + + "RegionRequest\032\034.hbase.pb.MoveRegionRespo" + + "nse\022k\n\026DispatchMergingRegions\022\'.hbase.pb" + + ".DispatchMergingRegionsRequest\032(.hbase.p" + + "b.DispatchMergingRegionsResponse\022M\n\014Assi" + + "gnRegion\022\035.hbase.pb.AssignRegionRequest\032", + "\036.hbase.pb.AssignRegionResponse\022S\n\016Unass" + + "ignRegion\022\037.hbase.pb.UnassignRegionReque" + + "st\032 .hbase.pb.UnassignRegionResponse\022P\n\r" + + "OfflineRegion\022\036.hbase.pb.OfflineRegionRe" + + "quest\032\037.hbase.pb.OfflineRegionResponse\022J" + + "\n\013DeleteTable\022\034.hbase.pb.DeleteTableRequ" + + "est\032\035.hbase.pb.DeleteTableResponse\022P\n\rtr" + + "uncateTable\022\036.hbase.pb.TruncateTableRequ" + + "est\032\037.hbase.pb.TruncateTableResponse\022J\n\013" + + "EnableTable\022\034.hbase.pb.EnableTableReques", + "t\032\035.hbase.pb.EnableTableResponse\022M\n\014Disa" + + "bleTable\022\035.hbase.pb.DisableTableRequest\032" + + "\036.hbase.pb.DisableTableResponse\022J\n\013Modif" + + "yTable\022\034.hbase.pb.ModifyTableRequest\032\035.h" + + "base.pb.ModifyTableResponse\022J\n\013CreateTab" + + "le\022\034.hbase.pb.CreateTableRequest\032\035.hbase" + + ".pb.CreateTableResponse\022A\n\010Shutdown\022\031.hb" + + "ase.pb.ShutdownRequest\032\032.hbase.pb.Shutdo" + + "wnResponse\022G\n\nStopMaster\022\033.hbase.pb.Stop" + + "MasterRequest\032\034.hbase.pb.StopMasterRespo", + "nse\022h\n\031IsMasterInMaintenanceMode\022$.hbase" + + ".pb.IsInMaintenanceModeRequest\032%.hbase.p" + + "b.IsInMaintenanceModeResponse\022>\n\007Balance" + + "\022\030.hbase.pb.BalanceRequest\032\031.hbase.pb.Ba" + + "lanceResponse\022_\n\022SetBalancerRunning\022#.hb" + + "ase.pb.SetBalancerRunningRequest\032$.hbase" + + ".pb.SetBalancerRunningResponse\022\\\n\021IsBala" + + "ncerEnabled\022\".hbase.pb.IsBalancerEnabled" + + "Request\032#.hbase.pb.IsBalancerEnabledResp" + + "onse\022k\n\026SetSplitOrMergeEnabled\022\'.hbase.p", + "b.SetSplitOrMergeEnabledRequest\032(.hbase." + + "pb.SetSplitOrMergeEnabledResponse\022h\n\025IsS" + + "plitOrMergeEnabled\022&.hbase.pb.IsSplitOrM" + + "ergeEnabledRequest\032\'.hbase.pb.IsSplitOrM" + + "ergeEnabledResponse\022D\n\tNormalize\022\032.hbase" + + ".pb.NormalizeRequest\032\033.hbase.pb.Normaliz" + + "eResponse\022e\n\024SetNormalizerRunning\022%.hbas" + + "e.pb.SetNormalizerRunningRequest\032&.hbase" + + ".pb.SetNormalizerRunningResponse\022b\n\023IsNo" + + "rmalizerEnabled\022$.hbase.pb.IsNormalizerE", + "nabledRequest\032%.hbase.pb.IsNormalizerEna" + + "bledResponse\022S\n\016RunCatalogScan\022\037.hbase.p" + + "b.RunCatalogScanRequest\032 .hbase.pb.RunCa" + + "talogScanResponse\022e\n\024EnableCatalogJanito" + + "r\022%.hbase.pb.EnableCatalogJanitorRequest" + + "\032&.hbase.pb.EnableCatalogJanitorResponse" + + "\022n\n\027IsCatalogJanitorEnabled\022(.hbase.pb.I" + + "sCatalogJanitorEnabledRequest\032).hbase.pb" + + ".IsCatalogJanitorEnabledResponse\022V\n\017RunC" + + "leanerChore\022 .hbase.pb.RunCleanerChoreRe", + "quest\032!.hbase.pb.RunCleanerChoreResponse" + + "\022k\n\026SetCleanerChoreRunning\022\'.hbase.pb.Se" + + "tCleanerChoreRunningRequest\032(.hbase.pb.S" + + "etCleanerChoreRunningResponse\022h\n\025IsClean" + + "erChoreEnabled\022&.hbase.pb.IsCleanerChore" + + "EnabledRequest\032\'.hbase.pb.IsCleanerChore" + + "EnabledResponse\022^\n\021ExecMasterService\022#.h" + + "base.pb.CoprocessorServiceRequest\032$.hbas" + + "e.pb.CoprocessorServiceResponse\022A\n\010Snaps" + + "hot\022\031.hbase.pb.SnapshotRequest\032\032.hbase.p", + "b.SnapshotResponse\022h\n\025GetCompletedSnapsh" + + "ots\022&.hbase.pb.GetCompletedSnapshotsRequ" + + "est\032\'.hbase.pb.GetCompletedSnapshotsResp" + + "onse\022S\n\016DeleteSnapshot\022\037.hbase.pb.Delete" + + "SnapshotRequest\032 .hbase.pb.DeleteSnapsho" + + "tResponse\022S\n\016IsSnapshotDone\022\037.hbase.pb.I" + + "sSnapshotDoneRequest\032 .hbase.pb.IsSnapsh" + + "otDoneResponse\022V\n\017RestoreSnapshot\022 .hbas" + + "e.pb.RestoreSnapshotRequest\032!.hbase.pb.R" + + "estoreSnapshotResponse\022h\n\025IsRestoreSnaps", + "hotDone\022&.hbase.pb.IsRestoreSnapshotDone" + + "Request\032\'.hbase.pb.IsRestoreSnapshotDone" + + "Response\022P\n\rExecProcedure\022\036.hbase.pb.Exe" + + "cProcedureRequest\032\037.hbase.pb.ExecProcedu" + + "reResponse\022W\n\024ExecProcedureWithRet\022\036.hba" + + "se.pb.ExecProcedureRequest\032\037.hbase.pb.Ex" + + "ecProcedureResponse\022V\n\017IsProcedureDone\022 " + + ".hbase.pb.IsProcedureDoneRequest\032!.hbase" + + ".pb.IsProcedureDoneResponse\022V\n\017ModifyNam" + + "espace\022 .hbase.pb.ModifyNamespaceRequest", + "\032!.hbase.pb.ModifyNamespaceResponse\022V\n\017C" + + "reateNamespace\022 .hbase.pb.CreateNamespac" + + "eRequest\032!.hbase.pb.CreateNamespaceRespo" + + "nse\022V\n\017DeleteNamespace\022 .hbase.pb.Delete" + + "NamespaceRequest\032!.hbase.pb.DeleteNamesp" + + "aceResponse\022k\n\026GetNamespaceDescriptor\022\'." + + "hbase.pb.GetNamespaceDescriptorRequest\032(" + + ".hbase.pb.GetNamespaceDescriptorResponse" + + "\022q\n\030ListNamespaceDescriptors\022).hbase.pb." + + "ListNamespaceDescriptorsRequest\032*.hbase.", + "pb.ListNamespaceDescriptorsResponse\022\206\001\n\037" + + "ListTableDescriptorsByNamespace\0220.hbase." + + "pb.ListTableDescriptorsByNamespaceReques" + + "t\0321.hbase.pb.ListTableDescriptorsByNames" + + "paceResponse\022t\n\031ListTableNamesByNamespac" + + "e\022*.hbase.pb.ListTableNamesByNamespaceRe" + + "quest\032+.hbase.pb.ListTableNamesByNamespa" + + "ceResponse\022A\n\010SetQuota\022\031.hbase.pb.SetQuo" + + "taRequest\032\032.hbase.pb.SetQuotaResponse\022x\n" + + "\037getLastMajorCompactionTimestamp\022).hbase", + ".pb.MajorCompactionTimestampRequest\032*.hb" + + "ase.pb.MajorCompactionTimestampResponse\022" + + "\212\001\n(getLastMajorCompactionTimestampForRe" + + "gion\0222.hbase.pb.MajorCompactionTimestamp" + + "ForRegionRequest\032*.hbase.pb.MajorCompact" + + "ionTimestampResponse\022_\n\022getProcedureResu" + + "lt\022#.hbase.pb.GetProcedureResultRequest\032" + + "$.hbase.pb.GetProcedureResultResponse\022h\n" + + "\027getSecurityCapabilities\022%.hbase.pb.Secu" + + "rityCapabilitiesRequest\032&.hbase.pb.Secur", + "ityCapabilitiesResponse\022S\n\016AbortProcedur" + + "e\022\037.hbase.pb.AbortProcedureRequest\032 .hba" + + "se.pb.AbortProcedureResponse\022S\n\016ListProc" + + "edures\022\037.hbase.pb.ListProceduresRequest\032" + + " .hbase.pb.ListProceduresResponse\022Y\n\020Cle" + + "arDeadServers\022!.hbase.pb.ClearDeadServer" + + "sRequest\032\".hbase.pb.ClearDeadServersResp" + + "onse\022S\n\016ListNamespaces\022\037.hbase.pb.ListNa" + + "mespacesRequest\032 .hbase.pb.ListNamespace" + + "sResponse\022b\n\025SwitchSnapshotCleanup\022#.hba", + "se.pb.SetSnapshotCleanupRequest\032$.hbase." + + "pb.SetSnapshotCleanupResponse\022q\n\030IsSnaps" + + "hotCleanupEnabled\022).hbase.pb.IsSnapshotC" + + "leanupEnabledRequest\032*.hbase.pb.IsSnapsh" + + "otCleanupEnabledResponseBB\n*org.apache.h" + + "adoop.hbase.protobuf.generatedB\014MasterPr" + + "otosH\001\210\001\001\240\001\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -69736,6 +71683,30 @@ public final class MasterProtos { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_hbase_pb_ClearDeadServersResponse_descriptor, new java.lang.String[] { "ServerName", }); + internal_static_hbase_pb_SetSnapshotCleanupRequest_descriptor = + getDescriptor().getMessageTypes().get(119); + internal_static_hbase_pb_SetSnapshotCleanupRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_hbase_pb_SetSnapshotCleanupRequest_descriptor, + new java.lang.String[] { "Enabled", "Synchronous", }); + internal_static_hbase_pb_SetSnapshotCleanupResponse_descriptor = + getDescriptor().getMessageTypes().get(120); + internal_static_hbase_pb_SetSnapshotCleanupResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_hbase_pb_SetSnapshotCleanupResponse_descriptor, + new java.lang.String[] { "PrevSnapshotCleanup", }); + internal_static_hbase_pb_IsSnapshotCleanupEnabledRequest_descriptor = + getDescriptor().getMessageTypes().get(121); + internal_static_hbase_pb_IsSnapshotCleanupEnabledRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_hbase_pb_IsSnapshotCleanupEnabledRequest_descriptor, + new java.lang.String[] { }); + internal_static_hbase_pb_IsSnapshotCleanupEnabledResponse_descriptor = + getDescriptor().getMessageTypes().get(122); + internal_static_hbase_pb_IsSnapshotCleanupEnabledResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_hbase_pb_IsSnapshotCleanupEnabledResponse_descriptor, + new java.lang.String[] { "Enabled", }); return null; } }; diff --git a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/SnapshotCleanupProtos.java b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/SnapshotCleanupProtos.java new file mode 100644 index 00000000000..ba0f4e539d3 --- /dev/null +++ b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/SnapshotCleanupProtos.java @@ -0,0 +1,494 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SnapshotCleanup.proto + +package org.apache.hadoop.hbase.protobuf.generated; + +public final class SnapshotCleanupProtos { + private SnapshotCleanupProtos() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + } + public interface SnapshotCleanupStateOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required bool snapshot_cleanup_enabled = 1; + /** + * required bool snapshot_cleanup_enabled = 1; + */ + boolean hasSnapshotCleanupEnabled(); + /** + * required bool snapshot_cleanup_enabled = 1; + */ + boolean getSnapshotCleanupEnabled(); + } + /** + * Protobuf type {@code hbase.pb.SnapshotCleanupState} + */ + public static final class SnapshotCleanupState extends + com.google.protobuf.GeneratedMessage + implements SnapshotCleanupStateOrBuilder { + // Use SnapshotCleanupState.newBuilder() to construct. + private SnapshotCleanupState(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private SnapshotCleanupState(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final SnapshotCleanupState defaultInstance; + public static SnapshotCleanupState getDefaultInstance() { + return defaultInstance; + } + + public SnapshotCleanupState getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SnapshotCleanupState( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + snapshotCleanupEnabled_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.internal_static_hbase_pb_SnapshotCleanupState_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.internal_static_hbase_pb_SnapshotCleanupState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState.class, org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public SnapshotCleanupState parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SnapshotCleanupState(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required bool snapshot_cleanup_enabled = 1; + public static final int SNAPSHOT_CLEANUP_ENABLED_FIELD_NUMBER = 1; + private boolean snapshotCleanupEnabled_; + /** + * required bool snapshot_cleanup_enabled = 1; + */ + public boolean hasSnapshotCleanupEnabled() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool snapshot_cleanup_enabled = 1; + */ + public boolean getSnapshotCleanupEnabled() { + return snapshotCleanupEnabled_; + } + + private void initFields() { + snapshotCleanupEnabled_ = false; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasSnapshotCleanupEnabled()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBool(1, snapshotCleanupEnabled_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, snapshotCleanupEnabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState other = (org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState) obj; + + boolean result = true; + result = result && (hasSnapshotCleanupEnabled() == other.hasSnapshotCleanupEnabled()); + if (hasSnapshotCleanupEnabled()) { + result = result && (getSnapshotCleanupEnabled() + == other.getSnapshotCleanupEnabled()); + } + result = result && + getUnknownFields().equals(other.getUnknownFields()); + return result; + } + + private int memoizedHashCode = 0; + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasSnapshotCleanupEnabled()) { + hash = (37 * hash) + SNAPSHOT_CLEANUP_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + hashBoolean(getSnapshotCleanupEnabled()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code hbase.pb.SnapshotCleanupState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.internal_static_hbase_pb_SnapshotCleanupState_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.internal_static_hbase_pb_SnapshotCleanupState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState.class, org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + snapshotCleanupEnabled_ = false; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.internal_static_hbase_pb_SnapshotCleanupState_descriptor; + } + + public org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState getDefaultInstanceForType() { + return org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState build() { + org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState buildPartial() { + org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState result = new org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.snapshotCleanupEnabled_ = snapshotCleanupEnabled_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState) { + return mergeFrom((org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState other) { + if (other == org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState.getDefaultInstance()) return this; + if (other.hasSnapshotCleanupEnabled()) { + setSnapshotCleanupEnabled(other.getSnapshotCleanupEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasSnapshotCleanupEnabled()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos.SnapshotCleanupState) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required bool snapshot_cleanup_enabled = 1; + private boolean snapshotCleanupEnabled_ ; + /** + * required bool snapshot_cleanup_enabled = 1; + */ + public boolean hasSnapshotCleanupEnabled() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool snapshot_cleanup_enabled = 1; + */ + public boolean getSnapshotCleanupEnabled() { + return snapshotCleanupEnabled_; + } + /** + * required bool snapshot_cleanup_enabled = 1; + */ + public Builder setSnapshotCleanupEnabled(boolean value) { + bitField0_ |= 0x00000001; + snapshotCleanupEnabled_ = value; + onChanged(); + return this; + } + /** + * required bool snapshot_cleanup_enabled = 1; + */ + public Builder clearSnapshotCleanupEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + snapshotCleanupEnabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:hbase.pb.SnapshotCleanupState) + } + + static { + defaultInstance = new SnapshotCleanupState(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:hbase.pb.SnapshotCleanupState) + } + + private static com.google.protobuf.Descriptors.Descriptor + internal_static_hbase_pb_SnapshotCleanupState_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_hbase_pb_SnapshotCleanupState_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\025SnapshotCleanup.proto\022\010hbase.pb\"8\n\024Sna" + + "pshotCleanupState\022 \n\030snapshot_cleanup_en" + + "abled\030\001 \002(\010BK\n*org.apache.hadoop.hbase.p" + + "rotobuf.generatedB\025SnapshotCleanupProtos" + + "H\001\210\001\001\240\001\001" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + internal_static_hbase_pb_SnapshotCleanupState_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_hbase_pb_SnapshotCleanupState_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_hbase_pb_SnapshotCleanupState_descriptor, + new java.lang.String[] { "SnapshotCleanupEnabled", }); + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/hbase-protocol/src/main/protobuf/Master.proto b/hbase-protocol/src/main/protobuf/Master.proto index 98e64b95c7d..f43c4e0f285 100644 --- a/hbase-protocol/src/main/protobuf/Master.proto +++ b/hbase-protocol/src/main/protobuf/Master.proto @@ -571,6 +571,23 @@ message ClearDeadServersResponse { repeated ServerName server_name = 1; } +message SetSnapshotCleanupRequest { + required bool enabled = 1; + optional bool synchronous = 2; +} + +message SetSnapshotCleanupResponse { + required bool prev_snapshot_cleanup = 1; +} + +message IsSnapshotCleanupEnabledRequest { +} + +message IsSnapshotCleanupEnabledResponse { + required bool enabled = 1; +} + + service MasterService { /** Used by the client to get the number of regions that have received the updated schema */ rpc GetSchemaAlterStatus(GetSchemaAlterStatusRequest) @@ -871,4 +888,18 @@ service MasterService { /** returns a list of namespace names */ rpc ListNamespaces(ListNamespacesRequest) returns(ListNamespacesResponse); + + /** + * Turn on/off snapshot auto-cleanup based on TTL expiration + */ + rpc SwitchSnapshotCleanup (SetSnapshotCleanupRequest) + returns (SetSnapshotCleanupResponse); + + /** + * Determine if snapshot auto-cleanup based on TTL expiration is turned on + */ + rpc IsSnapshotCleanupEnabled (IsSnapshotCleanupEnabledRequest) + returns (IsSnapshotCleanupEnabledResponse); + + } diff --git a/hbase-protocol/src/main/protobuf/SnapshotCleanup.proto b/hbase-protocol/src/main/protobuf/SnapshotCleanup.proto new file mode 100644 index 00000000000..1c0c9d3745f --- /dev/null +++ b/hbase-protocol/src/main/protobuf/SnapshotCleanup.proto @@ -0,0 +1,31 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + + +// This file contains protocol buffers to represent the state of the snapshot auto cleanup based on TTL +package hbase.pb; + +option java_package = "org.apache.hadoop.hbase.protobuf.generated"; +option java_outer_classname = "SnapshotCleanupProtos"; +option java_generic_services = true; +option java_generate_equals_and_hash = true; +option optimize_for = SPEED; + +message SnapshotCleanupState { + required bool snapshot_cleanup_enabled = 1; +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 1518f76c8be..d560a375f29 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -174,6 +174,7 @@ import org.apache.hadoop.hbase.zookeeper.MasterMaintenanceModeTracker; import org.apache.hadoop.hbase.zookeeper.MetaTableLocator; import org.apache.hadoop.hbase.zookeeper.RegionNormalizerTracker; import org.apache.hadoop.hbase.zookeeper.RegionServerTracker; +import org.apache.hadoop.hbase.zookeeper.SnapshotCleanupTracker; import org.apache.hadoop.hbase.zookeeper.SplitOrMergeTracker; import org.apache.hadoop.hbase.zookeeper.ZKClusterId; import org.apache.hadoop.hbase.zookeeper.ZKUtil; @@ -284,6 +285,9 @@ public class HMaster extends HRegionServer implements MasterServices, Server { /** Namespace stuff */ private TableNamespaceManager tableNamespaceManager; + // Tracker for auto snapshot cleanup state + SnapshotCleanupTracker snapshotCleanupTracker; + //Tracker for master maintenance mode setting private MasterMaintenanceModeTracker maintenanceModeTracker; @@ -685,6 +689,9 @@ public class HMaster extends HRegionServer implements MasterServices, Server { this.serverManager); this.drainingServerTracker.start(); + this.snapshotCleanupTracker = new SnapshotCleanupTracker(zooKeeper, this); + this.snapshotCleanupTracker.start(); + this.maintenanceModeTracker = new MasterMaintenanceModeTracker(zooKeeper); this.maintenanceModeTracker.start(); @@ -1254,15 +1261,15 @@ public class HMaster extends HRegionServer implements MasterServices, Server { getMasterFileSystem().getFileSystem(), archiveDir, cleanerPool, params); getChoreService().scheduleChore(hfileCleaner); - final boolean isSnapshotChoreDisabled = conf.getBoolean(HConstants.SNAPSHOT_CLEANER_DISABLE, - false); - if (isSnapshotChoreDisabled) { + final boolean isSnapshotChoreEnabled = this.snapshotCleanupTracker + .isSnapshotCleanupEnabled(); + this.snapshotCleanerChore = new SnapshotCleanerChore(this, conf, getSnapshotManager()); + if (isSnapshotChoreEnabled) { + getChoreService().scheduleChore(this.snapshotCleanerChore); + } else { if (LOG.isTraceEnabled()) { LOG.trace("Snapshot Cleaner Chore is disabled. Not starting up the chore.."); } - } else { - this.snapshotCleanerChore = new SnapshotCleanerChore(this, conf, getSnapshotManager()); - getChoreService().scheduleChore(this.snapshotCleanerChore); } serviceStarted = true; @@ -1347,6 +1354,37 @@ public class HMaster extends HRegionServer implements MasterServices, Server { procedureExecutor.start(numThreads, abortOnCorruption); } + /** + * Turn on/off Snapshot Cleanup Chore + * + * @param on indicates whether Snapshot Cleanup Chore is to be run + */ + void switchSnapshotCleanup(final boolean on, final boolean synchronous) { + if (synchronous) { + synchronized (this.snapshotCleanerChore) { + switchSnapshotCleanup(on); + } + } else { + switchSnapshotCleanup(on); + } + } + + private void switchSnapshotCleanup(final boolean on) { + try { + snapshotCleanupTracker.setSnapshotCleanupEnabled(on); + if (on) { + if (!getChoreService().isChoreScheduled(this.snapshotCleanerChore)) { + getChoreService().scheduleChore(this.snapshotCleanerChore); + } + } else { + getChoreService().cancelChore(this.snapshotCleanerChore); + } + } catch (KeeperException e) { + LOG.error("Error updating snapshot cleanup mode to " + on, e); + } + } + + private void stopProcedureExecutor() { if (procedureExecutor != null) { procedureExecutor.stop(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index 02cd80c349e..82b456e0642 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -123,6 +123,8 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsProcedureDoneRe import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsProcedureDoneResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsRestoreSnapshotDoneRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsRestoreSnapshotDoneResponse; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotDoneRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotDoneResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespacesRequest; @@ -168,6 +170,8 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetNormalizerRunn import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetNormalizerRunningResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaResponse; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ShutdownRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ShutdownResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SnapshotRequest; @@ -1356,6 +1360,55 @@ public class MasterRpcServices extends RSRpcServices } } + @Override + public SetSnapshotCleanupResponse switchSnapshotCleanup( + RpcController controller, SetSnapshotCleanupRequest request) + throws ServiceException { + try { + master.checkInitialized(); + final boolean enabled = request.getEnabled(); + final boolean isSynchronous = request.hasSynchronous() && request.getSynchronous(); + final boolean prevSnapshotCleanupRunning = this.switchSnapshotCleanup(enabled, isSynchronous); + return SetSnapshotCleanupResponse.newBuilder() + .setPrevSnapshotCleanup(prevSnapshotCleanupRunning).build(); + } catch (IOException e) { + throw new ServiceException(e); + } + } + + @Override + public IsSnapshotCleanupEnabledResponse isSnapshotCleanupEnabled( + RpcController controller, IsSnapshotCleanupEnabledRequest request) + throws ServiceException { + try { + master.checkInitialized(); + final boolean isSnapshotCleanupEnabled = master.snapshotCleanupTracker + .isSnapshotCleanupEnabled(); + return IsSnapshotCleanupEnabledResponse.newBuilder() + .setEnabled(isSnapshotCleanupEnabled).build(); + } catch (IOException e) { + throw new ServiceException(e); + } + } + + /** + * Turn on/off snapshot auto-cleanup based on TTL + * + * @param enabledNewVal Set to true to enable, false to disable + * @param synchronous If true, it waits until current snapshot cleanup is completed, + * if outstanding + * @return previous snapshot auto-cleanup mode + */ + private synchronized boolean switchSnapshotCleanup(final boolean enabledNewVal, + final boolean synchronous) { + final boolean oldValue = master.snapshotCleanupTracker.isSnapshotCleanupEnabled(); + master.switchSnapshotCleanup(enabledNewVal, synchronous); + LOG.info(master.getClientIdAuditPrefix() + " Successfully set snapshot cleanup to {}" + + enabledNewVal); + return oldValue; + } + + @Override public RunCatalogScanResponse runCatalogScan(RpcController c, RunCatalogScanRequest req) throws ServiceException { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/SnapshotCleanupTracker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/SnapshotCleanupTracker.java new file mode 100644 index 00000000000..4619081f6fa --- /dev/null +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/SnapshotCleanupTracker.java @@ -0,0 +1,112 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.apache.hadoop.hbase.zookeeper; + +import java.io.IOException; + +import org.apache.hadoop.hbase.Abortable; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.protobuf.ProtobufUtil; +import org.apache.hadoop.hbase.protobuf.generated.SnapshotCleanupProtos; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.zookeeper.KeeperException; + + +/** + * Tracks status of snapshot auto cleanup based on TTL + */ +@InterfaceAudience.Private +public class SnapshotCleanupTracker extends ZooKeeperNodeTracker { + + /** + * Constructs a new ZK node tracker. + * + *

After construction, use {@link #start} to kick off tracking. + * + * @param watcher reference to the {@link ZooKeeperWatcher} which also contains configuration + * and constants + * @param abortable used to abort if a fatal error occurs + */ + public SnapshotCleanupTracker(ZooKeeperWatcher watcher, Abortable abortable) { + super(watcher, watcher.snapshotCleanupZNode, abortable); + } + + /** + * Returns the current state of the snapshot auto cleanup based on TTL + * + * @return true if the snapshot auto cleanup is enabled, + * false otherwise. + */ + public boolean isSnapshotCleanupEnabled() { + byte[] snapshotCleanupZNodeData = super.getData(false); + try { + // if data in ZK is null, use default of on. + return snapshotCleanupZNodeData == null || + parseFrom(snapshotCleanupZNodeData).getSnapshotCleanupEnabled(); + } catch (DeserializationException dex) { + LOG.error("ZK state for Snapshot Cleanup could not be parsed " + + Bytes.toStringBinary(snapshotCleanupZNodeData), dex); + // return false to be safe. + return false; + } + } + + /** + * Set snapshot auto clean on/off + * + * @param snapshotCleanupEnabled true if the snapshot auto cleanup should be on, + * false otherwise + * @throws KeeperException if ZooKeeper operation fails + */ + public void setSnapshotCleanupEnabled(final boolean snapshotCleanupEnabled) + throws KeeperException { + byte [] snapshotCleanupZNodeData = toByteArray(snapshotCleanupEnabled); + try { + ZKUtil.setData(watcher, watcher.snapshotCleanupZNode, + snapshotCleanupZNodeData); + } catch(KeeperException.NoNodeException nne) { + ZKUtil.createAndWatch(watcher, watcher.snapshotCleanupZNode, + snapshotCleanupZNodeData); + } + super.nodeDataChanged(watcher.snapshotCleanupZNode); + } + + private byte[] toByteArray(final boolean isSnapshotCleanupEnabled) { + SnapshotCleanupProtos.SnapshotCleanupState.Builder builder = + SnapshotCleanupProtos.SnapshotCleanupState.newBuilder(); + builder.setSnapshotCleanupEnabled(isSnapshotCleanupEnabled); + return ProtobufUtil.prependPBMagic(builder.build().toByteArray()); + } + + private SnapshotCleanupProtos.SnapshotCleanupState parseFrom(final byte[] pbBytes) + throws DeserializationException { + ProtobufUtil.expectPBMagicPrefix(pbBytes); + SnapshotCleanupProtos.SnapshotCleanupState.Builder builder = + SnapshotCleanupProtos.SnapshotCleanupState.newBuilder(); + try { + int magicLen = ProtobufUtil.lengthOfPBMagic(); + ProtobufUtil.mergeFrom(builder, pbBytes, magicLen, pbBytes.length - magicLen); + } catch (IOException e) { + throw new DeserializationException(e); + } + return builder.build(); + } + +} diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java index 40850596583..db1146bbd98 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java @@ -864,4 +864,31 @@ public class TestAdmin2 { Assert.assertEquals(expectedStoreFilesSize, store.getSize()); } } + + @Test + public void testSnapshotCleanupAsync() throws Exception { + testSnapshotCleanup(false); + } + + @Test + public void testSnapshotCleanupSync() throws Exception { + testSnapshotCleanup(true); + } + + private void testSnapshotCleanup(final boolean synchronous) throws IOException { + final boolean initialState = admin.isSnapshotCleanupEnabled(); + // Switch the snapshot auto cleanup state to opposite to initial state + boolean prevState = admin.snapshotCleanupSwitch(!initialState, synchronous); + // The previous state should be the original state we observed + assertEquals(initialState, prevState); + // Current state should be opposite of the initial state + assertEquals(!initialState, admin.isSnapshotCleanupEnabled()); + // Reset the state back to what it was initially + prevState = admin.snapshotCleanupSwitch(initialState, synchronous); + // The previous state should be the opposite of the initial state + assertEquals(!initialState, prevState); + // Current state should be the original state again + assertEquals(initialState, admin.isSnapshotCleanupEnabled()); + } + } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotCleanerChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotCleanerChore.java index 720387ee7b8..19c450c741a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotCleanerChore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotCleanerChore.java @@ -98,7 +98,6 @@ public class TestSnapshotCleanerChore { snapshotManager = Mockito.mock(SnapshotManager.class); Stoppable stopper = new StoppableImplementation(); Configuration conf = getSnapshotCleanerConf(); - conf.setStrings("hbase.master.cleaner.snapshot.disable", "false"); SnapshotCleanerChore snapshotCleanerChore = new SnapshotCleanerChore(stopper, conf, snapshotManager); List snapshotDescriptionList = new ArrayList<>(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java index 1996fff7518..de1f31a834e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java @@ -22,10 +22,12 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import com.google.common.util.concurrent.Uninterruptibles; import java.io.IOException; import java.util.Collection; import java.util.List; import java.util.Set; +import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; import org.apache.commons.logging.Log; @@ -50,8 +52,11 @@ import org.apache.hadoop.hbase.master.snapshot.SnapshotManager; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.DeleteSnapshotRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.GetCompletedSnapshotsRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.GetCompletedSnapshotsResponse; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledRequest; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotDoneRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotDoneResponse; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetSnapshotCleanupRequest; import org.apache.hadoop.hbase.regionserver.CompactedHFilesDischarger; import org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy; import org.apache.hadoop.hbase.regionserver.HRegion; @@ -66,6 +71,7 @@ import org.apache.hadoop.hbase.util.FSUtils; import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread; import org.junit.After; import org.junit.AfterClass; +import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -131,6 +137,7 @@ public class TestSnapshotFromMaster { conf.set(HConstants.HBASE_REGION_SPLIT_POLICY_KEY, ConstantSizeRegionSplitPolicy.class.getName()); conf.setInt("hbase.hfile.compactions.cleaner.interval", 20 * 1000); + conf.setInt("hbase.master.cleaner.snapshot.interval", 500); } @Before @@ -278,6 +285,89 @@ public class TestSnapshotFromMaster { master.getMasterRpcServices().deleteSnapshot(null, request); } + @Test + public void testGetCompletedSnapshotsWithCleanup() throws Exception { + // Enable auto snapshot cleanup for the cluster + SetSnapshotCleanupRequest setSnapshotCleanupRequest = + SetSnapshotCleanupRequest.newBuilder().setEnabled(true).build(); + master.getMasterRpcServices().switchSnapshotCleanup(null, setSnapshotCleanupRequest); + + // first check when there are no snapshots + GetCompletedSnapshotsRequest request = GetCompletedSnapshotsRequest.newBuilder().build(); + GetCompletedSnapshotsResponse response = + master.getMasterRpcServices().getCompletedSnapshots(null, request); + assertEquals("Found unexpected number of snapshots", 0, response.getSnapshotsCount()); + + // write one snapshot to the fs + createSnapshotWithTtl("snapshot_01", 1L); + createSnapshotWithTtl("snapshot_02", 10L); + + // check that we get one snapshot + response = master.getMasterRpcServices().getCompletedSnapshots(null, request); + assertEquals("Found unexpected number of snapshots", 2, response.getSnapshotsCount()); + + // check that 1 snapshot is auto cleaned after 1 sec of TTL expiration + Uninterruptibles.sleepUninterruptibly(2, TimeUnit.SECONDS); + response = master.getMasterRpcServices().getCompletedSnapshots(null, request); + assertEquals("Found unexpected number of snapshots", 1, response.getSnapshotsCount()); + } + + @Test + public void testGetCompletedSnapshotsWithoutCleanup() throws Exception { + // Disable auto snapshot cleanup for the cluster + SetSnapshotCleanupRequest setSnapshotCleanupRequest = + SetSnapshotCleanupRequest.newBuilder().setEnabled(false).build(); + master.getMasterRpcServices().switchSnapshotCleanup(null, setSnapshotCleanupRequest); + + // first check when there are no snapshots + GetCompletedSnapshotsRequest request = GetCompletedSnapshotsRequest.newBuilder().build(); + GetCompletedSnapshotsResponse response = + master.getMasterRpcServices().getCompletedSnapshots(null, request); + assertEquals("Found unexpected number of snapshots", 0, response.getSnapshotsCount()); + + // write one snapshot to the fs + createSnapshotWithTtl("snapshot_02", 1L); + createSnapshotWithTtl("snapshot_03", 1L); + + // check that we get one snapshot + response = master.getMasterRpcServices().getCompletedSnapshots(null, request); + assertEquals("Found unexpected number of snapshots", 2, response.getSnapshotsCount()); + + // check that no snapshot is auto cleaned even after 1 sec of TTL expiration + Uninterruptibles.sleepUninterruptibly(2, TimeUnit.SECONDS); + response = master.getMasterRpcServices().getCompletedSnapshots(null, request); + assertEquals("Found unexpected number of snapshots", 2, response.getSnapshotsCount()); + } + + @Test + public void testSnapshotCleanupStatus() throws Exception { + // Enable auto snapshot cleanup for the cluster + SetSnapshotCleanupRequest setSnapshotCleanupRequest = + SetSnapshotCleanupRequest.newBuilder().setEnabled(true).build(); + master.getMasterRpcServices().switchSnapshotCleanup(null, setSnapshotCleanupRequest); + + // Check if auto snapshot cleanup is enabled + IsSnapshotCleanupEnabledRequest isSnapshotCleanupEnabledRequest = + IsSnapshotCleanupEnabledRequest.newBuilder().build(); + IsSnapshotCleanupEnabledResponse isSnapshotCleanupEnabledResponse = + master.getMasterRpcServices().isSnapshotCleanupEnabled(null, + isSnapshotCleanupEnabledRequest); + Assert.assertTrue(isSnapshotCleanupEnabledResponse.getEnabled()); + + // Disable auto snapshot cleanup for the cluster + setSnapshotCleanupRequest = SetSnapshotCleanupRequest.newBuilder() + .setEnabled(false).build(); + master.getMasterRpcServices().switchSnapshotCleanup(null, setSnapshotCleanupRequest); + + // Check if auto snapshot cleanup is disabled + isSnapshotCleanupEnabledRequest = IsSnapshotCleanupEnabledRequest + .newBuilder().build(); + isSnapshotCleanupEnabledResponse = + master.getMasterRpcServices().isSnapshotCleanupEnabled(null, + isSnapshotCleanupEnabledRequest); + Assert.assertFalse(isSnapshotCleanupEnabledResponse.getEnabled()); + } + /** * Test that the snapshot hfile archive cleaner works correctly. HFiles that are in snapshots * should be retained, while those that are not in a snapshot should be deleted. @@ -412,6 +502,16 @@ public class TestSnapshotFromMaster { UTIL.getHBaseCluster().getMaster().getHFileCleaner().chore(); } + private SnapshotDescription createSnapshotWithTtl(final String snapshotName, final long ttl) + throws IOException { + SnapshotTestingUtils.SnapshotMock snapshotMock = + new SnapshotTestingUtils.SnapshotMock(UTIL.getConfiguration(), fs, rootDir); + SnapshotTestingUtils.SnapshotMock.SnapshotBuilder builder = + snapshotMock.createSnapshotV2(snapshotName, "test", 0, ttl); + builder.commit(); + return builder.getSnapshotDescription(); + } + @Test public void testAsyncSnapshotWillNotBlockSnapshotHFileCleaner() throws Exception { // Write some data diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java index 68200193482..75dc31f081f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java @@ -67,6 +67,7 @@ import org.apache.hadoop.hbase.regionserver.HRegionFileSystem; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.regionserver.Region; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.FSTableDescriptors; import org.apache.hadoop.hbase.util.FSVisitor; import org.apache.hadoop.hbase.util.FSUtils; @@ -666,6 +667,12 @@ public final class SnapshotTestingUtils { return createSnapshot(snapshotName, tableName, numRegions, SnapshotManifestV2.DESCRIPTOR_VERSION); } + public SnapshotBuilder createSnapshotV2(final String snapshotName, final String tableName, + final int numRegions, final long ttl) throws IOException { + return createSnapshot(snapshotName, tableName, numRegions, + SnapshotManifestV2.DESCRIPTOR_VERSION, ttl); + } + private SnapshotBuilder createSnapshot(final String snapshotName, final String tableName, final int version) throws IOException { return createSnapshot(snapshotName, tableName, TEST_NUM_REGIONS, version); @@ -687,6 +694,22 @@ public final class SnapshotTestingUtils { return new SnapshotBuilder(conf, fs, rootDir, htd, desc, regions); } + private SnapshotBuilder createSnapshot(final String snapshotName, final String tableName, + final int numRegions, final int version, final long ttl) throws IOException { + HTableDescriptor htd = createHtd(tableName); + RegionData[] regions = createTable(htd, numRegions); + SnapshotDescription desc = SnapshotDescription.newBuilder() + .setTable(htd.getTableName().getNameAsString()) + .setName(snapshotName) + .setVersion(version) + .setCreationTime(EnvironmentEdgeManager.currentTime()) + .setTtl(ttl) + .build(); + Path workingDir = SnapshotDescriptionUtils.getWorkingSnapshotDir(desc, rootDir, conf); + SnapshotDescriptionUtils.writeSnapshotInfo(desc, workingDir, fs); + return new SnapshotBuilder(conf, fs, rootDir, htd, desc, regions); + } + public HTableDescriptor createHtd(final String tableName) { HTableDescriptor htd = new HTableDescriptor(tableName); htd.addFamily(new HColumnDescriptor(TEST_FAMILY)); diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb index 062b6a32295..f09bff0a12f 100644 --- a/hbase-shell/src/main/ruby/hbase/admin.rb +++ b/hbase-shell/src/main/ruby/hbase/admin.rb @@ -468,6 +468,22 @@ module Hbase @admin.getTableDescriptor(TableName.valueOf(table_name)).toStringTableAttributes end + #---------------------------------------------------------------------------------------------- + # Enable/disable snapshot auto-cleanup based on TTL expiration + # Returns previous snapshot auto-cleanup switch setting. + def snapshot_cleanup_switch(enable_disable) + @admin.snapshotCleanupSwitch( + java.lang.Boolean.valueOf(enable_disable), java.lang.Boolean.valueOf(false) + ) + end + + #---------------------------------------------------------------------------------------------- + # Query the current state of the snapshot auto-cleanup based on TTL + # Returns the snapshot auto-cleanup state (true if enabled) + def snapshot_cleanup_enabled? + @admin.isSnapshotCleanupEnabled + end + #---------------------------------------------------------------------------------------------- # Truncates table (deletes all records by recreating the table) def truncate(table_name, conf = @conf) diff --git a/hbase-shell/src/main/ruby/shell.rb b/hbase-shell/src/main/ruby/shell.rb index ad3bcd8a6a2..5cf23203c63 100644 --- a/hbase-shell/src/main/ruby/shell.rb +++ b/hbase-shell/src/main/ruby/shell.rb @@ -350,6 +350,8 @@ Shell.load_command_group( compact_rs compaction_state trace + snapshot_cleanup_switch + snapshot_cleanup_enabled splitormerge_switch splitormerge_enabled list_deadservers diff --git a/hbase-shell/src/main/ruby/shell/commands/snapshot_cleanup_enabled.rb b/hbase-shell/src/main/ruby/shell/commands/snapshot_cleanup_enabled.rb new file mode 100644 index 00000000000..15122f5c7d1 --- /dev/null +++ b/hbase-shell/src/main/ruby/shell/commands/snapshot_cleanup_enabled.rb @@ -0,0 +1,39 @@ +# +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with this +# work for additional information regarding copyright ownership. The ASF +# licenses this file to you 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. + +# Prints if snapshot auto cleanup based on TTL is enabled + +module Shell + module Commands + class SnapshotCleanupEnabled < Command + def help + <<-EOF +Query the snapshot auto-cleanup state. +Examples: + + hbase> snapshot_cleanup_enabled + EOF + end + + def command + state = admin.snapshot_cleanup_enabled? + formatter.row([state.to_s]) + state + end + end + end +end diff --git a/hbase-shell/src/main/ruby/shell/commands/snapshot_cleanup_switch.rb b/hbase-shell/src/main/ruby/shell/commands/snapshot_cleanup_switch.rb new file mode 100644 index 00000000000..f63ef7051e1 --- /dev/null +++ b/hbase-shell/src/main/ruby/shell/commands/snapshot_cleanup_switch.rb @@ -0,0 +1,43 @@ +# +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + +# Switch snapshot auto-cleanup based on TTL expiration + +module Shell + module Commands + class SnapshotCleanupSwitch < Command + def help + <<-EOF +Enable/Disable snapshot auto-cleanup based on snapshot TTL. +Returns previous snapshot auto-cleanup switch state. +Examples: + + hbase> snapshot_cleanup_switch true + hbase> snapshot_cleanup_switch false + EOF + end + + def command(enable_disable) + prev_state = admin.snapshot_cleanup_switch(enable_disable) ? 'true' : 'false' + formatter.row(["Previous snapshot cleanup state : #{prev_state}"]) + prev_state + end + end + end +end diff --git a/src/main/asciidoc/_chapters/ops_mgt.adoc b/src/main/asciidoc/_chapters/ops_mgt.adoc index 9c1eaba7224..777d5a92617 100644 --- a/src/main/asciidoc/_chapters/ops_mgt.adoc +++ b/src/main/asciidoc/_chapters/ops_mgt.adoc @@ -2038,11 +2038,43 @@ Value 0 for this config indicates TTL: FOREVER -At any point of time, if Snapshot cleanup is supposed to be stopped due to -some snapshot restore activity, it is advisable to disable Snapshot Cleaner with - config: +.Enable/Disable Snapshot Auto Cleanup on running cluster: -`hbase.master.cleaner.snapshot.disable`: "true" +By default, snapshot auto cleanup based on TTL would be enabled +for any new cluster. +At any point in time, if snapshot cleanup is supposed to be stopped due to +some snapshot restore activity or any other reason, it is advisable +to disable it using shell command: + +---- +hbase> snapshot_cleanup_switch false +---- + +We can re-enable it using: + +---- +hbase> snapshot_cleanup_switch true +---- + +The shell command with switch false would disable snapshot auto +cleanup activity based on TTL and return the previous state of +the activity(true: running already, false: disabled already) + +A sample output for above commands: +---- +Previous snapshot cleanup state : true +Took 0.0069 seconds +=> "true" +---- + +We can query whether snapshot auto cleanup is enabled for +cluster using: + +---- +hbase> snapshot_cleanup_enabled +---- + +The command would return output in true/false. [[ops.snapshots.list]]