gpt4 book ai didi

alluxio.client.WriteType.toProto()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 19:17:05 27 4
gpt4 key购买 nike

本文整理了Java中alluxio.client.WriteType.toProto()方法的一些代码示例,展示了WriteType.toProto()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WriteType.toProto()方法的具体详情如下:
包路径:alluxio.client.WriteType
类名称:WriteType
方法名:toProto

WriteType.toProto介绍

暂无

代码示例

代码示例来源:origin: Alluxio/alluxio

private WritePType getS3WriteType() {
 return ServerConfiguration.getEnum(PropertyKey.PROXY_S3_WRITE_TYPE, WriteType.class).toProto();
}

代码示例来源:origin: Alluxio/alluxio

/**
 * @param filePath the path for the files
 * @param readType the {@link ReadPType}
 * @param writeType the {@link WritePType}
 * @param fsContext the {@link FileSystemContext } to use for client operations
 */
public BasicOperations(AlluxioURI filePath, ReadType readType, WriteType writeType,
  FileSystemContext fsContext) {
 mFilePath = filePath;
 mReadOptions = OpenFilePOptions.newBuilder().setReadType(readType.toProto()).build();
 mWriteOptions = CreateFilePOptions.newBuilder().setWriteType(writeType.toProto())
   .setRecursive(true).build();
 mFsContext = fsContext;
}

代码示例来源:origin: Alluxio/alluxio

private FileOutStream createFile(FileSystem fileSystem, AlluxioURI filePath,
  boolean deleteIfExists) throws IOException, AlluxioException {
 CreateFilePOptions options = CreateFilePOptions.newBuilder().setWriteType(mWriteType.toProto())
   .setRecursive(true).build();
 if (!fileSystem.exists(filePath)) {
  // file doesn't exist yet, so create it
  return fileSystem.createFile(filePath, options);
 } else if (deleteIfExists) {
  // file exists, so delete it and recreate
  fileSystem.delete(filePath);
  return fileSystem.createFile(filePath, options);
 }
 // file exists and deleteIfExists is false
 throw new FileAlreadyExistsException("File exists and deleteIfExists is false");
}

代码示例来源:origin: Alluxio/alluxio

/**
 * @return Master side defaults for {@link CreateDirectoryPOptions}
 */
public static CreateDirectoryPOptions createDirectoryDefaults() {
 return CreateDirectoryPOptions.newBuilder()
   .setCommonOptions(commonDefaults())
   .setMode(ModeUtils.applyDirectoryUMask(Mode.defaults(),
     ServerConfiguration.get(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_UMASK)).toProto())
   .setRecursive(false)
   .setWriteType(ServerConfiguration
     .getEnum(PropertyKey.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.class).toProto())
   .setAllowExists(false).build();
}

代码示例来源:origin: Alluxio/alluxio

/**
 * {@inheritDoc}
 *
 * Moves the file specified in the config to the configured path. If the destination path is a
 * directory, the file is moved inside that directory.
 */
@Override
public SerializableVoid runTask(MoveConfig config, ArrayList<MoveCommand> commands,
  JobWorkerContext jobWorkerContext) throws Exception {
 WriteType writeType = config.getWriteType() == null
   ? ServerConfiguration.getEnum(PropertyKey.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.class)
   : WriteType.valueOf(config.getWriteType());
 for (MoveCommand command : commands) {
  move(command, writeType.toProto(), mFileSystem);
 }
 // Try to delete the source directory if it is empty.
 if (!hasFiles(new AlluxioURI(config.getSource()), mFileSystem)) {
  try {
   LOG.debug("Deleting {}", config.getSource());
   mFileSystem.delete(new AlluxioURI(config.getSource()),
     DeletePOptions.newBuilder().setRecursive(true).build());
  } catch (FileDoesNotExistException e) {
   // It's already deleted, possibly by another worker.
  }
 }
 return null;
}

代码示例来源:origin: Alluxio/alluxio

/**
 * @return Master side defaults for {@link CreateFilePOptions}
 */
public static CreateFilePOptions createFileDefaults() {
 return CreateFilePOptions.newBuilder()
   .setCommonOptions(commonDefaults())
   .setRecursive(false)
   .setBlockSizeBytes(ServerConfiguration.getBytes(PropertyKey.USER_BLOCK_SIZE_BYTES_DEFAULT))
   .setFileWriteLocationPolicy(
     ServerConfiguration.get(PropertyKey.USER_FILE_WRITE_LOCATION_POLICY))
   .setWriteTier(ServerConfiguration.getInt(PropertyKey.USER_FILE_WRITE_TIER_DEFAULT))
   .setWriteType(ServerConfiguration
     .getEnum(PropertyKey.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.class).toProto())
   .setMode(ModeUtils.applyFileUMask(Mode.defaults(),
     ServerConfiguration.get(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_UMASK)).toProto())
   .setReplicationDurable(ServerConfiguration
     .getInt(PropertyKey.USER_FILE_REPLICATION_DURABLE))
   .setReplicationMin(ServerConfiguration.getInt(PropertyKey.USER_FILE_REPLICATION_MIN))
   .setReplicationMax(ServerConfiguration.getInt(PropertyKey.USER_FILE_REPLICATION_MAX))
       .build();
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com