Tabnine Logo
VisibilityLabelsProtos$UserAuthorizations
Code IndexAdd Tabnine to your IDE (free)

How to use
VisibilityLabelsProtos$UserAuthorizations
in
org.apache.hadoop.hbase.protobuf.generated

Best Java code snippets using org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos$UserAuthorizations (Showing top 20 results out of 315)

origin: apache/hbase

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();
 }
}
origin: apache/hbase

/**
 * Creates the user auth data to be written to zookeeper.
 * @param userAuths
 * @return Bytes form of user auths details to be written to zookeeper.
 */
public static byte[] getUserAuthsDataToWriteToZooKeeper(Map<String, List<Integer>> userAuths) {
 MultiUserAuthorizations.Builder builder = MultiUserAuthorizations.newBuilder();
 for (Entry<String, List<Integer>> entry : userAuths.entrySet()) {
  UserAuthorizations.Builder userAuthsBuilder = UserAuthorizations.newBuilder();
  userAuthsBuilder.setUser(ByteString.copyFrom(Bytes.toBytes(entry.getKey())));
  for (Integer label : entry.getValue()) {
   userAuthsBuilder.addAuth(label);
  }
  builder.addUserAuths(userAuthsBuilder.build());
 }
 return ProtobufUtil.prependPBMagic(builder.build().toByteArray());
}
origin: apache/hbase

public org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations buildPartial() {
 org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations result = new org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations(this);
 int from_bitField0_ = bitField0_;
 int to_bitField0_ = 0;
 if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  to_bitField0_ |= 0x00000001;
 }
 result.user_ = user_;
 if (((bitField0_ & 0x00000002) == 0x00000002)) {
  auth_ = java.util.Collections.unmodifiableList(auth_);
  bitField0_ = (bitField0_ & ~0x00000002);
 }
 result.auth_ = auth_;
 result.bitField0_ = to_bitField0_;
 onBuilt();
 return result;
}
origin: harbby/presto-connectors

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();
 }
}
origin: harbby/presto-connectors

public int getSerializedSize() {
 int size = memoizedSerializedSize;
 if (size != -1) return size;
 size = 0;
 if (((bitField0_ & 0x00000001) == 0x00000001)) {
  size += com.facebook.presto.hbase.$internal.com.google.protobuf.CodedOutputStream
   .computeBytesSize(1, user_);
 }
 {
  int dataSize = 0;
  for (int i = 0; i < auth_.size(); i++) {
   dataSize += com.facebook.presto.hbase.$internal.com.google.protobuf.CodedOutputStream
    .computeUInt32SizeNoTag(auth_.get(i));
  }
  size += dataSize;
  size += 1 * getAuthList().size();
 }
 size += getUnknownFields().getSerializedSize();
 memoizedSerializedSize = size;
 return size;
}
origin: com.aliyun.hbase/alihbase-protocol

public int getSerializedSize() {
 int size = memoizedSerializedSize;
 if (size != -1) return size;
 size = 0;
 if (((bitField0_ & 0x00000001) == 0x00000001)) {
  size += com.google.protobuf.CodedOutputStream
   .computeBytesSize(1, user_);
 }
 {
  int dataSize = 0;
  for (int i = 0; i < auth_.size(); i++) {
   dataSize += com.google.protobuf.CodedOutputStream
    .computeUInt32SizeNoTag(auth_.get(i));
  }
  size += dataSize;
  size += 1 * getAuthList().size();
 }
 size += getUnknownFields().getSerializedSize();
 memoizedSerializedSize = size;
 return size;
}
origin: harbby/presto-connectors

@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;
}
origin: org.apache.hbase/hbase-protocol

@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;
}
origin: org.apache.hbase/hbase-protocol

public int getSerializedSize() {
 int size = memoizedSerializedSize;
 if (size != -1) return size;
 size = 0;
 if (((bitField0_ & 0x00000001) == 0x00000001)) {
  size += com.google.protobuf.CodedOutputStream
   .computeBytesSize(1, user_);
 }
 {
  int dataSize = 0;
  for (int i = 0; i < auth_.size(); i++) {
   dataSize += com.google.protobuf.CodedOutputStream
    .computeUInt32SizeNoTag(auth_.get(i));
  }
  size += dataSize;
  size += 1 * getAuthList().size();
 }
 size += getUnknownFields().getSerializedSize();
 memoizedSerializedSize = size;
 return size;
}
origin: com.aliyun.hbase/alihbase-protocol

