mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
parent
ca1962f697
commit
0e1a95e7cf
3 changed files with 18 additions and 18 deletions
|
@ -65,7 +65,7 @@ public class Queue implements Closeable {
|
||||||
private final AtomicBoolean closed;
|
private final AtomicBoolean closed;
|
||||||
|
|
||||||
// deserialization
|
// deserialization
|
||||||
private final Class elementClass;
|
private final Class<? extends Queueable> elementClass;
|
||||||
private final Method deserializeMethod;
|
private final Method deserializeMethod;
|
||||||
|
|
||||||
// thread safety
|
// thread safety
|
||||||
|
@ -93,7 +93,9 @@ public class Queue implements Closeable {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Queue(String dirPath, int pageCapacity, long maxBytes, CheckpointIO checkpointIO, PageIOFactory pageIOFactory, Class elementClass, int maxUnread, int checkpointMaxWrites, int checkpointMaxAcks) {
|
private Queue(String dirPath, int pageCapacity, long maxBytes, CheckpointIO checkpointIO,
|
||||||
|
PageIOFactory pageIOFactory, Class<? extends Queueable> elementClass, int maxUnread,
|
||||||
|
int checkpointMaxWrites, int checkpointMaxAcks) {
|
||||||
this.dirPath = dirPath;
|
this.dirPath = dirPath;
|
||||||
this.pageCapacity = pageCapacity;
|
this.pageCapacity = pageCapacity;
|
||||||
this.maxBytes = maxBytes;
|
this.maxBytes = maxBytes;
|
||||||
|
|
|
@ -9,7 +9,7 @@ public interface Settings {
|
||||||
|
|
||||||
PageIOFactory getPageIOFactory();
|
PageIOFactory getPageIOFactory();
|
||||||
|
|
||||||
Class getElementClass();
|
Class<? extends Queueable> getElementClass();
|
||||||
|
|
||||||
String getDirPath();
|
String getDirPath();
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ public interface Settings {
|
||||||
|
|
||||||
Builder elementIOFactory(PageIOFactory factory);
|
Builder elementIOFactory(PageIOFactory factory);
|
||||||
|
|
||||||
Builder elementClass(Class elementClass);
|
Builder elementClass(Class<? extends Queueable> elementClass);
|
||||||
|
|
||||||
Builder capacity(int capacity);
|
Builder capacity(int capacity);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ public class SettingsImpl implements Settings {
|
||||||
private String dirForFiles;
|
private String dirForFiles;
|
||||||
private CheckpointIOFactory checkpointIOFactory;
|
private CheckpointIOFactory checkpointIOFactory;
|
||||||
private PageIOFactory pageIOFactory;
|
private PageIOFactory pageIOFactory;
|
||||||
private Class elementClass;
|
private Class<? extends Queueable> elementClass;
|
||||||
private int capacity;
|
private int capacity;
|
||||||
private long queueMaxBytes;
|
private long queueMaxBytes;
|
||||||
private int maxUnread;
|
private int maxUnread;
|
||||||
|
@ -36,11 +36,10 @@ public class SettingsImpl implements Settings {
|
||||||
.checkpointMaxWrites(1);
|
.checkpointMaxWrites(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SettingsImpl(final String dirForFiles,
|
private SettingsImpl(final String dirForFiles, final CheckpointIOFactory checkpointIOFactory,
|
||||||
final CheckpointIOFactory checkpointIOFactory,
|
final PageIOFactory pageIOFactory, final Class<? extends Queueable> elementClass,
|
||||||
final PageIOFactory pageIOFactory, final Class elementClass, final int capacity,
|
final int capacity, final long queueMaxBytes, final int maxUnread,
|
||||||
final long queueMaxBytes, final int maxUnread, final int checkpointMaxAcks,
|
final int checkpointMaxAcks, final int checkpointMaxWrites) {
|
||||||
final int checkpointMaxWrites) {
|
|
||||||
this.dirForFiles = dirForFiles;
|
this.dirForFiles = dirForFiles;
|
||||||
this.checkpointIOFactory = checkpointIOFactory;
|
this.checkpointIOFactory = checkpointIOFactory;
|
||||||
this.pageIOFactory = pageIOFactory;
|
this.pageIOFactory = pageIOFactory;
|
||||||
|
@ -72,7 +71,7 @@ public class SettingsImpl implements Settings {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class getElementClass() {
|
public Class<? extends Queueable> getElementClass() {
|
||||||
return this.elementClass;
|
return this.elementClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +131,7 @@ public class SettingsImpl implements Settings {
|
||||||
|
|
||||||
private final PageIOFactory pageIOFactory;
|
private final PageIOFactory pageIOFactory;
|
||||||
|
|
||||||
private final Class elementClass;
|
private final Class<? extends Queueable> elementClass;
|
||||||
|
|
||||||
private final int capacity;
|
private final int capacity;
|
||||||
|
|
||||||
|
@ -150,11 +149,10 @@ public class SettingsImpl implements Settings {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BuilderImpl(final String dirForFiles,
|
private BuilderImpl(final String dirForFiles, final CheckpointIOFactory checkpointIOFactory,
|
||||||
final CheckpointIOFactory checkpointIOFactory,
|
final PageIOFactory pageIOFactory, final Class<? extends Queueable> elementClass,
|
||||||
final PageIOFactory pageIOFactory, final Class elementClass, final int capacity,
|
final int capacity, final long queueMaxBytes, final int maxUnread,
|
||||||
final long queueMaxBytes, final int maxUnread, final int checkpointMaxAcks,
|
final int checkpointMaxAcks, final int checkpointMaxWrites) {
|
||||||
final int checkpointMaxWrites) {
|
|
||||||
this.dirForFiles = dirForFiles;
|
this.dirForFiles = dirForFiles;
|
||||||
this.checkpointIOFactory = checkpointIOFactory;
|
this.checkpointIOFactory = checkpointIOFactory;
|
||||||
this.pageIOFactory = pageIOFactory;
|
this.pageIOFactory = pageIOFactory;
|
||||||
|
@ -186,7 +184,7 @@ public class SettingsImpl implements Settings {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder elementClass(final Class elementClass) {
|
public Builder elementClass(final Class<? extends Queueable> elementClass) {
|
||||||
return new BuilderImpl(
|
return new BuilderImpl(
|
||||||
this.dirForFiles, this.checkpointIOFactory, this.pageIOFactory, elementClass,
|
this.dirForFiles, this.checkpointIOFactory, this.pageIOFactory, elementClass,
|
||||||
this.capacity,
|
this.capacity,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue