diff --git a/docs/content/development/extensions-core/s3.md b/docs/content/development/extensions-core/s3.md index 53e5df92cd1..c81b7df4028 100644 --- a/docs/content/development/extensions-core/s3.md +++ b/docs/content/development/extensions-core/s3.md @@ -47,9 +47,9 @@ As an example, to set the region to 'us-east-1' through system properties: |`druid.storage.baseKey`|Base key prefix to use, i.e. what directory.|Must be set.| |`druid.storage.disableAcl`|Boolean flag to disable ACL. If this is set to `false`, the full control would be granted to the bucket owner. This may require to set additional permissions. See [S3 permissions settings](#s3-permissions-settings).|false| |`druid.storage.sse.type`|Server-side encryption type. Should be one of `s3`, `kms`, and `custom`. See the below [Server-side encryption section](#server-side-encryption) for more details.|None| -|`druid.storage.sse.kms.keyId`|AWS KMS key ID. Can be empty if `druid.storage.sse.type` is `kms`.|None| +|`druid.storage.sse.kms.keyId`|AWS KMS key ID. This is used only when `druid.storage.sse.type` is `kms` and can be empty to use the default key ID.|None| |`druid.storage.sse.custom.base64EncodedKey`|Base64-encoded key. Should be specified if `druid.storage.sse.type` is `custom`.|None| -|`druid.s3.protocol`|Communication protocol type to use when sending requests to AWS. `http` or `https` can be used.|`https`| +|`druid.s3.protocol`|Communication protocol type to use when sending requests to AWS. `http` or `https` can be used. This configuration would be ignored if `druid.s3.endpoint.url` is filled with a URL with a different protocol.|`https`| |`druid.s3.disableChunkedEncoding`|Disables chunked encoding. See [AWS document](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3Builder.html#disableChunkedEncoding--) for details.|false| |`druid.s3.enablePathStyleAccess`|Enables path style access. See [AWS document](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3Builder.html#enablePathStyleAccess--) for details.|false| |`druid.s3.forceGlobalBucketAccessEnabled`|Enables global bucket access. See [AWS document](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3Builder.html#setForceGlobalBucketAccessEnabled-java.lang.Boolean-) for details.|false| diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java index b8402fab3be..787852ddfbd 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java @@ -1073,16 +1073,13 @@ public class TaskLockbox return true; } - if (!getClass().equals(o.getClass())) { + if (o == null || !getClass().equals(o.getClass())) { return false; } - final TaskLockPosse that = (TaskLockPosse) o; - if (!taskLock.equals(that.taskLock)) { - return false; - } - - return taskIds.equals(that.taskIds); + TaskLockPosse that = (TaskLockPosse) o; + return java.util.Objects.equals(taskLock, that.taskLock) && + java.util.Objects.equals(taskIds, that.taskIds); } @Override diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java index 56042551251..a2a14a006bb 100644 --- a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java +++ b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java @@ -667,6 +667,36 @@ public class TaskLockboxTest Assert.assertTrue(lowLockPosse.getTaskLock().isRevoked()); } + @Test + public void testLockPosseEquals() + { + final Task task1 = NoopTask.create(); + final Task task2 = NoopTask.create(); + + TaskLock taskLock1 = new TaskLock(TaskLockType.EXCLUSIVE, + task1.getGroupId(), + task1.getDataSource(), + Intervals.of("2018/2019"), + "v1", + task1.getPriority()); + + TaskLock taskLock2 = new TaskLock(TaskLockType.EXCLUSIVE, + task2.getGroupId(), + task2.getDataSource(), + Intervals.of("2018/2019"), + "v2", + task2.getPriority()); + + TaskLockPosse taskLockPosse1 = new TaskLockPosse(taskLock1); + TaskLockPosse taskLockPosse2 = new TaskLockPosse(taskLock2); + TaskLockPosse taskLockPosse3 = new TaskLockPosse(taskLock1); + + Assert.assertNotEquals(taskLockPosse1, null); + Assert.assertNotEquals(null, taskLockPosse1); + Assert.assertNotEquals(taskLockPosse1, taskLockPosse2); + Assert.assertEquals(taskLockPosse1, taskLockPosse3); + } + private Set getAllLocks(List tasks) { return tasks.stream()