Search in sources :

Example 1 with ClientProtocol

use of org.apache.hadoop.ozone.client.protocol.ClientProtocol in project ozone by apache.

the class TestOzoneManagerListVolumes method createVolumeWithOwnerAndAcl.

private static void createVolumeWithOwnerAndAcl(ObjectStore objectStore, String volumeName, String ownerName, String aclString) throws IOException {
    ClientProtocol proxy = objectStore.getClientProxy();
    objectStore.createVolume(volumeName);
    proxy.setVolumeOwner(volumeName, ownerName);
    setVolumeAcl(objectStore, volumeName, aclString);
}
Also used : ClientProtocol(org.apache.hadoop.ozone.client.protocol.ClientProtocol)

Example 2 with ClientProtocol

use of org.apache.hadoop.ozone.client.protocol.ClientProtocol in project ozone by apache.

the class TestBucketOwner method createVolumeWithOwnerAndAcl.

private static void createVolumeWithOwnerAndAcl(ObjectStore store, String volumeName, String ownerName, String aclString) throws IOException {
    ClientProtocol proxy = store.getClientProxy();
    store.createVolume(volumeName);
    proxy.setVolumeOwner(volumeName, ownerName);
    setVolumeAcl(store, volumeName, aclString);
}
Also used : ClientProtocol(org.apache.hadoop.ozone.client.protocol.ClientProtocol)

Example 3 with ClientProtocol

use of org.apache.hadoop.ozone.client.protocol.ClientProtocol in project ozone by apache.

the class TestOzoneRpcClientAbstract method testVolumeSetOwner.

@Test
public void testVolumeSetOwner() throws IOException {
    String volumeName = UUID.randomUUID().toString();
    store.createVolume(volumeName);
    String ownerName = "someRandomUser1";
    ClientProtocol proxy = store.getClientProxy();
    proxy.setVolumeOwner(volumeName, ownerName);
    // Set owner again
    proxy.setVolumeOwner(volumeName, ownerName);
}
Also used : ClientProtocol(org.apache.hadoop.ozone.client.protocol.ClientProtocol) Test(org.junit.Test)

Example 4 with ClientProtocol

use of org.apache.hadoop.ozone.client.protocol.ClientProtocol in project ozone by apache.

the class TestOzoneRpcClientAbstract method testBucketSetOwner.

@Test
public void testBucketSetOwner() throws IOException {
    String volumeName = UUID.randomUUID().toString();
    String bucketName = UUID.randomUUID().toString();
    store.createVolume(volumeName);
    store.getVolume(volumeName).createBucket(bucketName);
    String oldOwner = store.getVolume(volumeName).getBucket(bucketName).getOwner();
    String ownerName = "testUser";
    ClientProtocol proxy = store.getClientProxy();
    proxy.setBucketOwner(volumeName, bucketName, ownerName);
    String newOwner = store.getVolume(volumeName).getBucket(bucketName).getOwner();
    assertEquals(ownerName, newOwner);
    assertNotEquals(oldOwner, newOwner);
    store.getVolume(volumeName).deleteBucket(bucketName);
    store.deleteVolume(volumeName);
}
Also used : ClientProtocol(org.apache.hadoop.ozone.client.protocol.ClientProtocol) Test(org.junit.Test)

Example 5 with ClientProtocol

use of org.apache.hadoop.ozone.client.protocol.ClientProtocol in project ozone by apache.

the class TestRecursiveAclWithFSO method createVolumeWithOwnerAndAcl.

private void createVolumeWithOwnerAndAcl(ObjectStore objectStore, String volumeName, String ownerName, String aclString) throws IOException {
    ClientProtocol proxy = objectStore.getClientProxy();
    objectStore.createVolume(volumeName);
    proxy.setVolumeOwner(volumeName, ownerName);
    setVolumeAcl(objectStore, volumeName, aclString);
}
Also used : ClientProtocol(org.apache.hadoop.ozone.client.protocol.ClientProtocol)

Aggregations

ClientProtocol (org.apache.hadoop.ozone.client.protocol.ClientProtocol)9 Test (org.junit.Test)6 OzoneBucket (org.apache.hadoop.ozone.client.OzoneBucket)3 OzoneVolume (org.apache.hadoop.ozone.client.OzoneVolume)3 Path (org.apache.hadoop.fs.Path)2 OFSPath (org.apache.hadoop.ozone.OFSPath)2 OzoneAcl (org.apache.hadoop.ozone.OzoneAcl)2 VolumeArgs (org.apache.hadoop.ozone.client.VolumeArgs)2 ACLType (org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType)2 OzoneAclConfig (org.apache.hadoop.ozone.security.acl.OzoneAclConfig)2 IOException (java.io.IOException)1 FSDataOutputStream (org.apache.hadoop.fs.FSDataOutputStream)1 FileChecksum (org.apache.hadoop.fs.FileChecksum)1 FileStatus (org.apache.hadoop.fs.FileStatus)1 OMException (org.apache.hadoop.ozone.om.exceptions.OMException)1