public static StorageVolume fromFileStoreInfo(FileStoreInfo fsInfo) throws DdlException {
        String svt = fsInfo.getFsType().toString();
        Map<String, String> params = getParamsFromFileStoreInfo(fsInfo);
        return new StorageVolume(fsInfo.getFsKey(), fsInfo.getFsName(), svt,
                fsInfo.getLocationsList(), params, fsInfo.getEnabled(), fsInfo.getComment());
    }
@Test
    public void testFromFileStoreInfo() throws DdlException {
        AwsSimpleCredentialInfo simpleCredentialInfo = AwsSimpleCredentialInfo.newBuilder()
                .setAccessKey("ak").setAccessKeySecret("sk").build();
        AwsCredentialInfo credentialInfo = AwsCredentialInfo.newBuilder().setSimpleCredential(simpleCredentialInfo).build();
        S3FileStoreInfo s3fs = S3FileStoreInfo.newBuilder().setBucket("/bucket")
                .setEndpoint("endpoint").setRegion("region").setCredential(credentialInfo).build();
        FileStoreInfo fs = FileStoreInfo.newBuilder().setS3FsInfo(s3fs).setFsKey("0").setFsType(FileStoreType.S3).build();
        StorageVolume sv = StorageVolume.fromFileStoreInfo(fs);
        Assert.assertEquals(CloudType.AWS, sv.getCloudConfiguration().getCloudType());

        AwsAssumeIamRoleCredentialInfo assumeIamRoleCredentialInfo = AwsAssumeIamRoleCredentialInfo.newBuilder()
                .setIamRoleArn("role-Arn").setExternalId("externId").build();
        credentialInfo = AwsCredentialInfo.newBuilder().setAssumeRoleCredential(assumeIamRoleCredentialInfo).build();
        s3fs = S3FileStoreInfo.newBuilder().setBucket("/bucket")
                .setEndpoint("endpoint").setRegion("region").setCredential(credentialInfo).build();
        fs = FileStoreInfo.newBuilder().setS3FsInfo(s3fs).setFsKey("0").setFsType(FileStoreType.S3).build();
        sv = StorageVolume.fromFileStoreInfo(fs);
        Assert.assertEquals(CloudType.AWS, sv.getCloudConfiguration().getCloudType());
        AwsDefaultCredentialInfo defaultCredentialInfo = AwsDefaultCredentialInfo.newBuilder().build();
        credentialInfo = AwsCredentialInfo.newBuilder().setDefaultCredential(defaultCredentialInfo).build();
        s3fs = S3FileStoreInfo.newBuilder().setBucket("/bucket")
                .setEndpoint("endpoint").setRegion("region").setCredential(credentialInfo).build();
        fs = FileStoreInfo.newBuilder().setS3FsInfo(s3fs).setFsKey("0").setFsType(FileStoreType.S3).build();
        sv = StorageVolume.fromFileStoreInfo(fs);
        Assert.assertEquals(CloudType.AWS, sv.getCloudConfiguration().getCloudType());

        AwsInstanceProfileCredentialInfo instanceProfileCredentialInfo = AwsInstanceProfileCredentialInfo.newBuilder().build();
        credentialInfo = AwsCredentialInfo.newBuilder().setProfileCredential(instanceProfileCredentialInfo).build();
        s3fs = S3FileStoreInfo.newBuilder().setBucket("/bucket")
                .setEndpoint("endpoint").setRegion("region").setCredential(credentialInfo).build();
        fs = FileStoreInfo.newBuilder().setS3FsInfo(s3fs).setFsKey("0").setFsType(FileStoreType.S3).build();
        sv = StorageVolume.fromFileStoreInfo(fs);
        Assert.assertEquals(CloudType.AWS, sv.getCloudConfiguration().getCloudType());

        HDFSFileStoreInfo hdfs = HDFSFileStoreInfo.newBuilder().setUsername("username")
                .putConfiguration(HDFS_AUTHENTICATION, "simple")
                .putConfiguration("dfs.nameservices", "ha_cluster")
                .putConfiguration("dfs.ha.namenodes.ha_cluster", "ha_n1,ha_n2")
                .putConfiguration("dfs.namenode.rpc-address.ha_cluster.ha_n1", "<hdfs_host>:<hdfs_port>")
                .putConfiguration("dfs.namenode.rpc-address.ha_cluster.ha_n2", "<hdfs_host>:<hdfs_port>")
                .putConfiguration("dfs.client.failover.proxy.provider",
                        "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider").build();
        fs = FileStoreInfo.newBuilder().setHdfsFsInfo(hdfs).setFsKey("0").setFsType(FileStoreType.HDFS).build();
        sv = StorageVolume.fromFileStoreInfo(fs);
        Assert.assertEquals(CloudType.HDFS, sv.getCloudConfiguration().getCloudType());

        hdfs = HDFSFileStoreInfo.newBuilder().putConfiguration(HDFS_AUTHENTICATION, "kerberos")
                .putConfiguration(HDFS_KERBEROS_PRINCIPAL_DEPRECATED, "nn/abc@ABC.COM")
                .putConfiguration(HDFS_KERBEROS_KEYTAB_DEPRECATED, "/keytab/hive.keytab")
                .putConfiguration(HDFS_KERBEROS_KEYTAB_CONTENT_DEPRECATED, "YWFhYWFh").build();
        fs = FileStoreInfo.newBuilder().setHdfsFsInfo(hdfs).setFsKey("0").setFsType(FileStoreType.HDFS).build();
        sv = StorageVolume.fromFileStoreInfo(fs);
        Assert.assertEquals(CloudType.HDFS, sv.getCloudConfiguration().getCloudType());
    }