mirror of https://github.com/apache/druid.git
fix according to code review
This commit is contained in:
parent
aeb411a3a3
commit
bad1a7e9f8
|
@ -83,11 +83,10 @@ public class EventReceiverFirehoseFactory implements FirehoseFactory
|
||||||
config.getFirehoseIdPrefix(),
|
config.getFirehoseIdPrefix(),
|
||||||
Preconditions.checkNotNull(firehoseId, "firehoseId")
|
Preconditions.checkNotNull(firehoseId, "firehoseId")
|
||||||
);
|
);
|
||||||
this.config = config;
|
|
||||||
} else {
|
} else {
|
||||||
this.serviceName = Preconditions.checkNotNull(serviceName, "serviceName");
|
this.serviceName = Preconditions.checkNotNull(serviceName, "serviceName");
|
||||||
this.config = null;
|
|
||||||
}
|
}
|
||||||
|
this.config = config;
|
||||||
|
|
||||||
this.bufferSize = bufferSize == null || bufferSize <= 0 ? DEFAULT_BUFFER_SIZE : bufferSize;
|
this.bufferSize = bufferSize == null || bufferSize <= 0 ? DEFAULT_BUFFER_SIZE : bufferSize;
|
||||||
this.parser = Preconditions.checkNotNull(parser, "parser");
|
this.parser = Preconditions.checkNotNull(parser, "parser");
|
||||||
|
@ -122,7 +121,7 @@ public class EventReceiverFirehoseFactory implements FirehoseFactory
|
||||||
public String getFirehoseId()
|
public String getFirehoseId()
|
||||||
{
|
{
|
||||||
if (config != null) {
|
if (config != null) {
|
||||||
return serviceName.replaceFirst(config.getFirehoseIdPrefix(), "");
|
return serviceName.replaceFirst(String.format("%s:", config.getFirehoseIdPrefix()), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue