mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Removed unused configHash computation that can be replaced by PipelineConfig.configHash() (#17336) (#17345)
Removed unused configHash computation happening in AbstractPipeline and used only in tests replaced by PipelineConfig.configHash() invocation
(cherry picked from commit 787fd2c62f
)
Co-authored-by: Andrea Selva <selva.andre@gmail.com>
This commit is contained in:
parent
7f74ce34a9
commit
6d21e30bb9
2 changed files with 1 additions and 15 deletions
|
@ -60,7 +60,7 @@ describe LogStash::PipelineAction::Reload do
|
|||
|
||||
it "run the new pipeline code" do
|
||||
subject.execute(agent, pipelines)
|
||||
expect(pipelines.get_pipeline(pipeline_id).config_hash).to eq(new_pipeline_config.config_hash)
|
||||
expect(pipelines.get_pipeline(pipeline_id).pipeline_config.config_hash).to eq(new_pipeline_config.config_hash)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.io.StringWriter;
|
|||
import java.nio.file.FileStore;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.temporal.TemporalUnit;
|
||||
|
@ -48,7 +47,6 @@ import java.util.stream.Collectors;
|
|||
import java.util.stream.Stream;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.jruby.Ruby;
|
||||
|
@ -146,8 +144,6 @@ public class AbstractPipelineExt extends RubyBasicObject {
|
|||
@SuppressWarnings({"rawtypes", "serial"})
|
||||
private List<SourceWithMetadata> configParts;
|
||||
|
||||
private RubyString configHash;
|
||||
|
||||
private transient IRubyObject settings;
|
||||
|
||||
private transient IRubyObject pipelineSettings;
|
||||
|
@ -263,11 +259,6 @@ public class AbstractPipelineExt extends RubyBasicObject {
|
|||
pipelineSettings = pipelineConfig;
|
||||
configString = (RubyString) pipelineSettings.callMethod(context, "config_string");
|
||||
configParts = pipelineSettings.toJava(PipelineConfig.class).getConfigParts();
|
||||
configHash = context.runtime.newString(
|
||||
Hex.encodeHexString(
|
||||
MessageDigest.getInstance("SHA1").digest(configString.getBytes())
|
||||
)
|
||||
);
|
||||
settings = pipelineSettings.callMethod(context, "settings");
|
||||
final IRubyObject id = getSetting(context, SettingKeyDefinitions.PIPELINE_ID);
|
||||
if (id.isNil()) {
|
||||
|
@ -356,11 +347,6 @@ public class AbstractPipelineExt extends RubyBasicObject {
|
|||
return configString;
|
||||
}
|
||||
|
||||
@JRubyMethod(name = "config_hash")
|
||||
public final RubyString configHash() {
|
||||
return configHash;
|
||||
}
|
||||
|
||||
@JRubyMethod(name = "ephemeral_id")
|
||||
public final RubyString ephemeralId() {
|
||||
return ephemeralId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue