You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by el...@apache.org on 2017/01/23 23:01:56 UTC
[23/50] [abbrv] hbase git commit: HBASE-16831 Procedure V2 - Remove
org.apache.hadoop.hbase.zookeeper.lock (Appy)
http://git-wip-us.apache.org/repos/asf/hbase/blob/4fdd6ff9/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/ZooKeeperProtos.java
----------------------------------------------------------------------
diff --git a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/ZooKeeperProtos.java b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/ZooKeeperProtos.java
index 0095043..81cc69b 100644
--- a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/ZooKeeperProtos.java
+++ b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/ZooKeeperProtos.java
@@ -7793,1221 +7793,6 @@ public final class ZooKeeperProtos {
// @@protoc_insertion_point(class_scope:hbase.pb.ReplicationHLogPosition)
}
- public interface TableLockOrBuilder
- extends com.google.protobuf.MessageOrBuilder {
-
- // optional .hbase.pb.TableName table_name = 1;
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- boolean hasTableName();
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName getTableName();
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableNameOrBuilder getTableNameOrBuilder();
-
- // optional .hbase.pb.ServerName lock_owner = 2;
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- boolean hasLockOwner();
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName getLockOwner();
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerNameOrBuilder getLockOwnerOrBuilder();
-
- // optional int64 thread_id = 3;
- /**
- * <code>optional int64 thread_id = 3;</code>
- */
- boolean hasThreadId();
- /**
- * <code>optional int64 thread_id = 3;</code>
- */
- long getThreadId();
-
- // optional bool is_shared = 4;
- /**
- * <code>optional bool is_shared = 4;</code>
- */
- boolean hasIsShared();
- /**
- * <code>optional bool is_shared = 4;</code>
- */
- boolean getIsShared();
-
- // optional string purpose = 5;
- /**
- * <code>optional string purpose = 5;</code>
- */
- boolean hasPurpose();
- /**
- * <code>optional string purpose = 5;</code>
- */
- java.lang.String getPurpose();
- /**
- * <code>optional string purpose = 5;</code>
- */
- com.google.protobuf.ByteString
- getPurposeBytes();
-
- // optional int64 create_time = 6;
- /**
- * <code>optional int64 create_time = 6;</code>
- */
- boolean hasCreateTime();
- /**
- * <code>optional int64 create_time = 6;</code>
- */
- long getCreateTime();
- }
- /**
- * Protobuf type {@code hbase.pb.TableLock}
- *
- * <pre>
- **
- * Metadata associated with a table lock in zookeeper
- * </pre>
- */
- public static final class TableLock extends
- com.google.protobuf.GeneratedMessage
- implements TableLockOrBuilder {
- // Use TableLock.newBuilder() to construct.
- private TableLock(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
- super(builder);
- this.unknownFields = builder.getUnknownFields();
- }
- private TableLock(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
-
- private static final TableLock defaultInstance;
- public static TableLock getDefaultInstance() {
- return defaultInstance;
- }
-
- public TableLock getDefaultInstanceForType() {
- return defaultInstance;
- }
-
- private final com.google.protobuf.UnknownFieldSet unknownFields;
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private TableLock(
- 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 10: {
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.Builder subBuilder = null;
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- subBuilder = tableName_.toBuilder();
- }
- tableName_ = input.readMessage(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.PARSER, extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(tableName_);
- tableName_ = subBuilder.buildPartial();
- }
- bitField0_ |= 0x00000001;
- break;
- }
- case 18: {
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.Builder subBuilder = null;
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- subBuilder = lockOwner_.toBuilder();
- }
- lockOwner_ = input.readMessage(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.PARSER, extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(lockOwner_);
- lockOwner_ = subBuilder.buildPartial();
- }
- bitField0_ |= 0x00000002;
- break;
- }
- case 24: {
- bitField0_ |= 0x00000004;
- threadId_ = input.readInt64();
- break;
- }
- case 32: {
- bitField0_ |= 0x00000008;
- isShared_ = input.readBool();
- break;
- }
- case 42: {
- bitField0_ |= 0x00000010;
- purpose_ = input.readBytes();
- break;
- }
- case 48: {
- bitField0_ |= 0x00000020;
- createTime_ = input.readInt64();
- 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.ZooKeeperProtos.internal_static_hbase_pb_TableLock_descriptor;
- }
-
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.internal_static_hbase_pb_TableLock_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock.class, org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock.Builder.class);
- }
-
- public static com.google.protobuf.Parser<TableLock> PARSER =
- new com.google.protobuf.AbstractParser<TableLock>() {
- public TableLock parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new TableLock(input, extensionRegistry);
- }
- };
-
- @java.lang.Override
- public com.google.protobuf.Parser<TableLock> getParserForType() {
- return PARSER;
- }
-
- private int bitField0_;
- // optional .hbase.pb.TableName table_name = 1;
- public static final int TABLE_NAME_FIELD_NUMBER = 1;
- private org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName tableName_;
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- public boolean hasTableName() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName getTableName() {
- return tableName_;
- }
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableNameOrBuilder getTableNameOrBuilder() {
- return tableName_;
- }
-
- // optional .hbase.pb.ServerName lock_owner = 2;
- public static final int LOCK_OWNER_FIELD_NUMBER = 2;
- private org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName lockOwner_;
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- public boolean hasLockOwner() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName getLockOwner() {
- return lockOwner_;
- }
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerNameOrBuilder getLockOwnerOrBuilder() {
- return lockOwner_;
- }
-
- // optional int64 thread_id = 3;
- public static final int THREAD_ID_FIELD_NUMBER = 3;
- private long threadId_;
- /**
- * <code>optional int64 thread_id = 3;</code>
- */
- public boolean hasThreadId() {
- return ((bitField0_ & 0x00000004) == 0x00000004);
- }
- /**
- * <code>optional int64 thread_id = 3;</code>
- */
- public long getThreadId() {
- return threadId_;
- }
-
- // optional bool is_shared = 4;
- public static final int IS_SHARED_FIELD_NUMBER = 4;
- private boolean isShared_;
- /**
- * <code>optional bool is_shared = 4;</code>
- */
- public boolean hasIsShared() {
- return ((bitField0_ & 0x00000008) == 0x00000008);
- }
- /**
- * <code>optional bool is_shared = 4;</code>
- */
- public boolean getIsShared() {
- return isShared_;
- }
-
- // optional string purpose = 5;
- public static final int PURPOSE_FIELD_NUMBER = 5;
- private java.lang.Object purpose_;
- /**
- * <code>optional string purpose = 5;</code>
- */
- public boolean hasPurpose() {
- return ((bitField0_ & 0x00000010) == 0x00000010);
- }
- /**
- * <code>optional string purpose = 5;</code>
- */
- public java.lang.String getPurpose() {
- java.lang.Object ref = purpose_;
- if (ref instanceof java.lang.String) {
- return (java.lang.String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- if (bs.isValidUtf8()) {
- purpose_ = s;
- }
- return s;
- }
- }
- /**
- * <code>optional string purpose = 5;</code>
- */
- public com.google.protobuf.ByteString
- getPurposeBytes() {
- java.lang.Object ref = purpose_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- purpose_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- // optional int64 create_time = 6;
- public static final int CREATE_TIME_FIELD_NUMBER = 6;
- private long createTime_;
- /**
- * <code>optional int64 create_time = 6;</code>
- */
- public boolean hasCreateTime() {
- return ((bitField0_ & 0x00000020) == 0x00000020);
- }
- /**
- * <code>optional int64 create_time = 6;</code>
- */
- public long getCreateTime() {
- return createTime_;
- }
-
- private void initFields() {
- tableName_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.getDefaultInstance();
- lockOwner_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.getDefaultInstance();
- threadId_ = 0L;
- isShared_ = false;
- purpose_ = "";
- createTime_ = 0L;
- }
- private byte memoizedIsInitialized = -1;
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized != -1) return isInitialized == 1;
-
- if (hasTableName()) {
- if (!getTableName().isInitialized()) {
- memoizedIsInitialized = 0;
- return false;
- }
- }
- if (hasLockOwner()) {
- if (!getLockOwner().isInitialized()) {
- 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.writeMessage(1, tableName_);
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- output.writeMessage(2, lockOwner_);
- }
- if (((bitField0_ & 0x00000004) == 0x00000004)) {
- output.writeInt64(3, threadId_);
- }
- if (((bitField0_ & 0x00000008) == 0x00000008)) {
- output.writeBool(4, isShared_);
- }
- if (((bitField0_ & 0x00000010) == 0x00000010)) {
- output.writeBytes(5, getPurposeBytes());
- }
- if (((bitField0_ & 0x00000020) == 0x00000020)) {
- output.writeInt64(6, createTime_);
- }
- 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
- .computeMessageSize(1, tableName_);
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(2, lockOwner_);
- }
- if (((bitField0_ & 0x00000004) == 0x00000004)) {
- size += com.google.protobuf.CodedOutputStream
- .computeInt64Size(3, threadId_);
- }
- if (((bitField0_ & 0x00000008) == 0x00000008)) {
- size += com.google.protobuf.CodedOutputStream
- .computeBoolSize(4, isShared_);
- }
- if (((bitField0_ & 0x00000010) == 0x00000010)) {
- size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(5, getPurposeBytes());
- }
- if (((bitField0_ & 0x00000020) == 0x00000020)) {
- size += com.google.protobuf.CodedOutputStream
- .computeInt64Size(6, createTime_);
- }
- 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.ZooKeeperProtos.TableLock)) {
- return super.equals(obj);
- }
- org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock other = (org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock) obj;
-
- boolean result = true;
- result = result && (hasTableName() == other.hasTableName());
- if (hasTableName()) {
- result = result && getTableName()
- .equals(other.getTableName());
- }
- result = result && (hasLockOwner() == other.hasLockOwner());
- if (hasLockOwner()) {
- result = result && getLockOwner()
- .equals(other.getLockOwner());
- }
- result = result && (hasThreadId() == other.hasThreadId());
- if (hasThreadId()) {
- result = result && (getThreadId()
- == other.getThreadId());
- }
- result = result && (hasIsShared() == other.hasIsShared());
- if (hasIsShared()) {
- result = result && (getIsShared()
- == other.getIsShared());
- }
- result = result && (hasPurpose() == other.hasPurpose());
- if (hasPurpose()) {
- result = result && getPurpose()
- .equals(other.getPurpose());
- }
- result = result && (hasCreateTime() == other.hasCreateTime());
- if (hasCreateTime()) {
- result = result && (getCreateTime()
- == other.getCreateTime());
- }
- 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 (hasTableName()) {
- hash = (37 * hash) + TABLE_NAME_FIELD_NUMBER;
- hash = (53 * hash) + getTableName().hashCode();
- }
- if (hasLockOwner()) {
- hash = (37 * hash) + LOCK_OWNER_FIELD_NUMBER;
- hash = (53 * hash) + getLockOwner().hashCode();
- }
- if (hasThreadId()) {
- hash = (37 * hash) + THREAD_ID_FIELD_NUMBER;
- hash = (53 * hash) + hashLong(getThreadId());
- }
- if (hasIsShared()) {
- hash = (37 * hash) + IS_SHARED_FIELD_NUMBER;
- hash = (53 * hash) + hashBoolean(getIsShared());
- }
- if (hasPurpose()) {
- hash = (37 * hash) + PURPOSE_FIELD_NUMBER;
- hash = (53 * hash) + getPurpose().hashCode();
- }
- if (hasCreateTime()) {
- hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER;
- hash = (53 * hash) + hashLong(getCreateTime());
- }
- hash = (29 * hash) + getUnknownFields().hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock 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.ZooKeeperProtos.TableLock parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock 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.ZooKeeperProtos.TableLock parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return PARSER.parseFrom(input);
- }
- public static org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock 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.ZooKeeperProtos.TableLock parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return PARSER.parseDelimitedFrom(input);
- }
- public static org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock 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.ZooKeeperProtos.TableLock parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return PARSER.parseFrom(input);
- }
- public static org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock 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.ZooKeeperProtos.TableLock 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.TableLock}
- *
- * <pre>
- **
- * Metadata associated with a table lock in zookeeper
- * </pre>
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessage.Builder<Builder>
- implements org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLockOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.internal_static_hbase_pb_TableLock_descriptor;
- }
-
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.internal_static_hbase_pb_TableLock_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock.class, org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock.Builder.class);
- }
-
- // Construct using org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
- getTableNameFieldBuilder();
- getLockOwnerFieldBuilder();
- }
- }
- private static Builder create() {
- return new Builder();
- }
-
- public Builder clear() {
- super.clear();
- if (tableNameBuilder_ == null) {
- tableName_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.getDefaultInstance();
- } else {
- tableNameBuilder_.clear();
- }
- bitField0_ = (bitField0_ & ~0x00000001);
- if (lockOwnerBuilder_ == null) {
- lockOwner_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.getDefaultInstance();
- } else {
- lockOwnerBuilder_.clear();
- }
- bitField0_ = (bitField0_ & ~0x00000002);
- threadId_ = 0L;
- bitField0_ = (bitField0_ & ~0x00000004);
- isShared_ = false;
- bitField0_ = (bitField0_ & ~0x00000008);
- purpose_ = "";
- bitField0_ = (bitField0_ & ~0x00000010);
- createTime_ = 0L;
- bitField0_ = (bitField0_ & ~0x00000020);
- return this;
- }
-
- public Builder clone() {
- return create().mergeFrom(buildPartial());
- }
-
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.internal_static_hbase_pb_TableLock_descriptor;
- }
-
- public org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock getDefaultInstanceForType() {
- return org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock.getDefaultInstance();
- }
-
- public org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock build() {
- org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- public org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock buildPartial() {
- org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock result = new org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock(this);
- int from_bitField0_ = bitField0_;
- int to_bitField0_ = 0;
- if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
- to_bitField0_ |= 0x00000001;
- }
- if (tableNameBuilder_ == null) {
- result.tableName_ = tableName_;
- } else {
- result.tableName_ = tableNameBuilder_.build();
- }
- if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
- to_bitField0_ |= 0x00000002;
- }
- if (lockOwnerBuilder_ == null) {
- result.lockOwner_ = lockOwner_;
- } else {
- result.lockOwner_ = lockOwnerBuilder_.build();
- }
- if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
- to_bitField0_ |= 0x00000004;
- }
- result.threadId_ = threadId_;
- if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
- to_bitField0_ |= 0x00000008;
- }
- result.isShared_ = isShared_;
- if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
- to_bitField0_ |= 0x00000010;
- }
- result.purpose_ = purpose_;
- if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
- to_bitField0_ |= 0x00000020;
- }
- result.createTime_ = createTime_;
- result.bitField0_ = to_bitField0_;
- onBuilt();
- return result;
- }
-
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock) {
- return mergeFrom((org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock other) {
- if (other == org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock.getDefaultInstance()) return this;
- if (other.hasTableName()) {
- mergeTableName(other.getTableName());
- }
- if (other.hasLockOwner()) {
- mergeLockOwner(other.getLockOwner());
- }
- if (other.hasThreadId()) {
- setThreadId(other.getThreadId());
- }
- if (other.hasIsShared()) {
- setIsShared(other.getIsShared());
- }
- if (other.hasPurpose()) {
- bitField0_ |= 0x00000010;
- purpose_ = other.purpose_;
- onChanged();
- }
- if (other.hasCreateTime()) {
- setCreateTime(other.getCreateTime());
- }
- this.mergeUnknownFields(other.getUnknownFields());
- return this;
- }
-
- public final boolean isInitialized() {
- if (hasTableName()) {
- if (!getTableName().isInitialized()) {
-
- return false;
- }
- }
- if (hasLockOwner()) {
- if (!getLockOwner().isInitialized()) {
-
- 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.ZooKeeperProtos.TableLock parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.TableLock) e.getUnfinishedMessage();
- throw e;
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
- private int bitField0_;
-
- // optional .hbase.pb.TableName table_name = 1;
- private org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName tableName_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.getDefaultInstance();
- private com.google.protobuf.SingleFieldBuilder<
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableNameOrBuilder> tableNameBuilder_;
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- public boolean hasTableName() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName getTableName() {
- if (tableNameBuilder_ == null) {
- return tableName_;
- } else {
- return tableNameBuilder_.getMessage();
- }
- }
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- public Builder setTableName(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName value) {
- if (tableNameBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- tableName_ = value;
- onChanged();
- } else {
- tableNameBuilder_.setMessage(value);
- }
- bitField0_ |= 0x00000001;
- return this;
- }
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- public Builder setTableName(
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.Builder builderForValue) {
- if (tableNameBuilder_ == null) {
- tableName_ = builderForValue.build();
- onChanged();
- } else {
- tableNameBuilder_.setMessage(builderForValue.build());
- }
- bitField0_ |= 0x00000001;
- return this;
- }
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- public Builder mergeTableName(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName value) {
- if (tableNameBuilder_ == null) {
- if (((bitField0_ & 0x00000001) == 0x00000001) &&
- tableName_ != org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.getDefaultInstance()) {
- tableName_ =
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.newBuilder(tableName_).mergeFrom(value).buildPartial();
- } else {
- tableName_ = value;
- }
- onChanged();
- } else {
- tableNameBuilder_.mergeFrom(value);
- }
- bitField0_ |= 0x00000001;
- return this;
- }
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- public Builder clearTableName() {
- if (tableNameBuilder_ == null) {
- tableName_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.getDefaultInstance();
- onChanged();
- } else {
- tableNameBuilder_.clear();
- }
- bitField0_ = (bitField0_ & ~0x00000001);
- return this;
- }
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.Builder getTableNameBuilder() {
- bitField0_ |= 0x00000001;
- onChanged();
- return getTableNameFieldBuilder().getBuilder();
- }
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableNameOrBuilder getTableNameOrBuilder() {
- if (tableNameBuilder_ != null) {
- return tableNameBuilder_.getMessageOrBuilder();
- } else {
- return tableName_;
- }
- }
- /**
- * <code>optional .hbase.pb.TableName table_name = 1;</code>
- */
- private com.google.protobuf.SingleFieldBuilder<
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableNameOrBuilder>
- getTableNameFieldBuilder() {
- if (tableNameBuilder_ == null) {
- tableNameBuilder_ = new com.google.protobuf.SingleFieldBuilder<
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableName.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableNameOrBuilder>(
- tableName_,
- getParentForChildren(),
- isClean());
- tableName_ = null;
- }
- return tableNameBuilder_;
- }
-
- // optional .hbase.pb.ServerName lock_owner = 2;
- private org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName lockOwner_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.getDefaultInstance();
- private com.google.protobuf.SingleFieldBuilder<
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerNameOrBuilder> lockOwnerBuilder_;
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- public boolean hasLockOwner() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName getLockOwner() {
- if (lockOwnerBuilder_ == null) {
- return lockOwner_;
- } else {
- return lockOwnerBuilder_.getMessage();
- }
- }
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- public Builder setLockOwner(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName value) {
- if (lockOwnerBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- lockOwner_ = value;
- onChanged();
- } else {
- lockOwnerBuilder_.setMessage(value);
- }
- bitField0_ |= 0x00000002;
- return this;
- }
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- public Builder setLockOwner(
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.Builder builderForValue) {
- if (lockOwnerBuilder_ == null) {
- lockOwner_ = builderForValue.build();
- onChanged();
- } else {
- lockOwnerBuilder_.setMessage(builderForValue.build());
- }
- bitField0_ |= 0x00000002;
- return this;
- }
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- public Builder mergeLockOwner(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName value) {
- if (lockOwnerBuilder_ == null) {
- if (((bitField0_ & 0x00000002) == 0x00000002) &&
- lockOwner_ != org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.getDefaultInstance()) {
- lockOwner_ =
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.newBuilder(lockOwner_).mergeFrom(value).buildPartial();
- } else {
- lockOwner_ = value;
- }
- onChanged();
- } else {
- lockOwnerBuilder_.mergeFrom(value);
- }
- bitField0_ |= 0x00000002;
- return this;
- }
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- public Builder clearLockOwner() {
- if (lockOwnerBuilder_ == null) {
- lockOwner_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.getDefaultInstance();
- onChanged();
- } else {
- lockOwnerBuilder_.clear();
- }
- bitField0_ = (bitField0_ & ~0x00000002);
- return this;
- }
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.Builder getLockOwnerBuilder() {
- bitField0_ |= 0x00000002;
- onChanged();
- return getLockOwnerFieldBuilder().getBuilder();
- }
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerNameOrBuilder getLockOwnerOrBuilder() {
- if (lockOwnerBuilder_ != null) {
- return lockOwnerBuilder_.getMessageOrBuilder();
- } else {
- return lockOwner_;
- }
- }
- /**
- * <code>optional .hbase.pb.ServerName lock_owner = 2;</code>
- */
- private com.google.protobuf.SingleFieldBuilder<
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerNameOrBuilder>
- getLockOwnerFieldBuilder() {
- if (lockOwnerBuilder_ == null) {
- lockOwnerBuilder_ = new com.google.protobuf.SingleFieldBuilder<
- org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerNameOrBuilder>(
- lockOwner_,
- getParentForChildren(),
- isClean());
- lockOwner_ = null;
- }
- return lockOwnerBuilder_;
- }
-
- // optional int64 thread_id = 3;
- private long threadId_ ;
- /**
- * <code>optional int64 thread_id = 3;</code>
- */
- public boolean hasThreadId() {
- return ((bitField0_ & 0x00000004) == 0x00000004);
- }
- /**
- * <code>optional int64 thread_id = 3;</code>
- */
- public long getThreadId() {
- return threadId_;
- }
- /**
- * <code>optional int64 thread_id = 3;</code>
- */
- public Builder setThreadId(long value) {
- bitField0_ |= 0x00000004;
- threadId_ = value;
- onChanged();
- return this;
- }
- /**
- * <code>optional int64 thread_id = 3;</code>
- */
- public Builder clearThreadId() {
- bitField0_ = (bitField0_ & ~0x00000004);
- threadId_ = 0L;
- onChanged();
- return this;
- }
-
- // optional bool is_shared = 4;
- private boolean isShared_ ;
- /**
- * <code>optional bool is_shared = 4;</code>
- */
- public boolean hasIsShared() {
- return ((bitField0_ & 0x00000008) == 0x00000008);
- }
- /**
- * <code>optional bool is_shared = 4;</code>
- */
- public boolean getIsShared() {
- return isShared_;
- }
- /**
- * <code>optional bool is_shared = 4;</code>
- */
- public Builder setIsShared(boolean value) {
- bitField0_ |= 0x00000008;
- isShared_ = value;
- onChanged();
- return this;
- }
- /**
- * <code>optional bool is_shared = 4;</code>
- */
- public Builder clearIsShared() {
- bitField0_ = (bitField0_ & ~0x00000008);
- isShared_ = false;
- onChanged();
- return this;
- }
-
- // optional string purpose = 5;
- private java.lang.Object purpose_ = "";
- /**
- * <code>optional string purpose = 5;</code>
- */
- public boolean hasPurpose() {
- return ((bitField0_ & 0x00000010) == 0x00000010);
- }
- /**
- * <code>optional string purpose = 5;</code>
- */
- public java.lang.String getPurpose() {
- java.lang.Object ref = purpose_;
- if (!(ref instanceof java.lang.String)) {
- java.lang.String s = ((com.google.protobuf.ByteString) ref)
- .toStringUtf8();
- purpose_ = s;
- return s;
- } else {
- return (java.lang.String) ref;
- }
- }
- /**
- * <code>optional string purpose = 5;</code>
- */
- public com.google.protobuf.ByteString
- getPurposeBytes() {
- java.lang.Object ref = purpose_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- purpose_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
- /**
- * <code>optional string purpose = 5;</code>
- */
- public Builder setPurpose(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000010;
- purpose_ = value;
- onChanged();
- return this;
- }
- /**
- * <code>optional string purpose = 5;</code>
- */
- public Builder clearPurpose() {
- bitField0_ = (bitField0_ & ~0x00000010);
- purpose_ = getDefaultInstance().getPurpose();
- onChanged();
- return this;
- }
- /**
- * <code>optional string purpose = 5;</code>
- */
- public Builder setPurposeBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000010;
- purpose_ = value;
- onChanged();
- return this;
- }
-
- // optional int64 create_time = 6;
- private long createTime_ ;
- /**
- * <code>optional int64 create_time = 6;</code>
- */
- public boolean hasCreateTime() {
- return ((bitField0_ & 0x00000020) == 0x00000020);
- }
- /**
- * <code>optional int64 create_time = 6;</code>
- */
- public long getCreateTime() {
- return createTime_;
- }
- /**
- * <code>optional int64 create_time = 6;</code>
- */
- public Builder setCreateTime(long value) {
- bitField0_ |= 0x00000020;
- createTime_ = value;
- onChanged();
- return this;
- }
- /**
- * <code>optional int64 create_time = 6;</code>
- */
- public Builder clearCreateTime() {
- bitField0_ = (bitField0_ & ~0x00000020);
- createTime_ = 0L;
- onChanged();
- return this;
- }
-
- // @@protoc_insertion_point(builder_scope:hbase.pb.TableLock)
- }
-
- static {
- defaultInstance = new TableLock(true);
- defaultInstance.initFields();
- }
-
- // @@protoc_insertion_point(class_scope:hbase.pb.TableLock)
- }
-
public interface SwitchStateOrBuilder
extends com.google.protobuf.MessageOrBuilder {
@@ -9498,11 +8283,6 @@ public final class ZooKeeperProtos {
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_hbase_pb_ReplicationHLogPosition_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
- internal_static_hbase_pb_TableLock_descriptor;
- private static
- com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internal_static_hbase_pb_TableLock_fieldAccessorTable;
- private static com.google.protobuf.Descriptors.Descriptor
internal_static_hbase_pb_SwitchState_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
@@ -9546,14 +8326,9 @@ public final class ZooKeeperProtos {
"tate\022/\n\005state\030\001 \002(\0162 .hbase.pb.Replicati" +
"onState.State\"\"\n\005State\022\013\n\007ENABLED\020\000\022\014\n\010D" +
"ISABLED\020\001\"+\n\027ReplicationHLogPosition\022\020\n\010",
- "position\030\001 \002(\003\"\252\001\n\tTableLock\022\'\n\ntable_na" +
- "me\030\001 \001(\0132\023.hbase.pb.TableName\022(\n\nlock_ow" +
- "ner\030\002 \001(\0132\024.hbase.pb.ServerName\022\021\n\tthrea" +
- "d_id\030\003 \001(\003\022\021\n\tis_shared\030\004 \001(\010\022\017\n\007purpose" +
- "\030\005 \001(\t\022\023\n\013create_time\030\006 \001(\003\"\036\n\013SwitchSta" +
- "te\022\017\n\007enabled\030\001 \001(\010BE\n*org.apache.hadoop" +
- ".hbase.protobuf.generatedB\017ZooKeeperProt" +
- "osH\001\210\001\001\240\001\001"
+ "position\030\001 \002(\003\"\036\n\013SwitchState\022\017\n\007enabled" +
+ "\030\001 \001(\010BE\n*org.apache.hadoop.hbase.protob" +
+ "uf.generatedB\017ZooKeeperProtosH\001\210\001\001\240\001\001"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@@ -9614,14 +8389,8 @@ public final class ZooKeeperProtos {
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_hbase_pb_ReplicationHLogPosition_descriptor,
new java.lang.String[] { "Position", });
- internal_static_hbase_pb_TableLock_descriptor =
- getDescriptor().getMessageTypes().get(9);
- internal_static_hbase_pb_TableLock_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessage.FieldAccessorTable(
- internal_static_hbase_pb_TableLock_descriptor,
- new java.lang.String[] { "TableName", "LockOwner", "ThreadId", "IsShared", "Purpose", "CreateTime", });
internal_static_hbase_pb_SwitchState_descriptor =
- getDescriptor().getMessageTypes().get(10);
+ getDescriptor().getMessageTypes().get(9);
internal_static_hbase_pb_SwitchState_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_hbase_pb_SwitchState_descriptor,
http://git-wip-us.apache.org/repos/asf/hbase/blob/4fdd6ff9/hbase-protocol/src/main/protobuf/ZooKeeper.proto
----------------------------------------------------------------------
diff --git a/hbase-protocol/src/main/protobuf/ZooKeeper.proto b/hbase-protocol/src/main/protobuf/ZooKeeper.proto
index 6f13e4a..ee73c84 100644
--- a/hbase-protocol/src/main/protobuf/ZooKeeper.proto
+++ b/hbase-protocol/src/main/protobuf/ZooKeeper.proto
@@ -144,18 +144,6 @@ message ReplicationHLogPosition {
}
/**
- * Metadata associated with a table lock in zookeeper
- */
-message TableLock {
- optional TableName table_name = 1;
- optional ServerName lock_owner = 2;
- optional int64 thread_id = 3;
- optional bool is_shared = 4;
- optional string purpose = 5;
- optional int64 create_time = 6;
-}
-
-/**
* State of the switch.
*/
message SwitchState {
http://git-wip-us.apache.org/repos/asf/hbase/blob/4fdd6ff9/hbase-server/src/main/java/org/apache/hadoop/hbase/InterProcessLock.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/InterProcessLock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/InterProcessLock.java
deleted file mode 100644
index d1216f1..0000000
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/InterProcessLock.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * Copyright The Apache Software Foundation
- *
- * 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;
-
-import java.io.IOException;
-
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-
-/**
- * An interface for an application-specific lock.
- */
-@InterfaceAudience.Private
-public interface InterProcessLock {
-
- /**
- * Acquire the lock, waiting indefinitely until the lock is released or
- * the thread is interrupted.
- * @throws IOException If there is an unrecoverable error releasing the lock
- * @throws InterruptedException If current thread is interrupted while
- * waiting for the lock
- */
- void acquire() throws IOException, InterruptedException;
-
- /**
- * Acquire the lock within a wait time.
- * @param timeoutMs The maximum time (in milliseconds) to wait for the lock,
- * -1 to wait indefinitely
- * @return True if the lock was acquired, false if waiting time elapsed
- * before the lock was acquired
- * @throws IOException If there is an unrecoverable error talking talking
- * (e.g., when talking to a lock service) when acquiring
- * the lock
- * @throws InterruptedException If the thread is interrupted while waiting to
- * acquire the lock
- */
- boolean tryAcquire(long timeoutMs)
- throws IOException, InterruptedException;
-
- /**
- * Release the lock.
- * @throws IOException If there is an unrecoverable error releasing the lock
- * @throws InterruptedException If the thread is interrupted while releasing
- * the lock
- */
- void release() throws IOException, InterruptedException;
-
- /**
- * If supported, attempts to reap all the locks of this type by forcefully
- * deleting the locks (both held and attempted) that have expired according
- * to the given timeout. Lock reaping is different than coordinated lock revocation
- * in that, there is no coordination, and the behavior is undefined if the
- * lock holder is still alive.
- * @throws IOException If there is an unrecoverable error reaping the locks
- */
- void reapExpiredLocks(long expireTimeoutMs) throws IOException;
-
- /**
- * If supported, attempts to reap all the locks of this type by forcefully
- * deleting the locks (both held and attempted). Lock reaping is different
- * than coordinated lock revocation in that, there is no coordination, and
- * the behavior is undefined if the lock holder is still alive.
- * Calling this should have the same affect as calling {@link #reapExpiredLocks(long)}
- * with timeout=0.
- * @throws IOException If there is an unrecoverable error reaping the locks
- */
- void reapAllLocks() throws IOException;
-
- /**
- * An interface for objects that process lock metadata.
- */
- interface MetadataHandler {
-
- /**
- * Called after lock metadata is successfully read from a distributed
- * lock service. This method may contain any procedures for, e.g.,
- * printing the metadata in a humanly-readable format.
- * @param metadata The metadata
- */
- void handleMetadata(byte[] metadata);
- }
-
- /**
- * Visits the locks (both held and attempted) of this type with the given
- * {@link MetadataHandler}.
- * @throws IOException If there is an unrecoverable error
- */
- void visitLocks(MetadataHandler handler) throws IOException;
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/4fdd6ff9/hbase-server/src/main/java/org/apache/hadoop/hbase/InterProcessReadWriteLock.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/InterProcessReadWriteLock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/InterProcessReadWriteLock.java
deleted file mode 100644
index 0f7ddbe..0000000
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/InterProcessReadWriteLock.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright The Apache Software Foundation
- *
- * 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;
-
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-
-/**
- * An interface for a distributed reader-writer lock.
- */
-@InterfaceAudience.Private
-public interface InterProcessReadWriteLock {
-
- /**
- * Obtain a read lock containing given metadata.
- * @param metadata Serialized lock metadata (this may contain information
- * such as the process owning the lock or the purpose for
- * which the lock was acquired).
- * @return An instantiated InterProcessLock instance
- */
- InterProcessLock readLock(byte[] metadata);
-
- /**
- * Obtain a write lock containing given metadata.
- * @param metadata Serialized lock metadata (this may contain information
- * such as the process owning the lock or the purpose for
- * which the lock was acquired).
- * @return An instantiated InterProcessLock instance
- */
- InterProcessLock writeLock(byte[] metadata);
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/4fdd6ff9/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessLockBase.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessLockBase.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessLockBase.java
deleted file mode 100644
index 090acf7..0000000
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessLockBase.java
+++ /dev/null
@@ -1,459 +0,0 @@
-/**
- * Copyright The Apache Software Foundation
- *
- * 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.lock;
-
-import java.io.IOException;
-import java.util.Comparator;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-import org.apache.hadoop.hbase.InterProcessLock;
-import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
-import org.apache.hadoop.hbase.zookeeper.DeletionListener;
-import org.apache.hadoop.hbase.zookeeper.ZKUtil;
-import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.KeeperException.BadVersionException;
-import org.apache.zookeeper.data.Stat;
-
-import com.google.common.base.Preconditions;
-
-/**
- * ZooKeeper based HLock implementation. Based on the Shared Locks recipe.
- * (see:
- * <a href="http://zookeeper.apache.org/doc/trunk/recipes.html">
- * ZooKeeper Recipes and Solutions
- * </a>)
- */
-@InterfaceAudience.Private
-public abstract class ZKInterProcessLockBase implements InterProcessLock {
-
- private static final Log LOG = LogFactory.getLog(ZKInterProcessLockBase.class);
-
- /** ZNode prefix used by processes acquiring reader locks */
- protected static final String READ_LOCK_CHILD_NODE_PREFIX = "read-";
-
- /** ZNode prefix used by processes acquiring writer locks */
- protected static final String WRITE_LOCK_CHILD_NODE_PREFIX = "write-";
-
- protected final ZooKeeperWatcher zkWatcher;
- protected final String parentLockNode;
- protected final String fullyQualifiedZNode;
- protected final String childZNode;
- protected final byte[] metadata;
- protected final MetadataHandler handler;
-
- // If we acquire a lock, update this field
- protected final AtomicReference<AcquiredLock> acquiredLock =
- new AtomicReference<AcquiredLock>(null);
-
- /**
- * Represents information about a lock held by this thread.
- */
- protected static class AcquiredLock {
- private final String path;
- private final int version;
-
- /**
- * Store information about a lock.
- * @param path The path to a lock's ZNode
- * @param version The current version of the lock's ZNode
- */
- public AcquiredLock(String path, int version) {
- this.path = path;
- this.version = version;
- }
-
- public String getPath() {
- return path;
- }
-
- public int getVersion() {
- return version;
- }
-
- @Override
- public String toString() {
- return "AcquiredLockInfo{" +
- "path='" + path + '\'' +
- ", version=" + version +
- '}';
- }
- }
-
- protected static class ZNodeComparator implements Comparator<String> {
-
- public static final ZNodeComparator COMPARATOR = new ZNodeComparator();
-
- private ZNodeComparator() {
- }
-
- /** Parses sequenceId from the znode name. ZooKeeper documentation
- * states: The sequence number is always fixed length of 10 digits, 0 padded
- */
- public static long getChildSequenceId(String childZNode) {
- Preconditions.checkNotNull(childZNode);
- assert childZNode.length() >= 10;
- String sequenceIdStr = childZNode.substring(childZNode.length() - 10);
- return Long.parseLong(sequenceIdStr);
- }
-
- @Override
- public int compare(String zNode1, String zNode2) {
- long seq1 = getChildSequenceId(zNode1);
- long seq2 = getChildSequenceId(zNode2);
- if (seq1 == seq2) {
- return 0;
- } else {
- return seq1 < seq2 ? -1 : 1;
- }
- }
- }
-
- /**
- * Called by implementing classes.
- * @param zkWatcher
- * @param parentLockNode The lock ZNode path
- * @param metadata
- * @param handler
- * @param childNode The prefix for child nodes created under the parent
- */
- protected ZKInterProcessLockBase(ZooKeeperWatcher zkWatcher,
- String parentLockNode, byte[] metadata, MetadataHandler handler, String childNode) {
- this.zkWatcher = zkWatcher;
- this.parentLockNode = parentLockNode;
- this.fullyQualifiedZNode = ZKUtil.joinZNode(parentLockNode, childNode);
- this.metadata = metadata;
- this.handler = handler;
- this.childZNode = childNode;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void acquire() throws IOException, InterruptedException {
- tryAcquire(-1);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean tryAcquire(long timeoutMs)
- throws IOException, InterruptedException {
- boolean hasTimeout = timeoutMs != -1;
- long waitUntilMs =
- hasTimeout ?EnvironmentEdgeManager.currentTime() + timeoutMs : -1;
- String createdZNode;
- try {
- createdZNode = createLockZNode();
- } catch (KeeperException ex) {
- throw new IOException("Failed to create znode: " + fullyQualifiedZNode, ex);
- }
- while (true) {
- List<String> children;
- try {
- children = ZKUtil.listChildrenNoWatch(zkWatcher, parentLockNode);
- } catch (KeeperException e) {
- LOG.error("Unexpected ZooKeeper error when listing children", e);
- throw new IOException("Unexpected ZooKeeper exception", e);
- }
- String pathToWatch;
- if ((pathToWatch = getLockPath(createdZNode, children)) == null) {
- break;
- }
- CountDownLatch deletedLatch = new CountDownLatch(1);
- String zkPathToWatch =
- ZKUtil.joinZNode(parentLockNode, pathToWatch);
- DeletionListener deletionListener =
- new DeletionListener(zkWatcher, zkPathToWatch, deletedLatch);
- zkWatcher.registerListener(deletionListener);
- try {
- if (ZKUtil.setWatchIfNodeExists(zkWatcher, zkPathToWatch)) {
- // Wait for the watcher to fire
- if (hasTimeout) {
- long remainingMs = waitUntilMs - EnvironmentEdgeManager.currentTime();
- if (remainingMs < 0 ||
- !deletedLatch.await(remainingMs, TimeUnit.MILLISECONDS)) {
- LOG.warn("Unable to acquire the lock in " + timeoutMs +
- " milliseconds.");
- try {
- ZKUtil.deleteNode(zkWatcher, createdZNode);
- } catch (KeeperException e) {
- LOG.warn("Unable to remove ZNode " + createdZNode);
- }
- return false;
- }
- } else {
- deletedLatch.await();
- }
- if (deletionListener.hasException()) {
- Throwable t = deletionListener.getException();
- throw new IOException("Exception in the watcher", t);
- }
- }
- } catch (KeeperException e) {
- throw new IOException("Unexpected ZooKeeper exception", e);
- } finally {
- zkWatcher.unregisterListener(deletionListener);
- }
- }
- updateAcquiredLock(createdZNode);
- LOG.debug("Acquired a lock for " + createdZNode);
- return true;
- }
-
- private String createLockZNode() throws KeeperException {
- try {
- return ZKUtil.createNodeIfNotExistsNoWatch(zkWatcher, fullyQualifiedZNode,
- metadata, CreateMode.EPHEMERAL_SEQUENTIAL);
- } catch (KeeperException.NoNodeException nne) {
- //create parents, retry
- ZKUtil.createWithParents(zkWatcher, parentLockNode);
- return createLockZNode();
- }
- }
-
- /**
- * Check if a child znode represents a read lock.
- * @param child The child znode we want to check.
- * @return whether the child znode represents a read lock
- */
- protected static boolean isChildReadLock(String child) {
- int idx = child.lastIndexOf(ZKUtil.ZNODE_PATH_SEPARATOR);
- String suffix = child.substring(idx + 1);
- return suffix.startsWith(READ_LOCK_CHILD_NODE_PREFIX);
- }
-
- /**
- * Check if a child znode represents a write lock.
- * @param child The child znode we want to check.
- * @return whether the child znode represents a write lock
- */
- protected static boolean isChildWriteLock(String child) {
- int idx = child.lastIndexOf(ZKUtil.ZNODE_PATH_SEPARATOR);
- String suffix = child.substring(idx + 1);
- return suffix.startsWith(WRITE_LOCK_CHILD_NODE_PREFIX);
- }
-
- /**
- * Check if a child znode represents the same type(read or write) of lock
- * @param child The child znode we want to check.
- * @return whether the child znode represents the same type(read or write) of lock
- */
- protected boolean isChildOfSameType(String child) {
- int idx = child.lastIndexOf(ZKUtil.ZNODE_PATH_SEPARATOR);
- String suffix = child.substring(idx + 1);
- return suffix.startsWith(this.childZNode);
- }
-
- /**
- * Update state as to indicate that a lock is held
- * @param createdZNode The lock znode
- * @throws IOException If an unrecoverable ZooKeeper error occurs
- */
- protected void updateAcquiredLock(String createdZNode) throws IOException {
- Stat stat = new Stat();
- byte[] data = null;
- Exception ex = null;
- try {
- data = ZKUtil.getDataNoWatch(zkWatcher, createdZNode, stat);
- } catch (KeeperException e) {
- LOG.warn("Cannot getData for znode:" + createdZNode, e);
- ex = e;
- }
- if (data == null) {
- LOG.error("Can't acquire a lock on a non-existent node " + createdZNode);
- throw new IllegalStateException("ZNode " + createdZNode +
- "no longer exists!", ex);
- }
- AcquiredLock newLock = new AcquiredLock(createdZNode, stat.getVersion());
- if (!acquiredLock.compareAndSet(null, newLock)) {
- LOG.error("The lock " + fullyQualifiedZNode +
- " has already been acquired by another process!");
- throw new IllegalStateException(fullyQualifiedZNode +
- " is held by another process");
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void release() throws IOException, InterruptedException {
- AcquiredLock lock = acquiredLock.get();
- if (lock == null) {
- LOG.error("Cannot release lock" +
- ", process does not have a lock for " + fullyQualifiedZNode);
- throw new IllegalStateException("No lock held for " + fullyQualifiedZNode);
- }
- try {
- if (ZKUtil.checkExists(zkWatcher, lock.getPath()) != -1) {
- boolean ret = ZKUtil.deleteNode(zkWatcher, lock.getPath(), lock.getVersion());
- if (!ret && ZKUtil.checkExists(zkWatcher, lock.getPath()) != -1) {
- throw new IllegalStateException("Couldn't delete " + lock.getPath());
- }
- if (!acquiredLock.compareAndSet(lock, null)) {
- LOG.debug("Current process no longer holds " + lock + " for " +
- fullyQualifiedZNode);
- throw new IllegalStateException("Not holding a lock for " +
- fullyQualifiedZNode +"!");
- }
- }
- if (LOG.isDebugEnabled()) {
- LOG.debug("Released " + lock.getPath());
- }
- } catch (BadVersionException e) {
- throw new IllegalStateException(e);
- } catch (KeeperException e) {
- throw new IOException(e);
- }
- }
-
- /**
- * Process metadata stored in a ZNode using a callback
- * <p>
- * @param lockZNode The node holding the metadata
- * @return True if metadata was ready and processed, false otherwise.
- */
- protected boolean handleLockMetadata(String lockZNode) {
- return handleLockMetadata(lockZNode, handler);
- }
-
- /**
- * Process metadata stored in a ZNode using a callback object passed to
- * this instance.
- * <p>
- * @param lockZNode The node holding the metadata
- * @param handler the metadata handler
- * @return True if metadata was ready and processed, false on exception.
- */
- protected boolean handleLockMetadata(String lockZNode, MetadataHandler handler) {
- if (handler == null) {
- return false;
- }
- try {
- byte[] metadata = ZKUtil.getData(zkWatcher, lockZNode);
- handler.handleMetadata(metadata);
- } catch (KeeperException ex) {
- LOG.warn("Error processing lock metadata in " + lockZNode);
- return false;
- } catch (InterruptedException e) {
- LOG.warn("InterruptedException processing lock metadata in " + lockZNode);
- Thread.currentThread().interrupt();
- return false;
- }
- return true;
- }
-
- @Override
- public void reapAllLocks() throws IOException {
- reapExpiredLocks(0);
- }
-
- /**
- * Will delete all lock znodes of this type (either read or write) which are "expired"
- * according to timeout. Assumption is that the clock skew between zookeeper and this servers
- * is negligible.
- * Referred in zk recipe as "Revocable Shared Locks with Freaking Laser Beams".
- * (http://zookeeper.apache.org/doc/trunk/recipes.html).
- */
- public void reapExpiredLocks(long timeout) throws IOException {
- List<String> children;
- try {
- children = ZKUtil.listChildrenNoWatch(zkWatcher, parentLockNode);
- } catch (KeeperException e) {
- LOG.error("Unexpected ZooKeeper error when listing children", e);
- throw new IOException("Unexpected ZooKeeper exception", e);
- }
- if (children == null) return;
-
- KeeperException deferred = null;
- Stat stat = new Stat();
- long expireDate = System.currentTimeMillis() - timeout; //we are using cTime in zookeeper
- for (String child : children) {
- if (isChildOfSameType(child)) {
- String znode = ZKUtil.joinZNode(parentLockNode, child);
- try {
- ZKUtil.getDataNoWatch(zkWatcher, znode, stat);
- if (stat.getCtime() < expireDate) {
- LOG.info("Reaping lock for znode:" + znode);
- ZKUtil.deleteNodeFailSilent(zkWatcher, znode);
- }
- } catch (KeeperException ex) {
- LOG.warn("Error reaping the znode for write lock :" + znode);
- deferred = ex;
- }
- }
- }
- if (deferred != null) {
- throw new IOException("ZK exception while reaping locks:", deferred);
- }
- }
-
- /**
- * Visits the locks (both held and attempted) with the given MetadataHandler.
- * @throws IOException If there is an unrecoverable error
- */
- public void visitLocks(MetadataHandler handler) throws IOException {
- List<String> children;
- try {
- children = ZKUtil.listChildrenNoWatch(zkWatcher, parentLockNode);
- } catch (KeeperException e) {
- LOG.error("Unexpected ZooKeeper error when listing children", e);
- throw new IOException("Unexpected ZooKeeper exception", e);
- }
- if (children != null && children.size() > 0) {
- for (String child : children) {
- if (isChildOfSameType(child)) {
- String znode = ZKUtil.joinZNode(parentLockNode, child);
- String childWatchesZNode = getLockPath(child, children);
- if (childWatchesZNode == null) {
- LOG.info("Lock is held by: " + child);
- }
- handleLockMetadata(znode, handler);
- }
- }
- }
- }
-
- /**
- * Determine based on a list of children under a ZNode, whether or not a
- * process which created a specified ZNode has obtained a lock. If a lock is
- * not obtained, return the path that we should watch awaiting its deletion.
- * Otherwise, return null.
- * This method is abstract as the logic for determining whether or not a
- * lock is obtained depends on the type of lock being implemented.
- * @param myZNode The ZNode created by the process attempting to acquire
- * a lock
- * @param children List of all child ZNodes under the lock's parent ZNode
- * @return The path to watch, or null if myZNode can represent a correctly
- * acquired lock.
- */
- protected abstract String getLockPath(String myZNode, List<String> children)
- throws IOException;
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/4fdd6ff9/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessReadLock.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessReadLock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessReadLock.java
deleted file mode 100644
index 8d20001..0000000
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessReadLock.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright The Apache Software Foundation
- *
- * 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.lock;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-import org.apache.hadoop.hbase.zookeeper.ZKUtil;
-import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
-
-/**
- * ZooKeeper based read lock: does not exclude other read locks, but excludes
- * and is excluded by write locks.
- */
-@InterfaceAudience.Private
-public class ZKInterProcessReadLock extends ZKInterProcessLockBase {
-
- private static final Log LOG = LogFactory.getLog(ZKInterProcessReadLock.class);
-
- public ZKInterProcessReadLock(ZooKeeperWatcher zooKeeperWatcher,
- String znode, byte[] metadata, MetadataHandler handler) {
- super(zooKeeperWatcher, znode, metadata, handler, READ_LOCK_CHILD_NODE_PREFIX);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getLockPath(String createdZNode, List<String> children) throws IOException {
- TreeSet<String> writeChildren =
- new TreeSet<String>(ZNodeComparator.COMPARATOR);
- for (String child : children) {
- if (isChildWriteLock(child)) {
- writeChildren.add(child);
- }
- }
- if (writeChildren.isEmpty()) {
- return null;
- }
- SortedSet<String> lowerChildren = writeChildren.headSet(createdZNode);
- if (lowerChildren.isEmpty()) {
- return null;
- }
- String pathToWatch = lowerChildren.last();
- String nodeHoldingLock = lowerChildren.first();
- String znode = ZKUtil.joinZNode(parentLockNode, nodeHoldingLock);
- handleLockMetadata(znode);
-
- return pathToWatch;
- }
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/4fdd6ff9/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessReadWriteLock.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessReadWriteLock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessReadWriteLock.java
deleted file mode 100644
index caa0f64..0000000
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessReadWriteLock.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Copyright The Apache Software Foundation
- *
- * 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.lock;
-
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-import org.apache.hadoop.hbase.InterProcessLock.MetadataHandler;
-import org.apache.hadoop.hbase.InterProcessReadWriteLock;
-import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
-
-/**
- * ZooKeeper based implementation of {@link InterProcessReadWriteLock}. This lock is fair,
- * not reentrant, and not revocable.
- */
-@InterfaceAudience.Private
-public class ZKInterProcessReadWriteLock implements InterProcessReadWriteLock {
-
- private final ZooKeeperWatcher zkWatcher;
- private final String znode;
- private final MetadataHandler handler;
-
- /**
- * Creates a DistributedReadWriteLock instance.
- * @param zkWatcher
- * @param znode ZNode path for the lock
- * @param handler An object that will handle de-serializing and processing
- * the metadata associated with reader or writer locks
- * created by this object or null if none desired.
- */
- public ZKInterProcessReadWriteLock(ZooKeeperWatcher zkWatcher, String znode,
- MetadataHandler handler) {
- this.zkWatcher = zkWatcher;
- this.znode = znode;
- this.handler = handler;
- }
-
- /**
- * {@inheritDoc}
- */
- public ZKInterProcessReadLock readLock(byte[] metadata) {
- return new ZKInterProcessReadLock(zkWatcher, znode, metadata, handler);
- }
-
- /**
- * {@inheritDoc}
- */
- public ZKInterProcessWriteLock writeLock(byte[] metadata) {
- return new ZKInterProcessWriteLock(zkWatcher, znode, metadata, handler);
- }
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/4fdd6ff9/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessWriteLock.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessWriteLock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessWriteLock.java
deleted file mode 100644
index 6663539..0000000
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/lock/ZKInterProcessWriteLock.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Copyright The Apache Software Foundation
- *
- * 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.lock;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.TreeSet;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-import org.apache.hadoop.hbase.zookeeper.ZKUtil;
-import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
-
-/**
- * ZooKeeper based write lock:
- */
-@InterfaceAudience.Private
-public class ZKInterProcessWriteLock extends ZKInterProcessLockBase {
-
- private static final Log LOG = LogFactory.getLog(ZKInterProcessWriteLock.class);
-
- public ZKInterProcessWriteLock(ZooKeeperWatcher zooKeeperWatcher,
- String znode, byte[] metadata, MetadataHandler handler) {
- super(zooKeeperWatcher, znode, metadata, handler, WRITE_LOCK_CHILD_NODE_PREFIX);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getLockPath(String createdZNode, List<String> children) throws IOException {
- TreeSet<String> sortedChildren =
- new TreeSet<String>(ZNodeComparator.COMPARATOR);
- sortedChildren.addAll(children);
- String pathToWatch = sortedChildren.lower(createdZNode);
- if (pathToWatch != null) {
- String nodeHoldingLock = sortedChildren.first();
- String znode = ZKUtil.joinZNode(parentLockNode, nodeHoldingLock);
- handleLockMetadata(znode);
- }
- return pathToWatch;
- }
-}