mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
SettingsImpl.checkpointRetry is hardcoded to false in builder. Prior to this change, users are unable to set queue.checkpoint.retry to true to enable Windows retry on PQ AccessDeniedException in checkpoint.
Fixed: #14486
(cherry picked from commit 3a78621109
)
Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
This commit is contained in:
parent
38574bd6ee
commit
fa35bb8f97
2 changed files with 38 additions and 6 deletions
|
@ -169,7 +169,7 @@ public class SettingsImpl implements Settings {
|
|||
public Builder elementClass(final Class<? extends Queueable> elementClass) {
|
||||
return new BuilderImpl(
|
||||
this.dirForFiles, elementClass, this.capacity, this.queueMaxBytes, this.maxUnread,
|
||||
this.checkpointMaxAcks, this.checkpointMaxWrites, false
|
||||
this.checkpointMaxAcks, this.checkpointMaxWrites, this.checkpointRetry
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ public class SettingsImpl implements Settings {
|
|||
public Builder capacity(final int capacity) {
|
||||
return new BuilderImpl(
|
||||
this.dirForFiles, this.elementClass, capacity, this.queueMaxBytes, this.maxUnread,
|
||||
this.checkpointMaxAcks, this.checkpointMaxWrites, false
|
||||
this.checkpointMaxAcks, this.checkpointMaxWrites, this.checkpointRetry
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ public class SettingsImpl implements Settings {
|
|||
public Builder queueMaxBytes(final long size) {
|
||||
return new BuilderImpl(
|
||||
this.dirForFiles, this.elementClass, this.capacity, size, this.maxUnread,
|
||||
this.checkpointMaxAcks, this.checkpointMaxWrites, false
|
||||
this.checkpointMaxAcks, this.checkpointMaxWrites, this.checkpointRetry
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ public class SettingsImpl implements Settings {
|
|||
return new BuilderImpl(
|
||||
this.dirForFiles, this.elementClass,
|
||||
this.capacity, this.queueMaxBytes, maxUnread, this.checkpointMaxAcks,
|
||||
this.checkpointMaxWrites, false
|
||||
this.checkpointMaxWrites, this.checkpointRetry
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ public class SettingsImpl implements Settings {
|
|||
return new BuilderImpl(
|
||||
this.dirForFiles, this.elementClass,
|
||||
this.capacity, this.queueMaxBytes, this.maxUnread, checkpointMaxAcks,
|
||||
this.checkpointMaxWrites, false
|
||||
this.checkpointMaxWrites, this.checkpointRetry
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ public class SettingsImpl implements Settings {
|
|||
public Builder checkpointMaxWrites(final int checkpointMaxWrites) {
|
||||
return new BuilderImpl(
|
||||
this.dirForFiles, this.elementClass, this.capacity, this.queueMaxBytes,
|
||||
this.maxUnread, this.checkpointMaxAcks, checkpointMaxWrites, false
|
||||
this.maxUnread, this.checkpointMaxAcks, checkpointMaxWrites, this.checkpointRetry
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package org.logstash.ackedqueue;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class SettingsImplTest {
|
||||
|
||||
@Test
|
||||
public void verifyConfiguredValues() {
|
||||
Settings settings = SettingsImpl.fileSettingsBuilder("PATH/TO/Q")
|
||||
.capacity(10)
|
||||
.maxUnread(1024)
|
||||
.queueMaxBytes(2147483647)
|
||||
.checkpointMaxAcks(1)
|
||||
.checkpointMaxWrites(1)
|
||||
.checkpointRetry(true)
|
||||
.elementClass(StringElement.class)
|
||||
.build();
|
||||
|
||||
assertEquals(settings.getDirPath(), "PATH/TO/Q");
|
||||
assertEquals(settings.getCapacity(), 10);
|
||||
assertEquals(settings.getMaxUnread(), 1024);
|
||||
assertEquals(settings.getQueueMaxBytes(), 2147483647);
|
||||
assertEquals(settings.getCheckpointMaxAcks(), 1);
|
||||
assertEquals(settings.getCheckpointMaxWrites(), 1);
|
||||
assertTrue(settings.getCheckpointRetry());
|
||||
assertEquals(settings.getElementClass(), StringElement.class);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue