ConcurrentHashMap<BlockCacheKey, BucketCache.BucketEntry> result = new ConcurrentHashMap<>(); for (BucketCacheProtos.BackingMapEntry entry : backingMap.getEntryList()) { BucketCacheProtos.BlockCacheKey protoKey = entry.getKey(); BlockCacheKey key = new BlockCacheKey(protoKey.getHfilename(), protoKey.getOffset(), protoKey.getPrimaryReplicaBlock(), fromPb(protoKey.getBlockType())); BucketCacheProtos.BucketEntry protoValue = entry.getValue(); BucketCache.BucketEntry value = new BucketCache.BucketEntry( protoValue.getOffset(),
private static BucketCacheProtos.BackingMap toPB( Map<BlockCacheKey, BucketCache.BucketEntry> backingMap) { BucketCacheProtos.BackingMap.Builder builder = BucketCacheProtos.BackingMap.newBuilder(); for (Map.Entry<BlockCacheKey, BucketCache.BucketEntry> entry : backingMap.entrySet()) { builder.addEntry(BucketCacheProtos.BackingMapEntry.newBuilder() .setKey(toPB(entry.getKey())) .setValue(toPB(entry.getValue())) .build()); } return builder.build(); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasKey()) { hash = (37 * hash) + KEY_FIELD_NUMBER; hash = (53 * hash) + getKey().hashCode(); } if (hasValue()) { hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
break; default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
public org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry buildPartial() { org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry result = new org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (keyBuilder_ == null) { result.key_ = key_; } else { result.key_ = keyBuilder_.build(); } if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } if (valueBuilder_ == null) { result.value_ = value_; } else { result.value_ = valueBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; if (!hasKey()) { memoizedIsInitialized = 0; return false; } if (!hasValue()) { memoizedIsInitialized = 0; return false; } if (!getKey().isInitialized()) { memoizedIsInitialized = 0; return false; } if (!getValue().isInitialized()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
@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.BucketCacheProtos.BackingMapEntry)) { return super.equals(obj); } org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry other = (org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry) obj; boolean result = true; result = result && (hasKey() == other.hasKey()); if (hasKey()) { result = result && getKey() .equals(other.getKey()); } result = result && (hasValue() == other.hasValue()); if (hasValue()) { result = result && getValue() .equals(other.getValue()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += org.apache.hbase.thirdparty.com.google.protobuf.CodedOutputStream .computeMessageSize(1, getKey()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += org.apache.hbase.thirdparty.com.google.protobuf.CodedOutputStream .computeMessageSize(2, getValue()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry getDefaultInstanceForType() { return org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry.getDefaultInstance(); }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; for (int i = 0; i < getEntryCount(); i++) { if (!getEntry(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
/** * <code>repeated .hbase.pb.BackingMapEntry entry = 1;</code> */ public org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry.Builder addEntryBuilder() { return getEntryFieldBuilder().addBuilder( org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry.getDefaultInstance()); } /**
public final boolean isInitialized() { for (int i = 0; i < getEntryCount(); i++) { if (!getEntry(i).isInitialized()) { return false; } } return true; }
public org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry build() { org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
/** * <code>repeated .hbase.pb.BackingMapEntry entry = 1;</code> */ public org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry.Builder addEntryBuilder( int index) { return getEntryFieldBuilder().addBuilder( index, org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry.getDefaultInstance()); } /**
public void writeTo(org.apache.hbase.thirdparty.com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeMessage(1, getKey()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeMessage(2, getValue()); } unknownFields.writeTo(output); }
public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry other) { if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry.getDefaultInstance()) return this; if (other.hasKey()) { mergeKey(other.getKey()); } if (other.hasValue()) { mergeValue(other.getValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }