/** * Construct a TokenProto from this Token instance. * @return a new TokenProto object holding copies of data in this instance */ public TokenProto toTokenProto() { return TokenProto.newBuilder(). setIdentifier(ByteString.copyFrom(this.getIdentifier())). setPassword(ByteString.copyFrom(this.getPassword())). setKindBytes(ByteString.copyFrom( this.getKind().getBytes(), 0, this.getKind().getLength())). setServiceBytes(ByteString.copyFrom( this.getService().getBytes(), 0, this.getService().getLength())). build(); }
public static TokenProto convert(Token<?> tok) { return TokenProto.newBuilder(). setIdentifier(ByteString.copyFrom(tok.getIdentifier())). setPassword(ByteString.copyFrom(tok.getPassword())). setKind(tok.getKind().toString()). setService(tok.getService().toString()).build(); }
private void recordJobShuffleInfo(JobID jobId, String user, Token<JobTokenIdentifier> jobToken) throws IOException { if (stateDb != null) { TokenProto tokenProto = TokenProto.newBuilder() .setIdentifier(ByteString.copyFrom(jobToken.getIdentifier())) .setPassword(ByteString.copyFrom(jobToken.getPassword())) .setKind(jobToken.getKind().toString()) .setService(jobToken.getService().toString()) .build(); JobShuffleInfoProto proto = JobShuffleInfoProto.newBuilder() .setUser(user).setJobToken(tokenProto).build(); try { stateDb.put(bytes(jobId.toString()), proto.toByteArray()); } catch (DBException e) { throw new IOException("Error storing " + jobId, e); } } addJobToken(jobId, user, jobToken); }
public Builder mergeFrom(org.apache.hadoop.security.proto.SecurityProtos.TokenProto other) { if (other == org.apache.hadoop.security.proto.SecurityProtos.TokenProto.getDefaultInstance()) return this; if (other.hasIdentifier()) { setIdentifier(other.getIdentifier()); } if (other.hasPassword()) { setPassword(other.getPassword()); } if (other.hasKind()) { bitField0_ |= 0x00000004; kind_ = other.kind_; onChanged(); } if (other.hasService()) { bitField0_ |= 0x00000008; service_ = other.service_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.hadoop.security.proto.SecurityProtos.TokenProto other) { if (other == org.apache.hadoop.security.proto.SecurityProtos.TokenProto.getDefaultInstance()) return this; if (other.hasIdentifier()) { setIdentifier(other.getIdentifier()); } if (other.hasPassword()) { setPassword(other.getPassword()); } if (other.hasKind()) { bitField0_ |= 0x00000004; kind_ = other.kind_; onChanged(); } if (other.hasService()) { bitField0_ |= 0x00000008; service_ = other.service_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.hadoop.security.proto.SecurityProtos.TokenProto other) { if (other == org.apache.hadoop.security.proto.SecurityProtos.TokenProto.getDefaultInstance()) return this; if (other.hasIdentifier()) { setIdentifier(other.getIdentifier()); } if (other.hasPassword()) { setPassword(other.getPassword()); } if (other.hasKind()) { bitField0_ |= 0x00000004; kind_ = other.kind_; onChanged(); } if (other.hasService()) { bitField0_ |= 0x00000008; service_ = other.service_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.hadoop.security.proto.SecurityProtos.TokenProto other) { if (other == org.apache.hadoop.security.proto.SecurityProtos.TokenProto.getDefaultInstance()) return this; if (other.hasIdentifier()) { setIdentifier(other.getIdentifier()); } if (other.hasPassword()) { setPassword(other.getPassword()); } if (other.hasKind()) { bitField0_ |= 0x00000004; kind_ = other.kind_; onChanged(); } if (other.hasService()) { bitField0_ |= 0x00000008; service_ = other.service_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.hadoop.security.proto.SecurityProtos.TokenProto other) { if (other == org.apache.hadoop.security.proto.SecurityProtos.TokenProto.getDefaultInstance()) return this; if (other.hasIdentifier()) { setIdentifier(other.getIdentifier()); } if (other.hasPassword()) { setPassword(other.getPassword()); } if (other.hasKind()) { bitField0_ |= 0x00000004; kind_ = other.kind_; onChanged(); } if (other.hasService()) { bitField0_ |= 0x00000008; service_ = other.service_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
private void recordJobShuffleInfo(JobID jobId, String user, Token<JobTokenIdentifier> jobToken) throws IOException { if (stateDb != null) { TokenProto tokenProto = TokenProto.newBuilder() .setIdentifier(ByteString.copyFrom(jobToken.getIdentifier())) .setPassword(ByteString.copyFrom(jobToken.getPassword())) .setKind(jobToken.getKind().toString()) .setService(jobToken.getService().toString()) .build(); JobShuffleInfoProto proto = JobShuffleInfoProto.newBuilder() .setUser(user).setJobToken(tokenProto).build(); try { stateDb.put(bytes(jobId.toString()), proto.toByteArray()); } catch (DBException e) { throw new IOException("Error storing " + jobId, e); } } addJobToken(jobId, user, jobToken); }
private void recordJobShuffleInfo(JobID jobId, String user, Token<JobTokenIdentifier> jobToken) throws IOException { if (stateDb != null) { TokenProto tokenProto = TokenProto.newBuilder() .setIdentifier(ByteString.copyFrom(jobToken.getIdentifier())) .setPassword(ByteString.copyFrom(jobToken.getPassword())) .setKind(jobToken.getKind().toString()) .setService(jobToken.getService().toString()) .build(); JobShuffleInfoProto proto = JobShuffleInfoProto.newBuilder() .setUser(user).setJobToken(tokenProto).build(); try { stateDb.put(bytes(jobId.toString()), proto.toByteArray()); } catch (DBException e) { throw new IOException("Error storing " + jobId, e); } } addJobToken(jobId, user, jobToken); }
public static TokenProto convert(Token<?> tok) { return TokenProto.newBuilder(). setIdentifier(ByteString.copyFrom(tok.getIdentifier())). setPassword(ByteString.copyFrom(tok.getPassword())). setKind(tok.getKind().toString()). setService(tok.getService().toString()).build(); }
public static TokenProto convert(Token<?> tok) { return TokenProto.newBuilder(). setIdentifier(getByteString(tok.getIdentifier())). setPassword(getByteString(tok.getPassword())). setKindBytes(getFixedByteString(tok.getKind())). setServiceBytes(getFixedByteString(tok.getService())).build(); }
private synchronized void mergeLocalToBuilder() { if (this.identifier != null) { builder.setIdentifier(convertToProtoFormat(this.identifier)); } if (this.password != null) { builder.setPassword(convertToProtoFormat(this.password)); } }
private synchronized void mergeLocalToBuilder() { if (this.identifier != null) { builder.setIdentifier(convertToProtoFormat(this.identifier)); } if (this.password != null) { builder.setPassword(convertToProtoFormat(this.password)); } }
private synchronized void mergeLocalToBuilder() { if (this.identifier != null) { builder.setIdentifier(convertToProtoFormat(this.identifier)); } if (this.password != null) { builder.setPassword(convertToProtoFormat(this.password)); } }
public Builder mergeFrom(org.apache.hadoop.security.proto.SecurityProtos.TokenProto other) { if (other == org.apache.hadoop.security.proto.SecurityProtos.TokenProto.getDefaultInstance()) return this; if (other.hasIdentifier()) { setIdentifier(other.getIdentifier()); } if (other.hasPassword()) { setPassword(other.getPassword()); } if (other.hasKind()) { bitField0_ |= 0x00000004; kind_ = other.kind_; onChanged(); } if (other.hasService()) { bitField0_ |= 0x00000008; service_ = other.service_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }