boolean updateRootDir = false; for (NameStringPair e : c.getMapEntriesList()) { String key = e.getName(); String hostnameFromMasterPOV = e.getValue(); this.serverName = ServerName.valueOf(hostnameFromMasterPOV, rpcServices.isa.getPort(), this.startcode); String value = e.getValue(); if (key.equals(HConstants.HBASE_DIR)) { if (value != null && !value.equals(conf.get(HConstants.HBASE_DIR))) {
builder.addConfiguration(HBaseProtos.NameStringPair.newBuilder() .setName(entry.getKey()) .setValue(entry.getValue())
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasName()) { hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); } if (hasValue()) { hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
builder.addConfiguration(HBaseProtos.NameStringPair.newBuilder() .setName(entry.getKey()) .setValue(entry.getValue())
/** * Converts an ColumnFamilyDescriptor to ColumnFamilySchema * @param hcd the ColumnFamilySchema * @return Convert this instance to a the pb column family type */ public static ColumnFamilySchema toColumnFamilySchema(ColumnFamilyDescriptor hcd) { ColumnFamilySchema.Builder builder = ColumnFamilySchema.newBuilder(); builder.setName(UnsafeByteOperations.unsafeWrap(hcd.getName())); for (Map.Entry<Bytes, Bytes> e : hcd.getValues().entrySet()) { BytesBytesPair.Builder aBuilder = BytesBytesPair.newBuilder(); aBuilder.setFirst(UnsafeByteOperations.unsafeWrap(e.getKey().get())); aBuilder.setSecond(UnsafeByteOperations.unsafeWrap(e.getValue().get())); builder.addAttributes(aBuilder.build()); } for (Map.Entry<String, String> e : hcd.getConfiguration().entrySet()) { NameStringPair.Builder aBuilder = NameStringPair.newBuilder(); aBuilder.setName(e.getKey()); aBuilder.setValue(e.getValue()); builder.addConfiguration(aBuilder.build()); } return builder.build(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair)) { return super.equals(obj); } org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair other = (org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair) obj; boolean result = true; result = result && (hasName() == other.hasName()); if (hasName()) { result = result && getName() .equals(other.getName()); } result = result && (hasValue() == other.hasValue()); if (hasValue()) { result = result && getValue() .equals(other.getValue()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasName()) { hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); } if (hasValue()) { hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * Converts a TableSchema to TableDescriptor * @param ts A pb TableSchema instance. * @return An {@link TableDescriptor} made from the passed in pb <code>ts</code>. */ public static TableDescriptor toTableDescriptor(final TableSchema ts) { TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(ProtobufUtil.toTableName(ts.getTableName())); ts.getColumnFamiliesList() .stream() .map(ProtobufUtil::toColumnFamilyDescriptor) .forEach(builder::setColumnFamily); ts.getAttributesList() .forEach(a -> builder.setValue(a.getFirst().toByteArray(), a.getSecond().toByteArray())); ts.getConfigurationList() .forEach(a -> builder.setValue(a.getName(), a.getValue())); return builder.build(); }
public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair other) { if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair.getDefaultInstance()) return this; if (other.hasName()) { bitField0_ |= 0x00000001; name_ = other.name_; onChanged(); } if (other.hasValue()) { bitField0_ |= 0x00000002; value_ = other.value_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * <pre> ** * Configuration for the regionserver to use: e.g. filesystem, * hbase rootdir, the hostname to use creating the RegionServer ServerName, * etc * </pre> * * <code>repeated .hbase.pb.NameStringPair map_entries = 1;</code> */ public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair.Builder addMapEntriesBuilder( int index) { return getMapEntriesFieldBuilder().addBuilder( index, org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair.getDefaultInstance()); } /**
/** * <pre> ** * Configuration for the regionserver to use: e.g. filesystem, * hbase rootdir, the hostname to use creating the RegionServer ServerName, * etc * </pre> * * <code>repeated .hbase.pb.NameStringPair map_entries = 1;</code> */ public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair.Builder addMapEntriesBuilder() { return getMapEntriesFieldBuilder().addBuilder( org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair.getDefaultInstance()); } /**
public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair buildPartial() { org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair result = new org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.name_ = name_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.value_ = value_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
/** * Converts a ColumnFamilySchema to ColumnFamilyDescriptor * @param cfs the ColumnFamilySchema * @return An {@link ColumnFamilyDescriptor} made from the passed in <code>cfs</code> */ public static ColumnFamilyDescriptor toColumnFamilyDescriptor(final ColumnFamilySchema cfs) { // Use the empty constructor so we preserve the initial values set on construction for things // like maxVersion. Otherwise, we pick up wrong values on deserialization which makes for // unrelated-looking test failures that are hard to trace back to here. ColumnFamilyDescriptorBuilder builder = ColumnFamilyDescriptorBuilder.newBuilder(cfs.getName().toByteArray()); cfs.getAttributesList().forEach(a -> builder.setValue(a.getFirst().toByteArray(), a.getSecond().toByteArray())); cfs.getConfigurationList().forEach(a -> builder.setConfiguration(a.getName(), a.getValue())); return builder.build(); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair getDefaultInstanceForType() { return org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair.getDefaultInstance(); }
/** * <code>repeated .hbase.pb.NameStringPair configuration = 4;</code> */ public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair.Builder addConfigurationBuilder( int index) { return getConfigurationFieldBuilder().addBuilder( index, org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair.getDefaultInstance()); } /**
/** * <code>repeated .hbase.pb.NameStringPair configuration = 4;</code> */ public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair.Builder addConfigurationBuilder( int index) { return getConfigurationFieldBuilder().addBuilder( index, org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair.getDefaultInstance()); } /**
public static HBaseProtos.NamespaceDescriptor toProtoNamespaceDescriptor(NamespaceDescriptor ns) { HBaseProtos.NamespaceDescriptor.Builder b = HBaseProtos.NamespaceDescriptor.newBuilder() .setName(ByteString.copyFromUtf8(ns.getName())); for(Map.Entry<String, String> entry: ns.getConfiguration().entrySet()) { b.addConfiguration(HBaseProtos.NameStringPair.newBuilder() .setName(entry.getKey()) .setValue(entry.getValue())); } return b.build(); }
public static NamespaceDescriptor toNamespaceDescriptor(HBaseProtos.NamespaceDescriptor desc) { NamespaceDescriptor.Builder b = NamespaceDescriptor.create(desc.getName().toStringUtf8()); for (HBaseProtos.NameStringPair prop : desc.getConfigurationList()) { b.addConfiguration(prop.getName(), prop.getValue()); } return b.build(); }