You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "gargvishesh (via GitHub)" <gi...@apache.org> on 2024/03/08 07:23:58 UTC
[PR] Change last update timestamp granularity of GCS objects from seconds to milliseconds (druid)
gargvishesh opened a new pull request, #16083:
URL: https://github.com/apache/druid/pull/16083
The previously used GCS API client library returned last update time for objects directly in milliseconds. The new library returns it in `OffsetDateTime` format which was being converted to seconds and stored against the object. This fix converts the time back to ms before storing it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Change last update timestamp granularity of GCS objects from seconds to milliseconds (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #16083:
URL: https://github.com/apache/druid/pull/16083#discussion_r1517484572
##########
extensions-core/google-extensions/src/test/java/org/apache/druid/storage/google/GoogleStorageTest.java:
##########
@@ -159,7 +160,33 @@ public void testGetMetadata() throws IOException
EasyMock.replay(mockStorage, blob);
GoogleStorageObjectMetadata objectMetadata = googleStorage.getMetadata(BUCKET, PATH);
- assertEquals(objectMetadata, new GoogleStorageObjectMetadata(BUCKET, PATH, SIZE, UPDATE_TIME.toEpochSecond()));
+ assertEquals(
+ objectMetadata,
+ new GoogleStorageObjectMetadata(BUCKET, PATH, SIZE, UPDATE_TIME.toEpochSecond() * 1000)
+ );
+
+ }
+ @Test
+ public void testGetMetadataMismatch() throws IOException
Review Comment:
Oh, I think it is the same as the above test `testGetMetadataMismatch()` except that it verifies that the timestamp is __not in seconds__ .
@gargvishesh , I think the previous test `testGetMetadata()` is enough.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Change last update timestamp granularity of GCS objects from seconds to milliseconds (druid)
Posted by "gargvishesh (via GitHub)" <gi...@apache.org>.
gargvishesh commented on code in PR #16083:
URL: https://github.com/apache/druid/pull/16083#discussion_r1517585996
##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/duty/TaskLogAutoCleanerConfig.java:
##########
@@ -43,18 +43,18 @@ public class TaskLogAutoCleanerConfig
private final long delay;
@JsonProperty
- private final long durationToRetain;
+ private final long durationToRetainMs;
@JsonCreator
public TaskLogAutoCleanerConfig(
@JsonProperty("enabled") boolean enabled,
@JsonProperty("initialDelay") Long initialDelay,
@JsonProperty("delay") Long delay,
- @JsonProperty("durationToRetain") Long durationToRetain
+ @JsonProperty("durationToRetain") Long durationToRetainMs
Review Comment:
Reverted and added the javadoc instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Change last update timestamp granularity of GCS objects from seconds to milliseconds (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #16083:
URL: https://github.com/apache/druid/pull/16083#discussion_r1517347552
##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/duty/TaskLogAutoCleanerConfig.java:
##########
@@ -43,18 +43,18 @@ public class TaskLogAutoCleanerConfig
private final long delay;
@JsonProperty
- private final long durationToRetain;
+ private final long durationToRetainMs;
@JsonCreator
public TaskLogAutoCleanerConfig(
@JsonProperty("enabled") boolean enabled,
@JsonProperty("initialDelay") Long initialDelay,
@JsonProperty("delay") Long delay,
- @JsonProperty("durationToRetain") Long durationToRetain
+ @JsonProperty("durationToRetain") Long durationToRetainMs
Review Comment:
If this is being changed, other fields such as `initialDelay`, `delay` should be changed too.
I think it is okay to keep it the way it is as the name `durationToRetain` is being used in several other configs too. You could add javadocs to clarify the usage though.
##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/duty/TaskLogAutoCleanerConfig.java:
##########
@@ -43,18 +43,18 @@ public class TaskLogAutoCleanerConfig
private final long delay;
@JsonProperty
- private final long durationToRetain;
+ private final long durationToRetainMs;
@JsonCreator
public TaskLogAutoCleanerConfig(
@JsonProperty("enabled") boolean enabled,
@JsonProperty("initialDelay") Long initialDelay,
@JsonProperty("delay") Long delay,
- @JsonProperty("durationToRetain") Long durationToRetain
+ @JsonProperty("durationToRetain") Long durationToRetainMs
Review Comment:
If this is being changed, other fields such as `initialDelay`, `delay` should be changed too.
So I think it is okay to keep it the way it is as the name `durationToRetain` is being used in several other configs too. You could add javadocs to clarify the usage though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Change last update timestamp granularity of GCS objects from seconds to milliseconds (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #16083:
URL: https://github.com/apache/druid/pull/16083#discussion_r1517484572
##########
extensions-core/google-extensions/src/test/java/org/apache/druid/storage/google/GoogleStorageTest.java:
##########
@@ -159,7 +160,33 @@ public void testGetMetadata() throws IOException
EasyMock.replay(mockStorage, blob);
GoogleStorageObjectMetadata objectMetadata = googleStorage.getMetadata(BUCKET, PATH);
- assertEquals(objectMetadata, new GoogleStorageObjectMetadata(BUCKET, PATH, SIZE, UPDATE_TIME.toEpochSecond()));
+ assertEquals(
+ objectMetadata,
+ new GoogleStorageObjectMetadata(BUCKET, PATH, SIZE, UPDATE_TIME.toEpochSecond() * 1000)
+ );
+
+ }
+ @Test
+ public void testGetMetadataMismatch() throws IOException
Review Comment:
Oh, I think it is the same as the above test `testGetMetadataMismatch()` but verifies that the timestamp is __not in seconds__ .
@gargvishesh , I think the previous test `testGetMetadata()` is enough.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Change last update timestamp granularity of GCS objects from seconds to milliseconds (druid)
Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe commented on PR #16083:
URL: https://github.com/apache/druid/pull/16083#issuecomment-1992149741
Caused because of : https://github.com/apache/druid/pull/15398
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Change last update timestamp granularity of GCS objects from seconds to milliseconds (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #16083:
URL: https://github.com/apache/druid/pull/16083#issuecomment-1985211021
@gargvishesh , thanks for the fix. `GoogleStorageTest` might need to be updated too.
Can we also add a test that ensures that the correct millisecond value is being used now instead of second?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Change last update timestamp granularity of GCS objects from seconds to milliseconds (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #16083:
URL: https://github.com/apache/druid/pull/16083#discussion_r1517344526
##########
extensions-core/google-extensions/src/main/java/org/apache/druid/storage/google/GoogleStorageObjectMetadata.java:
##########
@@ -26,19 +26,24 @@ public class GoogleStorageObjectMetadata
final String bucket;
final String name;
final Long size;
- Long lastUpdateTime;
+ Long lastUpdateTimeMs;
Review Comment:
Maybe use `lastUpdateTimeMillis` and `timestampMillis` as that is the nomenclature used in most other Druid places (with some exceptions).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Change last update timestamp granularity of GCS objects from seconds to milliseconds (druid)
Posted by "abhishekagarwal87 (via GitHub)" <gi...@apache.org>.
abhishekagarwal87 commented on code in PR #16083:
URL: https://github.com/apache/druid/pull/16083#discussion_r1517461388
##########
extensions-core/google-extensions/src/test/java/org/apache/druid/storage/google/GoogleStorageTest.java:
##########
@@ -159,7 +160,33 @@ public void testGetMetadata() throws IOException
EasyMock.replay(mockStorage, blob);
GoogleStorageObjectMetadata objectMetadata = googleStorage.getMetadata(BUCKET, PATH);
- assertEquals(objectMetadata, new GoogleStorageObjectMetadata(BUCKET, PATH, SIZE, UPDATE_TIME.toEpochSecond()));
+ assertEquals(
+ objectMetadata,
+ new GoogleStorageObjectMetadata(BUCKET, PATH, SIZE, UPDATE_TIME.toEpochSecond() * 1000)
+ );
+
+ }
+ @Test
+ public void testGetMetadataMismatch() throws IOException
Review Comment:
what is this test for?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Change last update timestamp granularity of GCS objects from seconds to milliseconds (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz merged PR #16083:
URL: https://github.com/apache/druid/pull/16083
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org