/** * <code>optional .alluxio.grpc.file.GetStatusPOptions options = 2;</code> */ public Builder setOptions( alluxio.grpc.GetStatusPOptions.Builder builderForValue) { if (optionsBuilder_ == null) { options_ = builderForValue.build(); onChanged(); } else { optionsBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; return this; } /**
/** * <code>optional .alluxio.grpc.file.FileSystemMasterCommonPOptions commonOptions = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< alluxio.grpc.FileSystemMasterCommonPOptions, alluxio.grpc.FileSystemMasterCommonPOptions.Builder, alluxio.grpc.FileSystemMasterCommonPOptionsOrBuilder> getCommonOptionsFieldBuilder() { if (commonOptionsBuilder_ == null) { commonOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< alluxio.grpc.FileSystemMasterCommonPOptions, alluxio.grpc.FileSystemMasterCommonPOptions.Builder, alluxio.grpc.FileSystemMasterCommonPOptionsOrBuilder>( getCommonOptions(), getParentForChildren(), isClean()); commonOptions_ = null; } return commonOptionsBuilder_; } public final Builder setUnknownFields(
subBuilder.mergeFrom(options_); options_ = subBuilder.buildPartial();
.defaults(GetStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.NEVER)));
Metrics.GET_FILE_INFO_OPS.inc(); LockingScheme lockingScheme = createLockingScheme(path, context.getOptions().getCommonOptions(), LockPattern.READ); try (RpcContext rpcContext = createRpcContext(); LockedInodePath inodePath = mInodeTree context.getOptions().setLoadMetadataType(LoadMetadataPType.NEVER); checkLoadMetadataOptions(context.getOptions().getLoadMetadataType(), inodePath.getUri()); loadMetadataIfNotExist(rpcContext, inodePath, LoadMetadataContext.defaults(LoadMetadataPOptions.newBuilder().setCreateAncestors(true) .setCommonOptions(FileSystemMasterCommonPOptions.newBuilder() .setTtl(context.getOptions().getCommonOptions().getTtl()) .setTtlAction(context.getOptions().getCommonOptions().getTtlAction())))); ensureFullPathAndUpdateCache(inodePath);
GetStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.NEVER).build(); status = masterClient.getStatus(path, gsOptions); LOG.debug("Created file {}, options: {}", path.getPath(), options);
/** * <code>optional .alluxio.grpc.file.GetStatusPOptions options = 2;</code> */ public Builder mergeOptions(alluxio.grpc.GetStatusPOptions value) { if (optionsBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && options_ != null && options_ != alluxio.grpc.GetStatusPOptions.getDefaultInstance()) { options_ = alluxio.grpc.GetStatusPOptions.newBuilder(options_).mergeFrom(value).buildPartial(); } else { options_ = value; } onChanged(); } else { optionsBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { alluxio.grpc.GetStatusPOptions parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (alluxio.grpc.GetStatusPOptions) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
/** * Tests the creation of a file via the * {@link BaseFileSystem#createFile(AlluxioURI, CreateFilePOptions)} method. */ @Test public void createFile() throws Exception { doNothing().when(mFileSystemMasterClient) .createFile(any(AlluxioURI.class), any(CreateFilePOptions.class)); URIStatus status = new URIStatus(new FileInfo()); AlluxioURI file = new AlluxioURI("/file"); GetStatusPOptions getStatusOptions = GetStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.NEVER).build(); when(mFileSystemMasterClient.getStatus(file, getStatusOptions)).thenReturn(status); FileOutStream out = mFileSystem.createFile(file, CreateFilePOptions.getDefaultInstance()); verify(mFileSystemMasterClient).createFile(file, CreateFilePOptions.getDefaultInstance()); assertEquals(out.mUri, file); verifyFilesystemContextAcquiredAndReleased(); }
/** * Converts from proto type to options. * * @param existsOptions the proto options to convert * @return the converted proto options */ public static GetStatusPOptions toGetStatusOptions(ExistsPOptions existsOptions) { GetStatusPOptions.Builder getStatusOptionsBuilder = GetStatusPOptions.newBuilder(); if (existsOptions.hasCommonOptions()) { getStatusOptionsBuilder.setCommonOptions(existsOptions.getCommonOptions()); } if (existsOptions.hasLoadMetadataType()) { getStatusOptionsBuilder.setLoadMetadataType(existsOptions.getLoadMetadataType()); } return getStatusOptionsBuilder.build(); }
public static Builder newBuilder(alluxio.grpc.GetStatusPOptions prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() {
@Override public String toString() { return MoreObjects.toStringHelper(this) .add("ProtoOptions", getOptions().build()) .toString(); } }
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof alluxio.grpc.GetStatusPOptions) { return mergeFrom((alluxio.grpc.GetStatusPOptions)other); } else { super.mergeFrom(other); return this; } }
public Builder mergeFrom(alluxio.grpc.GetStatusPOptions other) { if (other == alluxio.grpc.GetStatusPOptions.getDefaultInstance()) return this; if (other.hasLoadMetadataType()) { setLoadMetadataType(other.getLoadMetadataType()); } if (other.hasCommonOptions()) { mergeCommonOptions(other.getCommonOptions()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * Merges and embeds the given {@link GetStatusPOptions} with the corresponding master options. * * @param optionsBuilder Builder for proto {@link GetStatusPOptions} to merge with defaults * @return the instance of {@link GetStatusContext} with default values for master */ public static GetStatusContext defaults(GetStatusPOptions.Builder optionsBuilder) { GetStatusPOptions masterOptions = FileSystemMasterOptions.getStatusDefaults(); GetStatusPOptions.Builder mergedOptionsBuilder = masterOptions.toBuilder().mergeFrom(optionsBuilder.build()); return new GetStatusContext(mergedOptionsBuilder); }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
/** * @return Master side defaults for {@link GetStatusPOptions} */ public static GetStatusPOptions getStatusDefaults() { return GetStatusPOptions.newBuilder() .setCommonOptions(commonDefaults()) .setLoadMetadataType(GrpcUtils.toProto(ServerConfiguration .getEnum(PropertyKey.USER_FILE_METADATA_LOAD_TYPE, LoadMetadataType.class))) .build(); }