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 @@ -38,6 +38,10 @@
*/
public class SelectorOutputStream<OUT extends OutputStream>
extends OutputStream implements Syncable, StreamCapabilities {

private final ByteArrayBuffer buffer;
private final Underlying underlying;

/** A buffer backed by a byte[]. */
static final class ByteArrayBuffer {
private byte[] array;
Expand Down Expand Up @@ -108,9 +112,6 @@ private OUT select(int outstandingBytes, boolean force) throws IOException {
}
}

private final ByteArrayBuffer buffer;
private final Underlying underlying;

/**
* Construct a {@link SelectorOutputStream} which first writes to a buffer.
* Once the buffer has become full, select an {@link OutputStream}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ public final class OmBucketInfo extends WithObjectID implements Auditable, CopyO
OmBucketInfo::getProtobuf,
OmBucketInfo.class);

public static Codec<OmBucketInfo> getCodec() {
return CODEC;
}

/**
* Name of the volume in which the bucket belongs to.
*/
Expand Down Expand Up @@ -129,6 +125,10 @@ private OmBucketInfo(Builder b) {
this.defaultReplicationConfig = b.defaultReplicationConfig;
}

public static Codec<OmBucketInfo> getCodec() {
return CODEC;
}

/**
* Returns the Volume Name.
* @return String.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ public final class OmDBAccessIdInfo {
OmDBAccessIdInfo.class,
DelegatedCodec.CopyType.SHALLOW);

public static Codec<OmDBAccessIdInfo> getCodec() {
return CODEC;
}

/**
* Name of the tenant.
*/
Expand All @@ -66,6 +62,10 @@ public OmDBAccessIdInfo(String tenantId, String userPrincipal,
this.isDelegatedAdmin = isDelegatedAdmin;
}

public static Codec<OmDBAccessIdInfo> getCodec() {
return CODEC;
}

public String getTenantId() {
return tenantId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ public final class OmDBTenantState implements Comparable<OmDBTenantState> {
OmDBTenantState.class,
DelegatedCodec.CopyType.SHALLOW);

public static Codec<OmDBTenantState> getCodec() {
return CODEC;
}

/**
* Name of the tenant.
*/
Expand Down Expand Up @@ -76,6 +72,10 @@ public OmDBTenantState(String tenantId, String bucketNamespaceName,
this.bucketPolicyName = bucketPolicyName;
}

public static Codec<OmDBTenantState> getCodec() {
return CODEC;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ public final class OmDBUserPrincipalInfo {
OmDBUserPrincipalInfo::getProtobuf,
OmDBUserPrincipalInfo.class);

public static Codec<OmDBUserPrincipalInfo> getCodec() {
return CODEC;
}

/**
* A set of accessIds.
*/
Expand All @@ -51,6 +47,10 @@ public OmDBUserPrincipalInfo(Set<String> accessIds) {
this.accessIds = new HashSet<>(accessIds);
}

public static Codec<OmDBUserPrincipalInfo> getCodec() {
return CODEC;
}

public Set<String> getAccessIds() {
return accessIds;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ public class OmDirectoryInfo extends WithParentObjectId
OmDirectoryInfo::getProtobuf,
OmDirectoryInfo.class);

public static Codec<OmDirectoryInfo> getCodec() {
return CODEC;
}

private final String name; // directory name
private String owner;

Expand All @@ -63,6 +59,10 @@ public OmDirectoryInfo(Builder builder) {
this.modificationTime = builder.modificationTime;
}

public static Codec<OmDirectoryInfo> getCodec() {
return CODEC;
}

/**
* Returns new builder class that builds a OmPrefixInfo.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,6 @@ public final class OmKeyInfo extends WithParentObjectId
private static final Codec<OmKeyInfo> CODEC_TRUE = newCodec(true);
private static final Codec<OmKeyInfo> CODEC_FALSE = newCodec(false);

private static Codec<OmKeyInfo> newCodec(boolean ignorePipeline) {
return new DelegatedCodec<>(
Proto2Codec.get(KeyInfo.getDefaultInstance()),
OmKeyInfo::getFromProtobuf,
k -> k.getProtobuf(ignorePipeline, ClientVersion.CURRENT_VERSION),
OmKeyInfo.class);
}

public static Codec<OmKeyInfo> getCodec(boolean ignorePipeline) {
LOG.debug("OmKeyInfo.getCodec ignorePipeline = {}", ignorePipeline);
return ignorePipeline ? CODEC_TRUE : CODEC_FALSE;
}

private final String volumeName;
private final String bucketName;
// name of key client specified
Expand Down Expand Up @@ -134,6 +121,19 @@ private OmKeyInfo(Builder b) {
this.expectedDataGeneration = b.expectedDataGeneration;
}

private static Codec<OmKeyInfo> newCodec(boolean ignorePipeline) {
return new DelegatedCodec<>(
Proto2Codec.get(KeyInfo.getDefaultInstance()),
OmKeyInfo::getFromProtobuf,
k -> k.getProtobuf(ignorePipeline, ClientVersion.CURRENT_VERSION),
OmKeyInfo.class);
}

public static Codec<OmKeyInfo> getCodec(boolean ignorePipeline) {
LOG.debug("OmKeyInfo.getCodec ignorePipeline = {}", ignorePipeline);
return ignorePipeline ? CODEC_TRUE : CODEC_FALSE;
}

public String getVolumeName() {
return volumeName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,35 @@ public final class OmMultipartKeyInfo extends WithObjectID implements CopyObject
OmMultipartKeyInfo::getProto,
OmMultipartKeyInfo.class);

private final String uploadID;
private final long creationTime;
private final ReplicationConfig replicationConfig;
private PartKeyInfoMap partKeyInfoMap;

/**
* A pointer to parent directory used for path traversal. ParentID will be
* used only when the multipart key is created into a FileSystemOptimized(FSO)
* bucket.
* <p>
* For example, if a key "a/b/multiKey1" created into a FSOBucket then each
* path component will be assigned an ObjectId and linked to its parent path
* component using parent's objectID.
* <p>
* Say, Bucket's ObjectID = 512, which is the parent for its immediate child
* element.
* <p>
* ------------------------------------------|
* PathComponent | ObjectID | ParentID |
* ------------------------------------------|
* a | 1024 | 512 |
* ------------------------------------------|
* b | 1025 | 1024 |
* ------------------------------------------|
* multiKey1 | 1026 | 1025 |
* ------------------------------------------|
*/
private final long parentID;

public static Codec<OmMultipartKeyInfo> getCodec() {
return CODEC;
}
Expand All @@ -63,6 +92,8 @@ public static class PartKeyInfoMap implements Iterable<PartKeyInfo> {
return Integer.compare(partNumber1, partNumber2);
};

private final List<PartKeyInfo> sorted;

/**
* Adds a PartKeyInfo to sortedPartKeyInfoList.
* If a partKeyInfo with the same PartNumber is in the array, the old value
Expand Down Expand Up @@ -93,8 +124,6 @@ static PartKeyInfoMap put(PartKeyInfo partKeyInfo,
return new PartKeyInfoMap(list);
}

private final List<PartKeyInfo> sorted;

PartKeyInfoMap(List<PartKeyInfo> sorted) {
this.sorted = Collections.unmodifiableList(sorted);
}
Expand Down Expand Up @@ -130,35 +159,6 @@ public PartKeyInfo lastEntry() {
}
}

private final String uploadID;
private final long creationTime;
private final ReplicationConfig replicationConfig;
private PartKeyInfoMap partKeyInfoMap;

/**
* A pointer to parent directory used for path traversal. ParentID will be
* used only when the multipart key is created into a FileSystemOptimized(FSO)
* bucket.
* <p>
* For example, if a key "a/b/multiKey1" created into a FSOBucket then each
* path component will be assigned an ObjectId and linked to its parent path
* component using parent's objectID.
* <p>
* Say, Bucket's ObjectID = 512, which is the parent for its immediate child
* element.
* <p>
* ------------------------------------------|
* PathComponent | ObjectID | ParentID |
* ------------------------------------------|
* a | 1024 | 512 |
* ------------------------------------------|
* b | 1025 | 1024 |
* ------------------------------------------|
* multiKey1 | 1026 | 1025 |
* ------------------------------------------|
*/
private final long parentID;

/**
* Construct OmMultipartKeyInfo object which holds multipart upload
* information for a key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ public final class OmVolumeArgs extends WithObjectID
OmVolumeArgs::getProtobuf,
OmVolumeArgs.class);

public static Codec<OmVolumeArgs> getCodec() {
return CODEC;
}

private final String adminName;
private String ownerName;
private final String volume;
Expand Down Expand Up @@ -87,6 +83,10 @@ private OmVolumeArgs(Builder b) {
this.refCount = b.refCount;
}

public static Codec<OmVolumeArgs> getCodec() {
return CODEC;
}

public long getRefCount() {
Preconditions.checkState(refCount >= 0L, "refCount should not be negative");
return refCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
public final class OzoneAclUtil {
static final Logger LOG = LoggerFactory.getLogger(OzoneAclUtil.class);

private OzoneAclUtil() {
}

private static ACLType[] userRights;
private static ACLType[] groupRights;

private OzoneAclUtil() {
}

/**
* Helper function to get default access acl list for current user.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class RepeatedOmKeyInfo implements CopyObject<RepeatedOmKeyInfo> {
private static final Codec<RepeatedOmKeyInfo> CODEC_TRUE = newCodec(true);
private static final Codec<RepeatedOmKeyInfo> CODEC_FALSE = newCodec(false);

private final List<OmKeyInfo> omKeyInfoList;

private static Codec<RepeatedOmKeyInfo> newCodec(boolean ignorePipeline) {
return new DelegatedCodec<>(
Proto2Codec.get(RepeatedKeyInfo.getDefaultInstance()),
Expand All @@ -53,8 +55,6 @@ public static Codec<RepeatedOmKeyInfo> getCodec(boolean ignorePipeline) {
return ignorePipeline ? CODEC_TRUE : CODEC_FALSE;
}

private final List<OmKeyInfo> omKeyInfoList;

public RepeatedOmKeyInfo() {
this.omKeyInfoList = new ArrayList<>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ public final class S3SecretValue {
S3SecretValue::getProtobuf,
S3SecretValue.class);

public static Codec<S3SecretValue> getCodec() {
return CODEC;
}

// TODO: This field should be renamed to accessId for generalization.
private final String kerberosID;
private final String awsSecret;
private final boolean isDeleted;
private final long transactionLogIndex;

public static Codec<S3SecretValue> getCodec() {
return CODEC;
}

public static S3SecretValue of(String kerberosID, String awsSecret) {
return of(kerberosID, awsSecret, 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ public class SnapshotDiffJob {
private static final Codec<SnapshotDiffJob> CODEC =
new SnapshotDiffJobCodec();

public static Codec<SnapshotDiffJob> getCodec() {
return CODEC;
}

private long creationTime;
private String jobId;
private JobStatus status;
Expand Down Expand Up @@ -95,6 +91,10 @@ public SnapshotDiffJob(long creationTime,
this.keysProcessedPct = keysProcessedPct;
}

public static Codec<SnapshotDiffJob> getCodec() {
return CODEC;
}

public String getJobId() {
return jobId;
}
Expand Down
Loading