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 @@ -264,6 +264,7 @@ private OzoneConsts() {
public static final String UPLOAD_ID = "uploadID";
public static final String PART_NUMBER_MARKER = "partNumberMarker";
public static final String MAX_PARTS = "maxParts";
public static final String S3_BUCKET = "s3Bucket";



Expand Down Expand Up @@ -303,4 +304,8 @@ private OzoneConsts() {
public static final String JAVA_TMP_DIR = "java.io.tmpdir";
public static final String LOCALHOST = "localhost";


public static final int S3_BUCKET_MIN_LENGTH = 3;
public static final int S3_BUCKET_MAX_LENGTH = 64;

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public enum OMAction implements AuditAction {
UPDATE_KEY,
PURGE_KEYS,

// S3 Bucket
CREATE_S3_BUCKET,

// READ Actions
CHECK_VOLUME_ACCESS,
LIST_BUCKETS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,7 @@ public enum ResultCodes {

PREFIX_NOT_FOUND,

S3_BUCKET_INVALID_LENGTH

}
}
13 changes: 13 additions & 0 deletions hadoop-ozone/common/src/main/proto/OzoneManagerProtocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ enum Status {
PERMISSION_DENIED = 48;
TIMEOUT = 49;
PREFIX_NOT_FOUND=50;

S3_BUCKET_INVALID_LENGTH = 51; // s3 bucket invalid length.
}


Expand Down Expand Up @@ -860,6 +862,17 @@ message ServiceInfo {
message S3CreateBucketRequest {
required string userName = 1;
required string s3bucketname = 2;
// This will be set during OM HA by one of the OM node. In future if more
// data fields are required to create volume/bucket we can add them to
// this. This is the reason for creating a new message type for this.
// S3CreateBucket means create volume from userName and create bucket
// with s3BucketName.
optional S3CreateVolumeInfo s3CreateVolumeInfo = 3;
}

message S3CreateVolumeInfo {
// Creation time set in preExecute on one of the OM node.
required uint64 creationTime = 1;
}

message S3CreateBucketResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,24 @@ public class OMMetrics {

private @Metric MutableCounterLong numVolumes;
private @Metric MutableCounterLong numBuckets;
private @Metric MutableCounterLong numS3Buckets;

//TODO: This metric is an estimate and it may be inaccurate on restart if the
// OM process was not shutdown cleanly. Key creations/deletions in the last
// few minutes before restart may not be included in this count.
private @Metric MutableCounterLong numKeys;



// Metrics to track checkpointing statistics from last run.
private @Metric MutableGaugeLong lastCheckpointCreationTimeTaken;
private @Metric MutableGaugeLong lastCheckpointTarOperationTimeTaken;
private @Metric MutableGaugeLong lastCheckpointStreamingTimeTaken;

private @Metric MutableCounterLong numS3BucketCreates;
private @Metric MutableCounterLong numS3BucketCreateFails;


public OMMetrics() {
}

Expand All @@ -134,6 +141,23 @@ public static OMMetrics create() {
new OMMetrics());
}

public void incNumS3BucketCreates() {
numBucketOps.incr();
numS3BucketCreates.incr();
}

public void incNumS3BucketCreateFails() {
numS3BucketCreateFails.incr();
}

public void incNumS3Buckets() {
numS3Buckets.incr();
}

public void decNumS3Buckets() {
numS3Buckets.incr();
}

public void incNumVolumes() {
numVolumes.incr();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ private void cleanupCache(long lastRatisTransactionIndex) {
omMetadataManager.getOpenKeyTable().cleanupCache(lastRatisTransactionIndex);
omMetadataManager.getKeyTable().cleanupCache(lastRatisTransactionIndex);
omMetadataManager.getDeletedTable().cleanupCache(lastRatisTransactionIndex);
omMetadataManager.getS3Table().cleanupCache(lastRatisTransactionIndex);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.hadoop.ozone.om.request.key.OMKeyDeleteRequest;
import org.apache.hadoop.ozone.om.request.key.OMKeyPurgeRequest;
import org.apache.hadoop.ozone.om.request.key.OMKeyRenameRequest;
import org.apache.hadoop.ozone.om.request.s3.bucket.S3BucketCreateRequest;
import org.apache.hadoop.ozone.om.request.volume.OMVolumeCreateRequest;
import org.apache.hadoop.ozone.om.request.volume.OMVolumeDeleteRequest;
import org.apache.hadoop.ozone.om.request.volume.OMVolumeSetOwnerRequest;
Expand Down Expand Up @@ -99,6 +100,8 @@ public static OMClientRequest createClientRequest(OMRequest omRequest) {
return new OMFileCreateRequest(omRequest);
case PurgeKeys:
return new OMKeyPurgeRequest(omRequest);
case CreateS3Bucket:
return new S3BucketCreateRequest(omRequest);
default:
// TODO: will update once all request types are implemented.
return null;
Expand Down
Loading