@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;
}
origin: harbby/presto-connectors

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;
}
origin: com.aliyun.hbase/alihbase-protocol

public org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations buildPartial() {
 org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations result = new org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations(this);
 int from_bitField0_ = bitField0_;
 int to_bitField0_ = 0;
 if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  to_bitField0_ |= 0x00000001;
 }
 result.user_ = user_;
 if (((bitField0_ & 0x00000002) == 0x00000002)) {
  auth_ = java.util.Collections.unmodifiableList(auth_);
  bitField0_ = (bitField0_ & ~0x00000002);
 }
 result.auth_ = auth_;
 result.bitField0_ = to_bitField0_;
 onBuilt();
 return result;
}
origin: harbby/presto-connectors

public Builder toBuilder() { return newBuilder(this); }
origin: harbby/presto-connectors

/**
 * Creates the user auth data to be written to zookeeper.
 * @param userAuths
 * @return Bytes form of user auths details to be written to zookeeper.
 */
public static byte[] getUserAuthsDataToWriteToZooKeeper(Map<String, List<Integer>> userAuths) {
 MultiUserAuthorizations.Builder builder = MultiUserAuthorizations.newBuilder();
 for (Entry<String, List<Integer>> entry : userAuths.entrySet()) {
  UserAuthorizations.Builder userAuthsBuilder = UserAuthorizations.newBuilder();
  userAuthsBuilder.setUser(ByteStringer.wrap(Bytes.toBytes(entry.getKey())));
  for (Integer label : entry.getValue()) {
   userAuthsBuilder.addAuth(label);
  }
  builder.addUserAuths(userAuthsBuilder.build());
 }
 return ProtobufUtil.prependPBMagic(builder.build().toByteArray());
}
origin: harbby/presto-connectors

public org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations buildPartial() {
 org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations result = new org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations(this);
 int from_bitField0_ = bitField0_;
 int to_bitField0_ = 0;
 if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  to_bitField0_ |= 0x00000001;
 }
 result.user_ = user_;
 if (((bitField0_ & 0x00000002) == 0x00000002)) {
  auth_ = java.util.Collections.unmodifiableList(auth_);
  bitField0_ = (bitField0_ & ~0x00000002);
 }
 result.auth_ = auth_;
 result.bitField0_ = to_bitField0_;
 onBuilt();
 return result;
}
origin: harbby/presto-connectors

@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;
}
origin: org.apache.hbase/hbase-protocol

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;
}
origin: com.aliyun.hbase/alihbase-protocol

@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;
}
origin: com.aliyun.hbase/alihbase-protocol

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;
}
origin: org.apache.hbase/hbase-protocol

public org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations buildPartial() {
 org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations result = new org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations(this);
 int from_bitField0_ = bitField0_;
 int to_bitField0_ = 0;
 if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  to_bitField0_ |= 0x00000001;
 }
 result.user_ = user_;
 if (((bitField0_ & 0x00000002) == 0x00000002)) {
  auth_ = java.util.Collections.unmodifiableList(auth_);
  bitField0_ = (bitField0_ & ~0x00000002);
 }
 result.auth_ = auth_;
 result.bitField0_ = to_bitField0_;
 onBuilt();
 return result;
}
org.apache.hadoop.hbase.protobuf.generatedVisibilityLabelsProtos$UserAuthorizations

Javadoc

Protobuf type hbase.pb.UserAuthorizations

Most used methods

  • getAuthList
    repeated uint32 auth = 2;
  • getUser
    required bytes user = 1;
  • newBuilder
  • <init>
  • getAuthCount
    repeated uint32 auth = 2;
  • getDefaultInstance
  • getDescriptorForType
  • getSerializedSize
  • getUnknownFields
  • hasUser
    required bytes user = 1;
  • initFields
  • isInitialized
  • initFields,
  • isInitialized,
  • makeExtensionsImmutable,
  • parseUnknownField

Popular in Java

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Option (scala)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now