public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { alluxio.grpc.OpenFilePOptions parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (alluxio.grpc.OpenFilePOptions) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof alluxio.grpc.OpenFilePOptions) { return mergeFrom((alluxio.grpc.OpenFilePOptions)other); } else { super.mergeFrom(other); return this; } }
/** * Creates with given {@link OpenFilePOptions} instance. * @param status URI status * @param options OpenFile options * @param alluxioConf Alluxio configuration */ public InStreamOptions(URIStatus status, OpenFilePOptions options, AlluxioConfiguration alluxioConf) { // Create OpenOptions builder with default options. OpenFilePOptions.Builder openOptionsBuilder = OpenFilePOptions.newBuilder() .setReadType(alluxioConf.getEnum(PropertyKey.USER_FILE_READ_TYPE_DEFAULT, ReadType.class) .toProto()) .setFileReadLocationPolicy( alluxioConf.get(PropertyKey.USER_UFS_BLOCK_READ_LOCATION_POLICY)) .setHashingNumberOfShards(alluxioConf .getInt(PropertyKey.USER_UFS_BLOCK_READ_LOCATION_POLICY_DETERMINISTIC_HASH_SHARDS)) .setMaxUfsReadConcurrency(alluxioConf .getInt(PropertyKey.USER_UFS_BLOCK_READ_CONCURRENCY_MAX)); // Merge default options with given options. OpenFilePOptions openOptions = openOptionsBuilder.mergeFrom(options).build(); mStatus = status; mProtoOptions = openOptions; CreateOptions blockLocationPolicyCreateOptions = CreateOptions.defaults().setLocationPolicyClassName(openOptions.getFileReadLocationPolicy()) .setDeterministicHashPolicyNumShards(openOptions.getHashingNumberOfShards()); mUfsReadLocationPolicy = BlockLocationPolicy.Factory.create(blockLocationPolicyCreateOptions, alluxioConf); }
public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); }
public static Builder newBuilder(alluxio.grpc.OpenFilePOptions prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() {