Search in sources :

Example 6 with FileSystemMasterCommonPOptions

use of alluxio.grpc.FileSystemMasterCommonPOptions in project alluxio by Alluxio.

the class DefaultFileSystemMaster method loadMetadataIfNotExist.

/**
 * Loads metadata for the path if it is (non-existing || load direct children is set).
 *
 * See {@link #shouldLoadMetadataIfNotExists(LockedInodePath, LoadMetadataContext)}.
 *
 * @param rpcContext the rpc context
 * @param path the path to load metadata for
 * @param context the {@link LoadMetadataContext}
 * @param isGetFileInfo whether this is loading for a {@link #getFileInfo} call
 */
private void loadMetadataIfNotExist(RpcContext rpcContext, AlluxioURI path, LoadMetadataContext context, boolean isGetFileInfo) throws InvalidPathException, AccessControlException {
    DescendantType syncDescendantType = GrpcUtils.fromProto(context.getOptions().getLoadDescendantType());
    FileSystemMasterCommonPOptions commonOptions = context.getOptions().getCommonOptions();
    boolean loadAlways = context.getOptions().hasLoadType() && (context.getOptions().getLoadType().equals(LoadMetadataPType.ALWAYS));
    // load metadata only and force sync
    InodeSyncStream sync = new InodeSyncStream(new LockingScheme(path, LockPattern.READ, false), this, rpcContext, syncDescendantType, commonOptions, isGetFileInfo, true, true, loadAlways);
    if (sync.sync().equals(FAILED)) {
        LOG.debug("Failed to load metadata for path from UFS: {}", path);
    }
}
Also used : LockingScheme(alluxio.master.file.meta.LockingScheme) FileSystemMasterCommonPOptions(alluxio.grpc.FileSystemMasterCommonPOptions) DescendantType(alluxio.file.options.DescendantType)

Aggregations

FileSystemMasterCommonPOptions (alluxio.grpc.FileSystemMasterCommonPOptions)6 AlluxioURI (alluxio.AlluxioURI)3 Test (org.junit.Test)3 URIStatus (alluxio.client.file.URIStatus)2 AccessControlException (alluxio.exception.AccessControlException)2 FileDoesNotExistException (alluxio.exception.FileDoesNotExistException)2 LockingScheme (alluxio.master.file.meta.LockingScheme)2 BaseIntegrationTest (alluxio.testutils.BaseIntegrationTest)2 File (java.io.File)2 OutStreamOptions (alluxio.client.file.options.OutStreamOptions)1 InvalidPathException (alluxio.exception.InvalidPathException)1 DescendantType (alluxio.file.options.DescendantType)1 CompleteFilePOptions (alluxio.grpc.CompleteFilePOptions)1 SetAttributePOptions (alluxio.grpc.SetAttributePOptions)1 TtlAction (alluxio.grpc.TtlAction)1 Inode (alluxio.master.file.meta.Inode)1 InodeFile (alluxio.master.file.meta.InodeFile)1 MountTable (alluxio.master.file.meta.MountTable)1 UpdateInodeEntry (alluxio.proto.journal.File.UpdateInodeEntry)1 Fingerprint (alluxio.underfs.Fingerprint)1