public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
/** * <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; } /**
/** * @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(); }
/** * 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(); }
/** * 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(); }
GetStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.NEVER).build(); status = masterClient.getStatus(path, gsOptions); LOG.debug("Created file {}, options: {}", path.getPath(), options);
.defaults(GetStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.NEVER)));