@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasBlock()) { hash = (37 * hash) + BLOCK_FIELD_NUMBER; hash = (53 * hash) + getBlock().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 (hasBlock()) { hash = (37 * hash) + BLOCK_FIELD_NUMBER; hash = (53 * hash) + getBlock().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 (hasBlock()) { hash = (37 * hash) + BLOCK_FIELD_NUMBER; hash = (53 * hash) + getBlock().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
@Override public GetReplicaVisibleLengthResponseProto answer( InvocationOnMock invocation) throws IOException { Object args[] = invocation.getArguments(); assertEquals(2, args.length); GetReplicaVisibleLengthRequestProto req = (GetReplicaVisibleLengthRequestProto) args[1]; Set<TokenIdentifier> tokenIds = UserGroupInformation.getCurrentUser() .getTokenIdentifiers(); assertEquals("Only one BlockTokenIdentifier expected", 1, tokenIds.size()); long result = 0; for (TokenIdentifier tokenId : tokenIds) { BlockTokenIdentifier id = (BlockTokenIdentifier) tokenId; LOG.info("Got: " + id.toString()); assertTrue("Received BlockTokenIdentifier is wrong", ident.equals(id)); sm.checkAccess(id, null, PBHelper.convert(req.getBlock()), BlockTokenSecretManager.AccessMode.WRITE); result = id.getBlockId(); } return GetReplicaVisibleLengthResponseProto.newBuilder() .setLength(result).build(); } }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto)) { return super.equals(obj); } org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto other = (org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto) obj; boolean result = true; result = result && (hasBlock() == other.hasBlock()); if (hasBlock()) { result = result && getBlock() .equals(other.getBlock()); } 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.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto)) { return super.equals(obj); } org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto other = (org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto) obj; boolean result = true; result = result && (hasBlock() == other.hasBlock()); if (hasBlock()) { result = result && getBlock() .equals(other.getBlock()); } 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.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto)) { return super.equals(obj); } org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto other = (org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto) obj; boolean result = true; result = result && (hasBlock() == other.hasBlock()); if (hasBlock()) { result = result && getBlock() .equals(other.getBlock()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasBlock()) { memoizedIsInitialized = 0; return false; } if (!getBlock().isInitialized()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasBlock()) { memoizedIsInitialized = 0; return false; } if (!getBlock().isInitialized()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
@Override public GetReplicaVisibleLengthResponseProto getReplicaVisibleLength( RpcController unused, GetReplicaVisibleLengthRequestProto request) throws ServiceException { long len; try { len = impl.getReplicaVisibleLength(PBHelper.convert(request.getBlock())); } catch (IOException e) { throw new ServiceException(e); } return GetReplicaVisibleLengthResponseProto.newBuilder().setLength(len) .build(); }
@Override public GetReplicaVisibleLengthResponseProto getReplicaVisibleLength( RpcController unused, GetReplicaVisibleLengthRequestProto request) throws ServiceException { long len; try { len = impl.getReplicaVisibleLength(PBHelper.convert(request.getBlock())); } catch (IOException e) { throw new ServiceException(e); } return GetReplicaVisibleLengthResponseProto.newBuilder().setLength(len) .build(); }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasBlock()) { memoizedIsInitialized = 0; return false; } if (!getBlock().isInitialized()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
public Builder mergeFrom(org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto other) { if (other == org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto.getDefaultInstance()) return this; if (other.hasBlock()) { mergeBlock(other.getBlock()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto other) { if (other == org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto.getDefaultInstance()) return this; if (other.hasBlock()) { mergeBlock(other.getBlock()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto other) { if (other == org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto.getDefaultInstance()) return this; if (other.hasBlock()) { mergeBlock(other.getBlock()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
@Override public GetReplicaVisibleLengthResponseProto getReplicaVisibleLength( RpcController unused, GetReplicaVisibleLengthRequestProto request) throws ServiceException { long len; try { len = impl.getReplicaVisibleLength(PBHelperClient.convert(request.getBlock())); } catch (IOException e) { throw new ServiceException(e); } return GetReplicaVisibleLengthResponseProto.newBuilder().setLength(len) .build(); }