github-advanced-security[bot] commented on code in PR #19915:
URL: https://github.com/apache/druid/pull/19915#discussion_r3736014417
##########
extensions-contrib/aliyun-oss-extensions/src/test/java/org/apache/druid/data/input/aliyun/OssInputSourceTest.java:
##########
@@ -538,20 +543,20 @@
InputSourceReader reader = inputSource.reader(
someSchema,
new CsvInputFormat(ImmutableList.of("time", "dim1", "dim2"), "|",
false, null, 0, null),
- temporaryFolder.newFolder()
+ newFolder(temporaryFolder, "junit")
);
final InputStats inputStats = new InputStatsImpl();
CloseableIterator<InputRow> iterator = reader.read(inputStats);
while (iterator.hasNext()) {
InputRow nextRow = iterator.next();
- Assert.assertEquals(NOW, nextRow.getTimestamp());
- Assert.assertEquals("hello", nextRow.getDimension("dim1").get(0));
- Assert.assertEquals("world", nextRow.getDimension("dim2").get(0));
+ Assertions.assertEquals(NOW, nextRow.getTimestamp());
+ Assertions.assertEquals("hello", nextRow.getDimension("dim1").get(0));
+ Assertions.assertEquals("world", nextRow.getDimension("dim2").get(0));
}
- Assert.assertEquals(2 * CONTENT.length, inputStats.getProcessedBytes());
+ Assertions.assertEquals(2 * CONTENT.length,
inputStats.getProcessedBytes());
Review Comment:
## CodeQL / Result of multiplication cast to wider type
Potential overflow in [int multiplication](1) before it is converted to long
by use in an invocation context.
[Show more
details](https://github.com/apache/druid/security/code-scanning/11687)
##########
extensions-contrib/aliyun-oss-extensions/src/test/java/org/apache/druid/data/input/aliyun/OssInputSourceTest.java:
##########
@@ -585,20 +590,20 @@
InputSourceReader reader = inputSource.reader(
someSchema,
new CsvInputFormat(ImmutableList.of("time", "dim1", "dim2"), "|",
false, null, 0, null),
- temporaryFolder.newFolder()
+ newFolder(temporaryFolder, "junit")
);
final InputStats inputStats = new InputStatsImpl();
CloseableIterator<InputRow> iterator = reader.read(inputStats);
while (iterator.hasNext()) {
InputRow nextRow = iterator.next();
- Assert.assertEquals(NOW, nextRow.getTimestamp());
- Assert.assertEquals("hello", nextRow.getDimension("dim1").get(0));
- Assert.assertEquals("world", nextRow.getDimension("dim2").get(0));
+ Assertions.assertEquals(NOW, nextRow.getTimestamp());
+ Assertions.assertEquals("hello", nextRow.getDimension("dim1").get(0));
+ Assertions.assertEquals("world", nextRow.getDimension("dim2").get(0));
}
- Assert.assertEquals(2 * CONTENT.length, inputStats.getProcessedBytes());
+ Assertions.assertEquals(2 * CONTENT.length,
inputStats.getProcessedBytes());
Review Comment:
## CodeQL / Result of multiplication cast to wider type
Potential overflow in [int multiplication](1) before it is converted to long
by use in an invocation context.
[Show more
details](https://github.com/apache/druid/security/code-scanning/11688)
##########
extensions-contrib/rabbit-stream-indexing-service/src/test/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfigTest.java:
##########
@@ -61,22 +56,22 @@
TuningConfig.class
);
- Assert.assertNull(config.getBasePersistDirectory());
- Assert.assertEquals(new OnheapIncrementalIndex.Spec(),
config.getAppendableIndexSpec());
- Assert.assertEquals(150000, config.getMaxRowsInMemory());
- Assert.assertEquals(5_000_000, config.getMaxRowsPerSegment().intValue());
- Assert.assertEquals(new Period("PT10M"),
config.getIntermediatePersistPeriod());
- Assert.assertEquals(0, config.getMaxPendingPersists());
- // Assert.assertEquals(IndexSpec.getDefault(), config.getIndexSpec());
- Assert.assertEquals(false, config.isReportParseExceptions());
- Assert.assertEquals(Duration.ofMinutes(15).toMillis(),
config.getHandoffConditionTimeout());
-
- Assert.assertNull(config.getRecordBufferSizeConfigured());
- Assert.assertEquals(10000,
config.getRecordBufferSizeOrDefault(1_000_000_000));
- Assert.assertEquals(5000, config.getRecordBufferOfferTimeout());
-
- Assert.assertFalse(config.isSkipSequenceNumberAvailabilityCheck());
- Assert.assertFalse(config.isResetOffsetAutomatically());
+ Assertions.assertNull(config.getBasePersistDirectory());
+ Assertions.assertEquals(new OnheapIncrementalIndex.Spec(),
config.getAppendableIndexSpec());
+ Assertions.assertEquals(150000, config.getMaxRowsInMemory());
+ Assertions.assertEquals(5_000_000,
config.getMaxRowsPerSegment().intValue());
+ Assertions.assertEquals(new Period("PT10M"),
config.getIntermediatePersistPeriod());
+ Assertions.assertEquals(0, config.getMaxPendingPersists());
Review Comment:
## CodeQL / Deprecated method or constructor invocation
Invoking [SeekableStreamIndexTaskTuningConfig.getMaxPendingPersists](1)
should be avoided because it has been deprecated.
[Show more
details](https://github.com/apache/druid/security/code-scanning/11690)
##########
extensions-contrib/aliyun-oss-extensions/src/test/java/org/apache/druid/storage/aliyun/OssDataSegmentMoverTest.java:
##########
@@ -150,27 +154,29 @@
), ImmutableMap.of("bucket", "DOES NOT EXIST", "baseKey", "baseKey"));
}
- @Test(expected = SegmentLoadingException.class)
- public void testFailsToMoveMissing() throws Exception
+ @Test
+ public void testFailsToMoveMissing()
{
- MockClient client = new MockClient();
- OssDataSegmentMover mover = new
OssDataSegmentMover(Suppliers.ofInstance(client), new OssStorageConfig());
- mover.move(new DataSegment(
- "test",
- Intervals.of("2013-01-01/2013-01-02"),
- "1",
- ImmutableMap.of(
- "key",
-
"baseKey/test/2013-01-01T00:00:00.000Z_2013-01-02T00:00:00.000Z/1/0/index.zip",
- "bucket",
- "DOES NOT EXIST"
- ),
- ImmutableList.of("dim1", "dim1"),
- ImmutableList.of("metric1", "metric2"),
- NoneShardSpec.instance(),
- 0,
- 1
- ), ImmutableMap.of("bucket", "DOES NOT EXIST", "baseKey", "baseKey2"));
+ assertThrows(SegmentLoadingException.class, () -> {
+ MockClient client = new MockClient();
+ OssDataSegmentMover mover = new
OssDataSegmentMover(Suppliers.ofInstance(client), new OssStorageConfig());
+ mover.move(new DataSegment(
+ "test",
+ Intervals.of("2013-01-01/2013-01-02"),
+ "1",
+ ImmutableMap.of(
+ "key",
+
"baseKey/test/2013-01-01T00:00:00.000Z_2013-01-02T00:00:00.000Z/1/0/index.zip",
+ "bucket",
+ "DOES NOT EXIST"
+ ),
+ ImmutableList.of("dim1", "dim1"),
+ ImmutableList.of("metric1", "metric2"),
+ NoneShardSpec.instance(),
+ 0,
+ 1
+ ), ImmutableMap.of("bucket", "DOES NOT EXIST", "baseKey", "baseKey2"));
Review Comment:
## CodeQL / Deprecated method or constructor invocation
Invoking [DataSegment.DataSegment](1) should be avoided because it has been
deprecated.
[Show more
details](https://github.com/apache/druid/security/code-scanning/11689)
##########
extensions-contrib/rabbit-stream-indexing-service/src/test/java/org/apache/druid/indexing/rabbitstream/RabbitStreamIndexTaskTuningConfigTest.java:
##########
@@ -106,18 +101,18 @@
TuningConfig.class
);
- Assert.assertNull(config.getBasePersistDirectory());
- Assert.assertEquals(new OnheapIncrementalIndex.Spec(),
config.getAppendableIndexSpec());
- Assert.assertEquals(100, config.getMaxRowsInMemory());
- Assert.assertEquals(100, config.getMaxRowsPerSegment().intValue());
- Assert.assertEquals(new Period("PT1H"),
config.getIntermediatePersistPeriod());
- Assert.assertEquals(100, config.getMaxPendingPersists());
- Assert.assertTrue(config.isReportParseExceptions());
- Assert.assertEquals(100, config.getHandoffConditionTimeout());
- Assert.assertEquals(1000, (int) config.getRecordBufferSizeConfigured());
- Assert.assertEquals(1000,
config.getRecordBufferSizeOrDefault(1_000_000_000));
- Assert.assertEquals(500, config.getRecordBufferOfferTimeout());
- Assert.assertFalse(config.isResetOffsetAutomatically());
+ Assertions.assertNull(config.getBasePersistDirectory());
+ Assertions.assertEquals(new OnheapIncrementalIndex.Spec(),
config.getAppendableIndexSpec());
+ Assertions.assertEquals(100, config.getMaxRowsInMemory());
+ Assertions.assertEquals(100, config.getMaxRowsPerSegment().intValue());
+ Assertions.assertEquals(new Period("PT1H"),
config.getIntermediatePersistPeriod());
+ Assertions.assertEquals(100, config.getMaxPendingPersists());
Review Comment:
## CodeQL / Deprecated method or constructor invocation
Invoking [SeekableStreamIndexTaskTuningConfig.getMaxPendingPersists](1)
should be avoided because it has been deprecated.
[Show more
details](https://github.com/apache/druid/security/code-scanning/11691)
##########
extensions-contrib/rabbit-stream-indexing-service/src/test/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfigTest.java:
##########
@@ -134,22 +129,22 @@
TuningConfig.class)),
TuningConfig.class);
- Assert.assertNull(config.getBasePersistDirectory());
- Assert.assertEquals(new OnheapIncrementalIndex.Spec(),
config.getAppendableIndexSpec());
- Assert.assertEquals(100, config.getMaxRowsInMemory());
- Assert.assertEquals(100, config.getMaxRowsPerSegment().intValue());
- Assert.assertEquals(new Period("PT1H"),
config.getIntermediatePersistPeriod());
- Assert.assertEquals(100, config.getMaxPendingPersists());
- Assert.assertEquals(true, config.isReportParseExceptions());
- Assert.assertEquals(100, config.getHandoffConditionTimeout());
- Assert.assertEquals(12, (int) config.getWorkerThreads());
- Assert.assertEquals(14L, (long) config.getChatRetries());
- Assert.assertEquals(15, (int) config.getRecordBufferSizeConfigured());
- Assert.assertEquals(16, (int) config.getRecordBufferOfferTimeout());
- Assert.assertEquals(17, (int) config.getMaxRecordsPerPollConfigured());
- Assert.assertEquals(Duration.standardSeconds(15), config.getHttpTimeout());
- Assert.assertEquals(Duration.standardSeconds(95),
config.getShutdownTimeout());
- Assert.assertEquals(Duration.standardSeconds(120),
config.getRepartitionTransitionDuration());
+ Assertions.assertNull(config.getBasePersistDirectory());
+ Assertions.assertEquals(new OnheapIncrementalIndex.Spec(),
config.getAppendableIndexSpec());
+ Assertions.assertEquals(100, config.getMaxRowsInMemory());
+ Assertions.assertEquals(100, config.getMaxRowsPerSegment().intValue());
+ Assertions.assertEquals(new Period("PT1H"),
config.getIntermediatePersistPeriod());
+ Assertions.assertEquals(100, config.getMaxPendingPersists());
Review Comment:
## CodeQL / Deprecated method or constructor invocation
Invoking [SeekableStreamIndexTaskTuningConfig.getMaxPendingPersists](1)
should be avoided because it has been deprecated.
[Show more
details](https://github.com/apache/druid/security/code-scanning/11693)
##########
extensions-contrib/rabbit-stream-indexing-service/src/test/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisorTuningConfigTest.java:
##########
@@ -87,21 +82,21 @@
TuningConfig.class)),
TuningConfig.class);
- Assert.assertNull(config.getBasePersistDirectory());
- Assert.assertEquals(new OnheapIncrementalIndex.Spec(),
config.getAppendableIndexSpec());
- Assert.assertEquals(150000, config.getMaxRowsInMemory());
- Assert.assertEquals(5_000_000, config.getMaxRowsPerSegment().intValue());
- Assert.assertEquals(new Period("PT10M"),
config.getIntermediatePersistPeriod());
- Assert.assertEquals(0, config.getMaxPendingPersists());
- // Assert.assertEquals(IndexSpec.getDefault(), config.getIndexSpec());
- Assert.assertEquals(false, config.isReportParseExceptions());
- Assert.assertEquals(java.time.Duration.ofMinutes(15).toMillis(),
config.getHandoffConditionTimeout());
- Assert.assertNull(config.getWorkerThreads());
- Assert.assertEquals(8L, (long) config.getChatRetries());
- Assert.assertEquals(Duration.standardSeconds(10), config.getHttpTimeout());
- Assert.assertEquals(Duration.standardSeconds(80),
config.getShutdownTimeout());
- Assert.assertEquals(Duration.standardSeconds(120),
config.getRepartitionTransitionDuration());
- Assert.assertEquals(100, config.getMaxRecordsPerPollOrDefault());
+ Assertions.assertNull(config.getBasePersistDirectory());
+ Assertions.assertEquals(new OnheapIncrementalIndex.Spec(),
config.getAppendableIndexSpec());
+ Assertions.assertEquals(150000, config.getMaxRowsInMemory());
+ Assertions.assertEquals(5_000_000,
config.getMaxRowsPerSegment().intValue());
+ Assertions.assertEquals(new Period("PT10M"),
config.getIntermediatePersistPeriod());
+ Assertions.assertEquals(0, config.getMaxPendingPersists());
Review Comment:
## CodeQL / Deprecated method or constructor invocation
Invoking [SeekableStreamIndexTaskTuningConfig.getMaxPendingPersists](1)
should be avoided because it has been deprecated.
[Show more
details](https://github.com/apache/druid/security/code-scanning/11692)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]