@Test public void getPermissionsNoMapping() throws Exception { Map<PropertyKey, String> conf = new HashMap<>(); conf.put(PropertyKey.UNDERFS_S3_OWNER_ID_TO_USERNAME_MAPPING, "111=userid"); try (Closeable c = new ConfigurationRule(conf, sConf).toResource()) { UnderFileSystemConfiguration ufsConf = UnderFileSystemConfiguration.defaults(sConf); mS3UnderFileSystem = new S3AUnderFileSystem(new AlluxioURI("s3a: mExecutor, mManager, UnderFileSystemConfiguration.defaults(sConf), false); } Mockito.when(mClient.getS3AccountOwner()).thenReturn(new Owner("0", "test")); Mockito.when(mClient.getBucketAcl(Mockito.anyString())).thenReturn(new AccessControlList()); ObjectUnderFileSystem.ObjectPermissions permissions = mS3UnderFileSystem.getPermissions(); Assert.assertEquals("test", permissions.getOwner()); Assert.assertEquals("test", permissions.getGroup()); Assert.assertEquals(0, permissions.getMode()); }
@Override protected ObjectPermissions getPermissions() { return mPermissions.get(); }
S3AUnderFileSystem extends ObjectUnderFileSystem { @Override protected ObjectPermissions getPermissions() { return mPermissions.get(); } }
S3AUnderFileSystem extends ObjectUnderFileSystem { @Override protected ObjectPermissions getPermissions() { return mPermissions.get(); } protected  S3AUnderFileSystem(AlluxioURI uri, AmazonS3Client amazonS3Client, String bucketName,
      ExecutorService executor, TransferManager transferManager, UnderFileSystemConfiguration conf,
      boolean streamingUploadEnabled); }
S3AUnderFileSystem extends ObjectUnderFileSystem { @Override protected ObjectPermissions getPermissions() { return mPermissions.get(); } protected  S3AUnderFileSystem(AlluxioURI uri, AmazonS3Client amazonS3Client, String bucketName,
      ExecutorService executor, TransferManager transferManager, UnderFileSystemConfiguration conf,
      boolean streamingUploadEnabled); static AWSCredentialsProvider createAwsCredentialsProvider(
      UnderFileSystemConfiguration conf); static S3AUnderFileSystem createInstance(AlluxioURI uri,
      UnderFileSystemConfiguration conf); @Override String getUnderFSType(); @Override void setOwner(String path, String user, String group); @Override void setMode(String path, short mode); @Override void cleanup(); @Override boolean createEmptyObject(String key); }
S3AUnderFileSystem extends ObjectUnderFileSystem { @Override protected ObjectPermissions getPermissions() { return mPermissions.get(); } protected  S3AUnderFileSystem(AlluxioURI uri, AmazonS3Client amazonS3Client, String bucketName,
      ExecutorService executor, TransferManager transferManager, UnderFileSystemConfiguration conf,
      boolean streamingUploadEnabled); static AWSCredentialsProvider createAwsCredentialsProvider(
      UnderFileSystemConfiguration conf); static S3AUnderFileSystem createInstance(AlluxioURI uri,
      UnderFileSystemConfiguration conf); @Override String getUnderFSType(); @Override void setOwner(String path, String user, String group); @Override void setMode(String path, short mode); @Override void cleanup(); @Override boolean createEmptyObject(String key);  }