public void refreshUserAuthsCache(byte[] data) throws IOException { MultiUserAuthorizations multiUserAuths = null; try { multiUserAuths = VisibilityUtils.readUserAuthsFromZKData(data); } catch (DeserializationException dse) { throw new IOException(dse); } this.lock.writeLock().lock(); try { this.userAuths.clear(); this.groupAuths.clear(); for (UserAuthorizations userAuths : multiUserAuths.getUserAuthsList()) { String user = Bytes.toString(userAuths.getUser().toByteArray()); if (AuthUtil.isGroupPrincipal(user)) { this.groupAuths.put(AuthUtil.getGroupName(user), new HashSet<>(userAuths.getAuthList())); } else { this.userAuths.put(user, new HashSet<>(userAuths.getAuthList())); } } } finally { this.lock.writeLock().unlock(); } }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasUser()) { hash = (37 * hash) + USER_FIELD_NUMBER; hash = (53 * hash) + getUser().hashCode(); } if (getAuthCount() > 0) { hash = (37 * hash) + AUTH_FIELD_NUMBER; hash = (53 * hash) + getAuthList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations other) { if (other == org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations.getDefaultInstance()) return this; if (other.hasUser()) { setUser(other.getUser()); } if (!other.auth_.isEmpty()) { if (auth_.isEmpty()) { auth_ = other.auth_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureAuthIsMutable(); auth_.addAll(other.auth_); } onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public void refreshUserAuthsCache(byte[] data) throws IOException { MultiUserAuthorizations multiUserAuths = null; try { multiUserAuths = VisibilityUtils.readUserAuthsFromZKData(data); } catch (DeserializationException dse) { throw new IOException(dse); } this.lock.writeLock().lock(); try { this.userAuths.clear(); this.groupAuths.clear(); for (UserAuthorizations userAuths : multiUserAuths.getUserAuthsList()) { String user = Bytes.toString(userAuths.getUser().toByteArray()); if (AuthUtil.isGroupPrincipal(user)) { this.groupAuths.put(AuthUtil.getGroupName(user), new HashSet<Integer>(userAuths.getAuthList())); } else { this.userAuths.put(user, new HashSet<Integer>(userAuths.getAuthList())); } } } finally { this.lock.writeLock().unlock(); } }
@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.VisibilityLabelsProtos.UserAuthorizations)) { return super.equals(obj); } org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations other = (org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations) obj; boolean result = true; result = result && (hasUser() == other.hasUser()); if (hasUser()) { result = result && getUser() .equals(other.getUser()); } result = result && getAuthList() .equals(other.getAuthList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
@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.VisibilityLabelsProtos.UserAuthorizations)) { return super.equals(obj); } org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations other = (org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations) obj; boolean result = true; result = result && (hasUser() == other.hasUser()); if (hasUser()) { result = result && getUser() .equals(other.getUser()); } result = result && getAuthList() .equals(other.getAuthList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
@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.VisibilityLabelsProtos.UserAuthorizations)) { return super.equals(obj); } org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations other = (org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations) obj; boolean result = true; result = result && (hasUser() == other.hasUser()); if (hasUser()) { result = result && getUser() .equals(other.getUser()); } result = result && getAuthList() .equals(other.getAuthList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasUser()) { hash = (37 * hash) + USER_FIELD_NUMBER; hash = (53 * hash) + getUser().hashCode(); } if (getAuthCount() > 0) { hash = (37 * hash) + AUTH_FIELD_NUMBER; hash = (53 * hash) + getAuthList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations other) { if (other == org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations.getDefaultInstance()) return this; if (other.hasUser()) { setUser(other.getUser()); } if (!other.auth_.isEmpty()) { if (auth_.isEmpty()) { auth_ = other.auth_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureAuthIsMutable(); auth_.addAll(other.auth_); } onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasUser()) { hash = (37 * hash) + USER_FIELD_NUMBER; hash = (53 * hash) + getUser().hashCode(); } if (getAuthCount() > 0) { hash = (37 * hash) + AUTH_FIELD_NUMBER; hash = (53 * hash) + getAuthList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasUser()) { hash = (37 * hash) + USER_FIELD_NUMBER; hash = (53 * hash) + getUser().hashCode(); } if (getAuthCount() > 0) { hash = (37 * hash) + AUTH_FIELD_NUMBER; hash = (53 * hash) + getAuthList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations other) { if (other == org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations.getDefaultInstance()) return this; if (other.hasUser()) { setUser(other.getUser()); } if (!other.auth_.isEmpty()) { if (auth_.isEmpty()) { auth_ = other.auth_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureAuthIsMutable(); auth_.addAll(other.auth_); } onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations other) { if (other == org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations.getDefaultInstance()) return this; if (other.hasUser()) { setUser(other.getUser()); } if (!other.auth_.isEmpty()) { if (auth_.isEmpty()) { auth_ = other.auth_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureAuthIsMutable(); auth_.addAll(other.auth_); } onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * <code>required bytes user = 1;</code> */ public Builder clearUser() { bitField0_ = (bitField0_ & ~0x00000001); user_ = getDefaultInstance().getUser(); onChanged(); return this; }
/** * <code>required bytes user = 1;</code> */ public Builder clearUser() { bitField0_ = (bitField0_ & ~0x00000001); user_ = getDefaultInstance().getUser(); onChanged(); return this; }
/** * <code>required bytes user = 1;</code> */ public Builder clearUser() { bitField0_ = (bitField0_ & ~0x00000001); user_ = getDefaultInstance().getUser(); onChanged(); return this; }
@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.VisibilityLabelsProtos.UserAuthorizations)) { return super.equals(obj); } org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations other = (org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations) obj; boolean result = true; result = result && (hasUser() == other.hasUser()); if (hasUser()) { result = result && getUser() .equals(other.getUser()); } result = result && getAuthList() .equals(other.getAuthList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
/** * <code>required bytes user = 1;</code> */ public Builder clearUser() { bitField0_ = (bitField0_ & ~0x00000001); user_ = getDefaultInstance().getUser(); onChanged(); return this; }