/** * <code>optional .alluxio.grpc.file.GetStatusPOptions options = 2;</code> */ public alluxio.grpc.GetStatusPOptionsOrBuilder getOptionsOrBuilder() { return options_ == null ? alluxio.grpc.GetStatusPOptions.getDefaultInstance() : options_; }
/** * <code>optional .alluxio.grpc.file.GetStatusPOptions options = 2;</code> */ public alluxio.grpc.GetStatusPOptions getOptions() { return options_ == null ? alluxio.grpc.GetStatusPOptions.getDefaultInstance() : options_; } /**
public alluxio.grpc.GetStatusPOptions getDefaultInstanceForType() { return alluxio.grpc.GetStatusPOptions.getDefaultInstance(); }
/** * <code>optional .alluxio.grpc.file.GetStatusPOptions options = 2;</code> */ public alluxio.grpc.GetStatusPOptions getOptions() { if (optionsBuilder_ == null) { return options_ == null ? alluxio.grpc.GetStatusPOptions.getDefaultInstance() : options_; } else { return optionsBuilder_.getMessage(); } } /**
/** * <code>optional .alluxio.grpc.file.GetStatusPOptions options = 2;</code> */ public alluxio.grpc.GetStatusPOptionsOrBuilder getOptionsOrBuilder() { if (optionsBuilder_ != null) { return optionsBuilder_.getMessageOrBuilder(); } else { return options_ == null ? alluxio.grpc.GetStatusPOptions.getDefaultInstance() : options_; } } /**
@Override public URIStatus getStatus(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException { return getStatus(path, GetStatusPOptions.getDefaultInstance()); }
/** * <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(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; }
/** * Tests for the {@link BaseFileSystem#openFile(AlluxioURI, OpenFilePOptions)} method to * complete successfully. */ @Test public void openFile() throws Exception { AlluxioURI file = new AlluxioURI("/file"); URIStatus status = new URIStatus(new FileInfo()); GetStatusPOptions getStatusOptions = GetStatusPOptions.getDefaultInstance(); when(mFileSystemMasterClient.getStatus(file, getStatusOptions)).thenReturn(status); mFileSystem.openFile(file, OpenFilePOptions.getDefaultInstance()); verify(mFileSystemMasterClient).getStatus(file, getStatusOptions); verifyFilesystemContextAcquiredAndReleased(); }
/** * Ensures that an exception is propagated correctly when retrieving information. */ @Test public void getStatusException() throws Exception { AlluxioURI file = new AlluxioURI("/file"); GetStatusPOptions getStatusOptions = GetStatusPOptions.getDefaultInstance(); when(mFileSystemMasterClient.getStatus(file, getStatusOptions)).thenThrow(EXCEPTION); try { mFileSystem.getStatus(file, getStatusOptions); fail(SHOULD_HAVE_PROPAGATED_MESSAGE); } catch (Exception e) { assertSame(EXCEPTION, e); } verifyFilesystemContextAcquiredAndReleased(); }
/** * Tests for the {@link BaseFileSystem#getStatus(AlluxioURI, GetStatusPOptions)} method. */ @Test public void getStatus() throws Exception { AlluxioURI file = new AlluxioURI("/file"); URIStatus status = new URIStatus(new FileInfo()); GetStatusPOptions getStatusOptions = GetStatusPOptions.getDefaultInstance(); when(mFileSystemMasterClient.getStatus(file, getStatusOptions)).thenReturn(status); assertSame(status, mFileSystem.getStatus(file, getStatusOptions)); verify(mFileSystemMasterClient).getStatus(file, getStatusOptions); verifyFilesystemContextAcquiredAndReleased(); }
/** * Ensures that an exception is propagated successfully when opening a file. */ @Test public void openException() throws Exception { AlluxioURI file = new AlluxioURI("/file"); GetStatusPOptions getStatusOptions = GetStatusPOptions.getDefaultInstance(); when(mFileSystemMasterClient.getStatus(file, getStatusOptions)).thenThrow(EXCEPTION); try { mFileSystem.openFile(file, OpenFilePOptions.getDefaultInstance()); fail(SHOULD_HAVE_PROPAGATED_MESSAGE); } catch (Exception e) { assertSame(EXCEPTION, e); } verifyFilesystemContextAcquiredAndReleased(); }