Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ private void instantiateServices(boolean withNewSnapshot) throws IOException {
multiTenantManager = new OMMultiTenantManagerImpl(this, configuration);
OzoneAclUtils.setOMMultiTenantManager(multiTenantManager);
}
volumeManager = new VolumeManagerImpl(metadataManager, configuration);
volumeManager = new VolumeManagerImpl(metadataManager);
bucketManager = new BucketManagerImpl(metadataManager);
if (secConfig.isSecurityEnabled() || testSecureOmFlag) {
s3SecretManager = new S3SecretManagerImpl(configuration, metadataManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.List;

/**
* OM volume manager interface for read operations on a volume.
* VolumeManager is responsible for read operations on a volume.
*/
public interface VolumeManager extends IOzoneAcl {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.List;
import java.util.Objects;

import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.ozone.OzoneAcl;
import org.apache.hadoop.ozone.om.exceptions.OMException;
import org.apache.hadoop.ozone.om.helpers.OmVolumeArgs;
Expand All @@ -37,30 +36,18 @@
import org.slf4j.LoggerFactory;

/**
* OM volume management code.
* Volume Manager implementation.
*/
public class VolumeManagerImpl implements VolumeManager {
private static final Logger LOG =
LoggerFactory.getLogger(VolumeManagerImpl.class);

private final OMMetadataManager metadataManager;

/**
* Constructor.
* @param conf - Ozone configuration.
* @throws IOException
*/
public VolumeManagerImpl(OMMetadataManager metadataManager,
OzoneConfiguration conf) {
public VolumeManagerImpl(OMMetadataManager metadataManager) {
this.metadataManager = metadataManager;
}

/**
* Gets the volume information.
* @param volume - Volume name.
* @return VolumeArgs or exception is thrown.
* @throws IOException
*/
@Override
public OmVolumeArgs getVolumeInfo(String volume) throws IOException {
Preconditions.checkNotNull(volume);
Expand All @@ -86,9 +73,6 @@ public OmVolumeArgs getVolumeInfo(String volume) throws IOException {
}
}

/**
* {@inheritDoc}
*/
@Override
public List<OmVolumeArgs> listVolumes(String userName,
String prefix, String startKey, int maxKeys) throws IOException {
Expand All @@ -100,14 +84,6 @@ public List<OmVolumeArgs> listVolumes(String userName,
}
}

/**
* Add acl for Ozone object. Return true if acl is added successfully else
* false.
*
* @param obj Ozone object for which acl should be added.
* @param acl ozone acl to be added.
* @throws IOException if there is error.
*/
@Override
public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
Objects.requireNonNull(obj);
Expand Down Expand Up @@ -144,14 +120,6 @@ public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
return false;
}

/**
* Remove acl for Ozone object. Return true if acl is removed successfully
* else false.
*
* @param obj Ozone object.
* @param acl Ozone acl to be removed.
* @throws IOException if there is error.
*/
@Override
public boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
Objects.requireNonNull(obj);
Expand All @@ -177,7 +145,6 @@ public boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
}

Preconditions.checkState(volume.equals(volumeArgs.getVolume()));
//return volumeArgs.getAclMap().hasAccess(userAcl);
} catch (IOException ex) {
if (!(ex instanceof OMException)) {
LOG.error("Remove acl operation failed for volume:{} acl:{}",
Expand All @@ -191,14 +158,6 @@ public boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
return false;
}

/**
* Acls to be set for given Ozone object. This operations reset ACL for given
* object to list of ACLs provided in argument.
*
* @param obj Ozone object.
* @param acls List of acls.
* @throws IOException if there is error.
*/
@Override
public boolean setAcl(OzoneObj obj, List<OzoneAcl> acls) throws IOException {
Objects.requireNonNull(obj);
Expand All @@ -223,7 +182,6 @@ public boolean setAcl(OzoneObj obj, List<OzoneAcl> acls) throws IOException {
metadataManager.getVolumeTable().put(dbVolumeKey, volumeArgs);

Preconditions.checkState(volume.equals(volumeArgs.getVolume()));
//return volumeArgs.getAclMap().hasAccess(userAcl);
} catch (IOException ex) {
if (!(ex instanceof OMException)) {
LOG.error("Set acl operation failed for volume:{} acls:{}",
Expand All @@ -237,12 +195,6 @@ public boolean setAcl(OzoneObj obj, List<OzoneAcl> acls) throws IOException {
return true;
}

/**
* Returns list of ACLs for given Ozone object.
*
* @param obj Ozone object.
* @throws IOException if there is error.
*/
@Override
public List<OzoneAcl> getAcl(OzoneObj obj) throws IOException {
Objects.requireNonNull(obj);
Expand Down Expand Up @@ -275,13 +227,6 @@ public List<OzoneAcl> getAcl(OzoneObj obj) throws IOException {
}
}

/**
* Check access for given ozoneObject.
*
* @param ozObject object for which access needs to be checked.
* @param context Context object encapsulating all user related information.
* @return true if user has access else false.
*/
@Override
public boolean checkAccess(OzoneObj ozObject, RequestContext context)
throws OMException {
Expand Down